window icon problem



For a pet project, i'm creating windows myself, without using delphi forms.
Problem is, the small icon for my app appears with the name in the task bar,
but no icon appears in the top left corner of my window or when i alt-tab
next to my application.

Here's how i create my window, first register the class, then create the
window based on it:

-----------------------------------------------------------
procedure blah;
var
...
begin
instance:=system.maininstance;

with win_class do
begin
Style := 0;
lpfnWndProc := @default_window_proc;
cbClsExtra := 0;
cbWndExtra := 0;
hInstance := instance;
hIcon :=
0;//loadicon(instance,'MAINICON');//loadicon(0,idi_application);
hCursor := loadcursor(0,idc_arrow);
hbrBackground := 0;
lpszMenuName := nil;
lpszClassName := system.pchar(gdi_window_class_name);
end;

atom:=registerclass(win_class);
..........
..........
p:=system.pchar(name);
window_style:=ws_overlapped or ws_sysmenu or ws_minimizebox or ws_sizebox
or ws_maximizebox or ws_caption;
handle := createwindow(system.pchar(atom),p,
window_style,
-1,-1,-1,-1,
0,0,instance,nil);
end;
-----------------------------------------------------------

I also have a resource file that is compiled into the app, it contains 2
icons, one 16x16x16colors, and one 32x32x16colors. The 16x16 is displayed by
the window name in the taskbar correctly, but nothing in the top left of the
window.

As you can see in the bit of code for registering, i tried changing the
loadicon command, but the first two give the same incomplete result and the
third does not display any icon on either the taskbar or window.

Soooo... any ideas how i can get my icon on my window?


.



Relevant Pages

  • Re: Tray Icons and custom shell
    ... messages to SysTray to forwarding WM_COMMAND event to some other parts or windows of the same app). ... PostMessage to send the appropriate command to the tray icon window. ... I've a custom shell and therefore no system tray. ...
    (microsoft.public.windowsxp.embedded)
  • Re: God I hate Spotlight
    ... He said there was a triangle under the icon in the dock (and ... then the window appeared (that reminds me to install the ... icon in the dock and how to open a new 'window' if the app is still ...
    (uk.comp.sys.mac)
  • RE: APPCRASH - Microsoft Office Word has stopped working
    ... Disabling HP related files from the Startup: ... 1.Click Start Icon. ... On the User Account Control window, ... When I use Mailmerge - Envelopes, after printing the envelope and close Word ...
    (microsoft.public.word.mailmerge.fields)
  • RE: word 2007 app crash
    ... I just did the "quick fix" by changing my default printer to Microsoft ... If you does not have any other printer icon in Printers and Faxes folder, ... On the User Account Control window, ... Click Restart to apply the changes. ...
    (microsoft.public.word.application.errors)
  • Closed thread- Anyone seen this before?
    ... So it was technically on the desktop, which is why it showed up as an app ... I make it go away by closing the window - I get a little window that just ... 'Address' a text entry box and a little IE style 'Go' icon. ... Killing it in Task Manager kills explorer, which at least on my machine then ...
    (Incidents)