| 25 | using ResourceLangDir = rcedit::Resources::ResourceLangDir; |
| 26 | |
| 27 | std::wstring StringFromResourceId( LPCWSTR resId ) |
| 28 | { |
| 29 | const std::wstring kNaN( L"#NaN" ); |
| 30 | |
| 31 | if( resId == nullptr ) { |
| 32 | return kNaN; |
| 33 | } |
| 34 | |
| 35 | // TODO: did not found a size limit on resource size |
| 36 | if( IS_INTRESOURCE( resId ) == FALSE ) { |
| 37 | return resId; |
| 38 | } |
| 39 | |
| 40 | #pragma warning( push ) |
| 41 | #pragma warning( disable : 4302 ) |
| 42 | const WORD id = reinterpret_cast<size_t>(resId) & 0xFFFF; |
| 43 | #pragma warning( pop ) |
| 44 | |
| 45 | try { |
| 46 | return L"#" + std::to_wstring( id ); |
| 47 | } |
| 48 | catch( const std::exception& e ) { |
| 49 | spdlog::debug( "Failed to convert resource id: {}", e.what() ); |
| 50 | return kNaN; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | BOOL CALLBACK EnumResourceTypeCb( HMODULE, LPWSTR lpType, LONG_PTR lParam ) |
| 55 | { |
no test coverage detected