How od I add my own custom .ICO to the titlebar?
here is the code I use for that part...
Code:winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
~Trooper
Printable View
How od I add my own custom .ICO to the titlebar?
here is the code I use for that part...
Code:winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
~Trooper
so I would do
??Code:#define IDI_MYICON ICON "myicon.ico"
winclass.hIcon = LoadIcon(NULL, IDI_IDI_MYICON);
I tried that and didn't work.
~Trooper
Use LoadIcon() if you're loading an icon resource. You should make an icon resource first.
If you're loading the icon from a .ico file, use the LoadImage() function:
Code:LoadImage( GetModuleHandle(0), "myicon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
Easier IMO :
And:Code://*.rc file
#include "rs.h" //header containing definition of IDI_MYICON
IDI_MYICON ICON "c:\\somepath\\myiconname.ico"
You can also use a string to refer to an icon in your rc file (i think) but I have always used this...its basically the same for a cursor except you would use CURSOR where ICON is and fill in the corresponding line:Code://in .cpp
winclass.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_MYICON));
Code:winclass.hCursor = LoadCursor(hinstance, MAKEINTRESOURCE(IDC_MYCURSOR));