-
Display Small Icon ???
Pretty new to Windows programming. Trying to display icon in title bar on Non-Dialog window.
Code:
//This works
wincl.hIconSm = (HICON)LoadImage(hThisInstance, "mjsconvert2.ico", IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
Code:
//But this doesn't
wincl.hIconSm = (HICON)LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_ICO2), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
Code:
//Neither does this
wincl.hIconSm = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDI_ICO2));
I can get icon to display with first example, but this requires external icon file.
Can somebody please explain how to do this and why other examples do not work.
Using Dev-cpp 4.9.9.1 with MingW 3.3.1
All Examples compile just fine.
-
Set the icon when you register the window class, or during runtime you can set a new icon by sending the WM_SETICON message after calling LoadIcon().