Original Post
🔒 Locked
Tutorial for Loading an Icon
Advertisement
I think the api call is LoadIcon
http://msdn.microsoft.com/library/default.asp
Then click "Platform SDK"
Then "Win32 API"
Then "Reference"
Then "Functions by Category"
Then "Icon"
All the icon functions are there
-Magmai Kai Holmlor
I am brazen and fear no flames.
(So long as I don't lose this Ring of Fire Protection +5)
http://msdn.microsoft.com/library/default.asp
Then click "Platform SDK"
Then "Win32 API"
Then "Reference"
Then "Functions by Category"
Then "Icon"
All the icon functions are there
-Magmai Kai Holmlor
I am brazen and fear no flames.
(So long as I don't lose this Ring of Fire Protection +5)
quote:
Original post by Zeke
Can anyone point me in the direction of how to Load an Icon for a window? Or just a general beginner windows programming tutorial.
Thanks
Loading an Icon for a window is quite easy, all you need to do is allocate it within the winmain function when you enter all the details in your class structure before passing the info onto create window, somthing along the following lines should do the trick.
HWND hWnd;
MSG lpMsg;
WNDCLASS wcApp;
wcApp.lpszClassName = szProgName;
wcApp.hInstance = hInst;
wcApp.lpfnWndProc = WndProc;
wcApp.hCursor = LoadCursor(NULL,IDC_ARROW);
wcApp.hIcon = <- Here is where you allocate
your icon, basicly you need
to use the Make Resource
Function to turn it into
a resource pointer from the
RC file linked with your
Project.
wcApp.lpszMenuName = 0;
wcApp.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcApp.style = CS_HREDRAW/CS_VREDRAW;
wcApp.cbClsExtra = 0;
wcApp.cbWndExtra = 0;
if(!RegisterClass(&wcApp))
return 0;
If you need any more help, iv''e got a couple of full examples that iv''e written in MSVC6.0 with the project settings etc, e-mail me or ICQ me and i''ll send you them.
This is the Sound of
### # # ### # # ### # #
# # # # # # # # # # #
### #### ### # # # # ###
# # # # # # # # # #
### # # # # ##### # ##
Still Code Crazy, Best and only way to be!!
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement