• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Cursor / Icon

I want to make a program with buttons display icons . Since an exercute file contains some icons/cursor in it without an separate .cur or .ico file , how can I extract those icon to make short cut or display it on my interface ?
0
ahTri
Asked:
ahTri
  • 4
  • 2
1 Solution
 
nietodCommented:
LoadIcon() and LoadCursor() are one way.  But LoadImage() might be the best.
0
 
nietodCommented:
LoadIcon() and LoadCursor() are one way.  But LoadImage() might be the best.
0
 
ahTriAuthor Commented:
I know about those function, how to LoadIcon() when u dont have the resource ID !!!! what I want to know is how to extract the icon from an existing program on the computer
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
nietodCommented:
Use LoadLibrary() and FreeLibrary() to load EXEs or DLLs you want to extract from.

Use EnumResourceNames() to enumerate each of the cursor or icon bitmaps in a module (DLL or EXE).  The use the functions I suggested above.
0
 
ahTriAuthor Commented:
I have not try yet cos I dont have the help file or manual here, does it need to load up the resource from the module every times the program exercute or just once and stay as static ?
0
 
nietodCommented:
That depends on what you need to do.  Obviously you will need the data (resource) every time you intend t use it.  So the question is how do you intend to use it?

If you plan to show the icons of all the files it finds in a directory, then each time it is run it could load all those files and extract their icons.  However, if you plan to allow users to browse icons in other files and then "use" them in your own program (even if those files are later deleted), then that sort of approach won't work.  In that case you will need to save the data (resource) in some way so your program can obtain it as needed.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now