Re: ICON Solutions!

new topic     » goto parent     » topic index » view thread      » older message » newer message

RE: Icons

With one program I am distributing, I used Icon Maker 1.0 to make the icons
and save them to a separate file (author is wotan500 at aol.com--don't know
where I got it from but it should be easy to find).

Then I put that icon file in my program directory (and distribute it with
the other parts of the program).

Then at run time I use the code appended below (borrowed and modified from
win32lib) to set both the small and large icons for the program to use that
icon file.

Then I distribute the program with an install program that allows you to
setup a shortcut to the program in the Start menu and/or on the
desktop.  You can specify the icon file to use for these icons and of
course I specify the same icon file I use at runtime.  (I use Inno Setup
1.11, which is freeware.  See http://www.jordanr.dhs.org/
-or- http://www.digicron.com/jordanr/. Downside is it adds maybe 400K to
the size of your compressed file.)

The end result is, I have a nice-looking icon in the upper-left corner of
my app., on the taskbar, and alt-tab-bar.  The same icon appears on the
desktop shortcut and in the start menu shortcut.  The only place it DOESN'T
appear is on the Windows Explorer listing when you look at the directory
containing the actual program.

So--this is somewhat roundabout, but in the end it does do about 98% of
what you expect the program's icon to do.  If you setup a program in the
start menu/desktop, 99.999% of users will rarely or never look at the
program with Windows Explorer anyway.

I will say that having that install program and customized icon really does
put the finishing touch on your program.  It makes it look like a real,
professional programming job instead of something some nitwit hacked
together in the middle of the night (and in my case, that's more than
likely exactly how it happened, but I do try to cover it up as much as
possible . . . ).

--Brent



---------------this code sets both Large & small icons to the same
file----------


global procedure setWinIcon ( atom winId, sequence filename)

         integer handle, ok,at

         at = allocate_string( filename )
         handle = c_func(xExtractIcon, {getHandle(winId), at, 0})
         ok = sendMessage(winId, WM_SETICON, 1, handle) --large icon
         ok = sendMessage(winId, WM_SETICON, 0, handle) --small icon
         -- free the string
         free(at)

end procedure
setWinIcon( EarTest, "EarTest.ico" )



++++++++++++++++++++ Brent Hugh / bhugh at cstp.umkc.edu ++++++++++++++++++++
+        University of Missouri-Kansas City, Conservatory of Music       +
+  Sheet Music/Recordings: http://www.sunflower.org/~bhugh/pathetic.spm  +
+ Internet Piano Concert:  http://cctr.umkc.edu/userx/bhugh/recital.html +
++++++++++ Classical Piano MP3s http://www.mp3.com/brent_d_hugh ++++++++++

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu