WetCode

Untitled

Dec 4th, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1.     HMODULE hExe = LoadLibrary("TestRes.exe");
  2.     EnumResourceTypes(hExe, (ENUMRESTYPEPROC)ResTypes, 0);
  3.  
  4.     // Find the group resource which lists its images
  5.                                 /* Need to set "IconGrpName" this from ResTypee */
  6.     HRSRC hRsrc = FindResource( hExe, MAKEINTRESOURCE(1), RT_GROUP_ICON );
  7.     // Load and Lock to get a pointer to a GRPICONDIR
  8.     HGLOBAL hGlobal = LoadResource( hExe, hRsrc );
  9.     GRPICONDIR *lpIconGroup = new GRPICONDIR[ SizeofResource( hExe, hRsrc ) ];
  10.     RtlZeroMemory( lpIconGroup, SizeofResource( hExe, hRsrc ) );
  11.     lpIconGroup = (GRPICONDIR*)LockResource( hGlobal );
  12.     // We now have the header of the icon file now we need all the icons.
  13.    
  14.     cout << "Icon Count: " << lpIconGroup->idCount << endl;
  15.     cout << "Type: " << lpIconGroup->idType  << endl;
Advertisement
Add Comment
Please, Sign In to add comment