Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cursor / Icon

Posted on 1999-01-13
6
Medium Priority
?
238 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 150 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
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.

 
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

Technology Partners: 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!

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
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++.

609 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