Solved

Cursor / Icon

Posted on 1999-01-13
6
228 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
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!

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

737 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