Solved

Cursor / Icon

Posted on 1999-01-13
6
230 Views
Last Modified: 2010-04-02
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
Comment
Question by:ahTri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1182020
LoadIcon() and LoadCursor() are one way.  But LoadImage() might be the best.
0
 
LVL 22

Accepted Solution

by:
nietod earned 50 total points
ID: 1182021
LoadIcon() and LoadCursor() are one way.  But LoadImage() might be the best.
0
 

Author Comment

by:ahTri
ID: 1182022
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:nietod
ID: 1182023
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
 

Author Comment

by:ahTri
ID: 1182024
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
 
LVL 22

Expert Comment

by:nietod
ID: 1182025
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question