• Advertisement
Sign in to follow this  

Loading custom Icons/Cursors in Win32 w/o using resource files?

This topic is 2861 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

I've been wondering if there's a function i can use you load an icon/cursor directly from a directory without having to use resource files? Learning how to use resource files is on my Todo list, but it's currently not at the top ;)

Share this post


Link to post
Share on other sites
Advertisement
Did you try LoadCursorFromFile() and ExtractIcon() functions?

Share this post


Link to post
Share on other sites
Under which header is the function ExtractIcon()?

As for LoadCursorFromFile, how do i use it? like this?

WinClassEx.hCursor = LoadCursorFromFile(File_Name_Here);

Share this post


Link to post
Share on other sites
Well, after reading that article, not only do i feel like an idiot, but i googled what i needed and got my answer.

Ty :)

EDIT: r1nux, yep i did that, ty though.

Share this post


Link to post
Share on other sites
hmm, the icon shows up in the top bar of the application's window, but the executable's image hasn't changed. I googled it, but got no answers..

Share this post


Link to post
Share on other sites
Quote:
Original post by Waaayoff
hmm, the icon shows up in the top bar of the application's window, but the executable's image hasn't changed. I googled it, but got no answers..


Well, as far as I know the only way to set the exe icon is to use resources. Think about it - if you are loading an icon dynamically when the program is run, how would you expect file explorer to know which icon to use when the program isn't running?

Your actual application icon is best loaded as a resource. You only want to dynamically load resources if you don't know in advance which resources you are going to use.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement