Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

encom

---- WIN32 problem ----

This topic is 6130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement



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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!