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
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
Your mom is like a struct, she has no class
How many C programmers does it take to screw in a light bulb? One to do it, 99 to tell him how to do it faster.
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
Your mom is like a struct, she has no class
How many C programmers does it take to screw in a light bulb? One to do it, 99 to tell him how to do it faster.
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));
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared