creating an icon

Posted on 2001-06-22
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.

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center


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 75 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.

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

808 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