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

Started by
7 comments, last by Waaayoff 14 years, 1 month ago
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 ;)
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Advertisement
Did you try LoadCursorFromFile() and ExtractIcon() functions?
Under which header is the function ExtractIcon()?

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

WinClassEx.hCursor = LoadCursorFromFile(File_Name_Here);
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Did you try Google? What have you tried?
You might wanna check thoose functions on MSDN.
Safes you the time to wait for answers here.

LoadCursorFromFile
ExtractIcon
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.
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
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..
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
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.
That makes sense i guess. Thanks
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "

This topic is closed to new replies.

Advertisement