News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

icons for commandline programs

Started by white scorpion, March 16, 2005, 08:03:02 PM

Previous topic - Next topic

white scorpion

Hi all,

i was wondering, how can i use my icon in a program written for the commandline? I know it is possible since microsoft is doing it as well, but i haven't got a clue how to do it. if you donwload the debugger tools from microsoft you will see a couple of examples.

Thanks in advance,

Kind regards,


White Scorpion

pbrennick

Hi White Scorpion,
Remember that there is a difference between commandline tools and console apps.  Are you sure they are not Console Apps?  They look exactly the same but are 32bit and build with Resources making it very easy to add an icon.  Just place it in the resource file, you do not even need to refer to it in the code.

Paul

pbrennick

White Scorpion,
If it must be a 16bit solution, I will move the topic to the appropriate subforum.  If this is the case, though, just build the program and then right click the program file and click properties.  You can add the icon there.  Please do not cross post, tell me what you want and I will deal with it.

Paul

James Ladd

I think there is a resource you can add to the program and it give version info, vender, icon and other info.
Ill look in my snippets of info for it tonight.

pbrennick

#4
Definitely, if it is 32 bit.  I am sure that most already do that.  Here is the example I use in my Calculator program:


1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x0L
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "A Freeware Application\0"
            VALUE "CompanyName", "GeneSys Technologies\0"
            VALUE "Contact e-mail", "pbrennick@verizon.net\0"
            VALUE "FileDescription", "Scientific Calculator\0"
            VALUE "FileVersion", "1.0.0.0\0"
            VALUE "LegalCopyright", "P. Gene Brennick 2001, 2002, 2003, 2004, 2005\0"
            VALUE "Mailing Address", "6 Colonial Drive, Apt. I, Millbury, MA  01527\0"
            VALUE "Original FileName", "EasyCalc.exe\0"
            VALUE "ProductVersion", "1, 0, 0, 0\0"
            VALUE "Purpose", "A Tool for Students/Programmers\0"
            VALUE "Website", "http://www.pbrennick.com\0"
        END
    END
END



All keys are viewable by rightclicking the executable and then clicking on the Version Tab.  also "040904b0" means this is an English (US) Language Resource, you will need to get the proper one for your own language.

Paul

white scorpion

sorry guys, i mean console programs... 32-bit commandline utilities.


Paul, thats exactly what i'm looking for, you just create a .rc file without even having to mention it in the code? never knew that was possible. i will try it tonight when i'm back from work. thanks for your responses!!!


pbrennick

White Scorpion,
That is exactly the case.  On another interesting note, download my Calculator and view the About Box.  You will see that it displays a bitmap version of my avatar.  That bitmap is not mentioned anywhere in the code but shows quite nicely.  You never know what you can do until you try!

Paul

white scorpion

Thanks Paul, that was exactly what i needed. never realized it could be so simple ;)