diff --git a/lcl/interfaces/win32/win32object.inc b/lcl/interfaces/win32/win32object.inc index 053dfa58dd..af65a09b54 100644 --- a/lcl/interfaces/win32/win32object.inc +++ b/lcl/interfaces/win32/win32object.inc @@ -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 diff --git a/lcl/interfaces/win32/win32wsforms.pp b/lcl/interfaces/win32/win32wsforms.pp index ab48aca32f..bd28c85ddd 100644 --- a/lcl/interfaces/win32/win32wsforms.pp +++ b/lcl/interfaces/win32/win32wsforms.pp @@ -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);