Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct tagEXERESINFO
- {
- std::vector<LPTSTR> vecIconNames;
- std::vector<LPTSTR> vecGroupNames;
- std::vector<WORD> wLangIcon;
- std::vector<WORD> wLangGroup;
- int nIconCount;
- int nGroupCount;
- } EXERESINFO, *LPEXERESINFO;
- //a global vector for storing lpName's
- // and yes I know this is evil
- EXERESINFO oldExeResInfo;
- ///////////////////////////////////
- BOOL ResLang( HMODULE hModule, LPCTSTR lpszType, LPCTSTR lpszName, WORD wIDLanguage, LONG_PTR lParam)
- {
- if (!IS_INTRESOURCE(lpszName))
- {
- if ( lpszType == RT_ICON )
- {
- oldExeResInfo.wLangIcon.push_back( wIDLanguage );
- } else if ( lpszType == (RT_ICON + 11) )
- {
- oldExeResInfo.wLangGroup.push_back( wIDLanguage );
- } else {
- // ....
- }
- } else if ( IS_INTRESOURCE(lpszName) ) {
- if ( lpszType == RT_ICON )
- {
- oldExeResInfo.wLangIcon.push_back( wIDLanguage );
- } else if ( lpszType == (RT_ICON + 11) )
- {
- oldExeResInfo.wLangGroup.push_back( wIDLanguage );
- } else {
- // ....
- }
- } else {
- return FALSE;
- }
- return TRUE;
- }
- BOOL ResNames(HMODULE hModule, LPCTSTR lpType, LPTSTR lpName, LONG lParam)
- {
- if (!IS_INTRESOURCE(lpName))
- {
- std::cout << "lpType in Names: " << lpType << std::endl;
- std::cout << "lpType in Names: " << lpName << std::endl;
- } else {
- std::cout <<GetLastError()<< "lpType in Names: " << (short)lpType << std::endl;
- if ( lpType == RT_ICON )
- {
- oldExeResInfo.nIconCount++;
- oldExeResInfo.vecIconNames.push_back( lpName );
- EnumResourceLanguages( hModule, lpType, lpName, (ENUMRESLANGPROC)ResLang, 0);
- }
- if ( lpType == (RT_ICON + 11))
- {
- oldExeResInfo.nGroupCount++;
- oldExeResInfo.vecGroupNames.push_back( lpName );
- EnumResourceLanguages( hModule, lpType, lpName, (ENUMRESLANGPROC)ResLang, 0);
- }
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment