mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 16:39:26 +02:00
use 0 icon handle for bsdialog forms
git-svn-id: trunk@6720 -
This commit is contained in:
parent
515156f208
commit
7bebf194eb
@ -450,12 +450,14 @@ Begin
|
||||
Begin
|
||||
Style := CS_DBLCLKS{CS_HRedraw or CS_VRedraw};
|
||||
LPFnWndProc := @WindowProc;
|
||||
CbClsExtra := 40;
|
||||
CbWndExtra := 40;
|
||||
HInstance := System.HInstance;
|
||||
HIcon := LoadIcon(0, IDI_Application);
|
||||
HCursor := LoadCursor(0, IDC_Arrow);
|
||||
HBrBackground := 0; {GetSysColorBrush(Color_BtnFace);}
|
||||
CbClsExtra := 0;
|
||||
CbWndExtra := 0;
|
||||
hInstance := System.HInstance;
|
||||
hIcon := Windows.LoadIcon(MainInstance, 'MAINICON');
|
||||
if hIcon = 0 then
|
||||
hIcon := Windows.LoadIcon(0, IDI_APPLICATION);
|
||||
hCursor := LoadCursor(0, IDC_ARROW);
|
||||
hbrBackground := 0; {GetSysColorBrush(Color_BtnFace);}
|
||||
LPSzMenuName := Nil;
|
||||
LPSzClassName := @ClsName;
|
||||
End;
|
||||
@ -717,6 +719,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.306 2005/01/31 17:09:17 micha
|
||||
use 0 icon handle for bsdialog forms
|
||||
|
||||
Revision 1.305 2005/01/15 10:09:23 micha
|
||||
fix bug 558: title bar redraw (win32)
|
||||
USE_SYNCHRONIZE enabled per default for 1.9.x
|
||||
|
@ -273,6 +273,7 @@ procedure TWin32WSCustomForm.SetBorderIcons(const AForm: TCustomForm;
|
||||
begin
|
||||
UpdateWindowStyle(AForm.Handle, CalcBorderIconsFlags(AForm),
|
||||
WS_SYSMENU or WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
|
||||
SetIcon(AForm, 0);
|
||||
end;
|
||||
|
||||
procedure TWin32WSCustomForm.SetBounds(const AWinControl: TWinControl;
|
||||
@ -299,8 +300,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TWin32WSCustomForm.SetIcon(const AForm: TCustomForm; const AIcon: HICON);
|
||||
var
|
||||
winHandle: HWND;
|
||||
iconHandle: HICON;
|
||||
begin
|
||||
SendMessage(AForm.Handle, WM_SETICON, ICON_BIG, Windows.LoadIcon(MainInstance, 'MAINICON'));
|
||||
winHandle := AForm.Handle;
|
||||
if AForm.BorderStyle = bsDialog then
|
||||
iconHandle := 0
|
||||
{ TODO: fix icon handling
|
||||
else
|
||||
if AIcon <> 0 then
|
||||
iconHandle := AIcon
|
||||
}
|
||||
else
|
||||
iconHandle := Windows.LoadIcon(MainInstance, 'MAINICON');
|
||||
SendMessage(AForm.Handle, WM_SETICON, ICON_BIG, iconHandle);
|
||||
end;
|
||||
|
||||
procedure TWin32WSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
||||
|
Loading…
Reference in New Issue
Block a user