Go Premium for a chance to win a PS4. Enter to Win


creating an icon

Posted on 2001-06-22
Medium Priority
Last Modified: 2006-11-17
  I want to create an icon by using vc++. I have no idea about this please somebody tell me. I need step by setp instructions. And where can I find the vc++ tutorial for creating icons.
Question by:samsuni

Expert Comment

ID: 6220615
Go to the Insert -> Resource

then select icon

then you can add an icon or create a new one

save your icon to somthing.rc

after you do that then right click on the resources folder in the file view  and click add files to folder

select the .rc file you just created

compile and thats it

Expert Comment

ID: 6220620
sorry, that actual icon will be something like icon1.ico

the resource script will be somthing.rc

LVL 14

Expert Comment

ID: 6221035
You must use CreateIcon API. Description

The CreateIcon function creates an icon that has the specified size, colors, and bit patterns.

HICON CreateIcon(

    HINSTANCE hInstance,     // handle to application instance
    int nWidth,     // icon width
    int nHeight,     // icon height
    BYTE cPlanes,     // number of planes in XOR bitmask
    BYTE cBitsPixel,     // number of bits per pixel in XOR bitmask
    CONST BYTE *lpbANDbits,     // pointer to AND bitmask array
    CONST BYTE *lpbXORbits      // pointer to XOR bitmask array



Identifies the instance of the module creating the icon.


Specifies the width, in pixels, of the icon.


Specifies the height, in pixels, of the icon.


Specifies the number of planes in the XOR bitmask of the icon.


Specifies the number of bits per pixel in the XOR bitmask of the icon.


Points to an array of bytes that contains the bit values for the AND bitmask of the icon. This bitmask describes a monochrome bitmap.


Points to an array of bytes that contains the bit values for the XOR bitmask of the icon. This bitmask describes a monochrome or device-dependent color bitmap.


Return Values

If the function succeeds, the return value is the handle to an icon.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.


The nWidth and nHeight parameters must specify a width and height supported by the current display driver, because the system cannot create icons of other sizes. To determine the width and height supported by the display driver, use the GetSystemMetrics function, specifying the SM_CXICON or SM_CYICON value.
CreateIcon applies the following truth table to the AND and XOR bitmasks:

AND bitmask     XOR bitmask     Display
0     0     Black
0     1     White
1     0     Screen
1     1     Reverse screen

Ftrom this you see, that you must simple prepare

For this you see, that you must simple prepare
lpbANDbits and lpbXORbits arrays , and use this API.


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Expert Comment

ID: 6222327
About tutorial. If help files on your VC installed, choose menu
Help -> Search, in Search dialog box type: creating icons.

LVL 14

Accepted Solution

AlexVirochovsky earned 300 total points
ID: 6262001
I hope, my comment helps you. Alex

Expert Comment

ID: 6883868
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101 or Netminder will return to finalize these if still open in seven days.  Please post closing recommendations before that time.

Question(s) below appears to have been abandoned. Your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site.  If you are an EE Pro user, use the Power Search option to find them.  Anytime you have questions which are LOCKED with a Proposed Answer but does not serve your needs, please reject it and add comments as to why.  In addition, when you do grade the question, if the grade is less than an A, please add a comment as to why.  This helps all involved, as well as future persons who may access this item in the future to seek help.

To view your open questions, please click the following link(s) and keep them all current with updates.

To view your locked questions, please click the following link(s) and evaluate the proposed answer.

------------>  EXPERTS:  Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.  Also, if you are interested in the cleanup effort, please click this link http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643

Moderators will finalize this question if still open in 7 days, by either moving this to the PAQ (Previously Asked Questions) at zero points, deleting it or awarding expert(s) when recommendations are made, or an independent determination can be made.  Expert input is always appreciated to determine the fair outcome.
Thank you everyone.
Moderator @ Experts Exchange

P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.

Featured Post

Industry Leaders: 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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

773 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