ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

GlassPrompt 1.1

<< < (7/7)

MilesAhead:
Although it would have been a tad more useful if he showed adding your own icon as the application icon as that's the more common case then sticking it in a picture box.-MilesAhead (September 19, 2010, 01:32 PM)
--- End quote ---

Perhaps he followed the MSVS resource editors behavior a bit too closely, as I've always found it to be a bit of a PITA for much the same reason.
-Stoic Joker (September 19, 2010, 02:25 PM)
--- End quote ---

Heh. As soon as I wrote that it prompted me to look at his one liner for setting the dialog icon again.  I got it to work by using the same trick MS programmers do in the win32 template.  Copy hInstance given in WinMain to the global hInst.  Then just use MAKEINTRESOURCE macro for my custom icon id.  More elegant than the use of LoadImage as shown in the MSDN example.

Instead of his init dialog line
SetClassLongPtr(hDlg, GCLP_HICON, (long)LoadIcon(0, IDI_APPLICATION));

I just used
SetClassLongPtr(hDlg, GCLP_HICON, (long)LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON)));


bah... I hate making all the newb mistakes all over again though.  Not linking with MT switch and getting dll dependency booby trapped all over again!! :(

But at least it's a way of doing stand-alone exe with a gui editor that emits pretty small code for small utils. :)

MilesAhead:
Adding your application as the application icon? Simple - define it as the first icon in the resource file :) (or rather, the icon with the lowest identifier number; usually you use 100, but afaik anything goes, as long as it's the lowest). I think it's actually the shell (explorer.exe) that chooses to show the lowest icon number, rather than having anything to do with the resource editor or compiler.
-f0dder (September 19, 2010, 02:32 PM)
--- End quote ---

That works fine with standard win32 apps.  No joy in this probably because the win32 template where all the icon handles are set is not used.

f0dder:
Oh, you mean the "upper-left-corner" icon rather than what's shown in explorer? Yeah, that requires code.

MilesAhead:
In Windows Seven it shows up easily.  They must have improved the scrollbar draw when it's glass.
-MilesAhead (September 15, 2010, 04:37 PM)
--- End quote ---

Indeed they did! This was why it didn't work pre Win7.
-Eóin (September 19, 2010, 10:59 AM)
--- End quote ---

Interesting link. I'm not a habitual console drag dropper(I saw an article saying how great VistaSwitcher was so I hit Alt-Tab only to find I already had it installed... guess I don't Atl-Tab much) but I did notice a lot of griping about it when Vista first came on the scene.

MilesAhead:
Oh, you mean the "upper-left-corner" icon rather than what's shown in explorer? Yeah, that requires code.
-f0dder (September 19, 2010, 02:50 PM)
--- End quote ---

The way he did it was pretty neat though.  I can recall using LoadImage in Delphi similar to how MS suggests.  Delphi let you assign icons to custom controls, but if you made an ActiveX control out of them, you had to kludge it yourself to get the custom icon to display a design time icon when dropped on a form. But I'll say one thing for the Delphi 5 wizard created ActiveX. If it installed in the IDE it worked as expected.  Usually the biggest headache was getting the thing to stay in the toolbox. :)

Navigation

[0] Message Index

[*] Previous page

Go to full version