window icon problem
- From: "Francis" <nws_without_this_@xxxxxxxxxx>
- Date: Mon, 29 May 2006 23:12:42 -0400
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?
.
- Prev by Date: Re: Sending "commands" over the network?
- Next by Date: Re: Error in DBWEBUtils.cs
- Previous by thread: Changing to caps - Dec(Key, 32) ?
- Next by thread: Re: Error in DBWEBUtils.cs
- Index(es):
Relevant Pages
|
|