Sign in to follow this  
Waaayoff

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

Recommended Posts

Waaayoff    952
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
Waaayoff    952
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
Waaayoff    952
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
Waaayoff    952
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
Aardvajk    13207
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this