Author Topic: Windowed Mode Window Icon  (Read 748 times)

Azalrion

  • Delusional
  • ****
  • Posts: 1325
  • Karma: +147/-1
  • Memory Murderer
    • View Profile
Windowed Mode Window Icon
« on: October 04, 2012, 02:10:53 PM »
Just noticed something today, generic icon when running in windowed mode. Hope you don't mind the snippet / suggestion about getting it to work with the SR icon and not sure if this will work with the SR project setup (using VS myself for Irrlicht development), but might do.

Code: [Select]
HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);
HICON hSmallIcon = (HICON) LoadImage ( hInstance, MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR );
SExposedVideoData exposedData = irr::video::IVideoDriver->getExposedVideoData();
HWND hWnd = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd);
SendMessage ( hWnd, WM_SETICON, ICON_SMALL, (long)hSmallIcon );

Replacing irr::video::IVideoDriver with the instance from your device, and IDI_ICON1 to the resource name of your icon.
GA - Mod Team
GA Forums

Thy Reaper

  • BMS Lead Developer
  • BMS Administrator
  • Hopeless
  • *
  • Posts: 3237
  • Karma: +397/-8
    • View Profile
    • Blind Mind Studios
Re: Windowed Mode Window Icon
« Reply #1 on: October 04, 2012, 02:33:42 PM »
I'm sure I remember that little icon being the SR icon. Maybe it had to do with how XP treated the resource file for the file icon when no window icon was specified, or I'm just remembering wrong. If I get around to it, I'll implement this.