---- WIN32 problem ----
hi everybody,
i use to load icon, the function LoadIcon(hInst, ?);
when i use LoadIcon(hInst, "c:\iconName.ico"); it doesnt work (file iconname.ico exists of course)
compilation works, execution works, but icon doesnt appear on explorer!!
so i add this iconFile to apps resource (RC file)
when i use LoadIcon(hInst, MAKEINTRESOURCE (ICO_APPS));; it doesn''t work too !!!
compilation works, execution works, but ...icon doesnt appear X-(
there is a question now : HOW CAN I DISPLAY AN ICON ???????
or HOW CAN I AFFECT AN ICON TO MY PROG ?????
thanx a lot
It''d be really helpful if you listed the code for your resource script.
Later,
ZE.
Later,
ZE.
[twitter]warrenm[/twitter]
Are you setting the windows class to the load icon, or are you calling this funciton all by itself??
When declaring the windows propteties try that below code
WNDCLASS wc;
wc.hIcon = LoadIcon( NULL,MAKEINTRESOURCE (ICO_APPS));
Also make sure that the resource is the right name, ICO_APPS needs to corosponds to the resources name.
I''d give you more info, but i don''t have all my templete code on this computer, I just got a new one and haven''t moved everything over yet.
-Scott
-Scott
February 02, 2002 11:07 PM
LoadIcon returns a handle to the icon. To display the icon, you can use DrawIcon (and DrawIconEx), or use the handle in your window class.
I USE :
ImageList_AddIcon(iconList, LoadIcon(hInst, MAKEINTRESOURCE (ICO_STATION)));
the display function is true, i take it from a book.
The resource is true, icon exist, i can(t localize the pb !
the RC file contain :
ICO_STATION ICON DISCARDABLE "icones\\station.ico"
ICO_NETWORK ICON DISCARDABLE "icones\\network.ico"
ICO_INTERNET ICON DISCARDABLE "icones\\internet.ico"
ICO_SERVER ICON DISCARDABLE "icones\\server.ico"
ICO_SERVER_BIG ICON DISCARDABLE "icones\\serverBig.ico"
ICO_SERVER_SMALL ICON DISCARDABLE "icones\\routerSmall.ico"
ICO_ROUTER ICON DISCARDABLE "icones\\router.ico"
ImageList_AddIcon(iconList, LoadIcon(hInst, MAKEINTRESOURCE (ICO_STATION)));
the display function is true, i take it from a book.
The resource is true, icon exist, i can(t localize the pb !
the RC file contain :
ICO_STATION ICON DISCARDABLE "icones\\station.ico"
ICO_NETWORK ICON DISCARDABLE "icones\\network.ico"
ICO_INTERNET ICON DISCARDABLE "icones\\internet.ico"
ICO_SERVER ICON DISCARDABLE "icones\\server.ico"
ICO_SERVER_BIG ICON DISCARDABLE "icones\\serverBig.ico"
ICO_SERVER_SMALL ICON DISCARDABLE "icones\\routerSmall.ico"
ICO_ROUTER ICON DISCARDABLE "icones\\router.ico"
thanks a lot, it works now ..... :-)
hInst was NULL LOL
but icons are not transparent, there is a black background !
how to define a transparent color ?
hInst was NULL LOL
but icons are not transparent, there is a black background !
how to define a transparent color ?
You can edit your icons in the MSVC IDE; there''s a special setting for transparency - I think it''s a little black monitor with a green background. Anyway, just select that and draw over the parts you want to be transparent.
later,
ZE.
//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links
[if you have a link proposal, email me.]
later,
ZE.
//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links
[if you have a link proposal, email me.]
[twitter]warrenm[/twitter]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement