[lazarus] Patch win32: window owner, taskbar grouping

Micha Nelissen M.Nelissen at student.tue.nl
Sat Aug 30 11:58:37 EDT 2003


Hi,

Attached is a patch which makes windows stick together if one form own 
another. In the case of lazarus, when you click lazarus on taskbar, both 
the object inspector and the source editor appear. Otherwise the object 
inspector is lost, because it does not have a button on the taskbar.

Regards,

Micha.


Index: win32object.inc
===================================================================
RCS file: /FPC/CVS/projects/lazarus/lcl/interfaces/win32/win32object.inc,v
retrieving revision 1.101
diff -u -w -r1.101 win32object.inc
--- win32object.inc	28 Aug 2003 09:10:01 -0000	1.101
+++ win32object.inc	30 Aug 2003 15:55:16 -0000
@@ -2010,6 +2010,9 @@
       bsSizeToolWin:
         FlagsEx:=WS_EX_TOOLWINDOW;
       End;//case
+      if (Parent = HWND(nil)) and (TCustomForm(Sender).Owner is TCustomForm) then
+        Parent := TCustomForm(TCustomForm(Sender).Owner).Handle;
+
       If TCustomForm(Sender).FormStyle = fsStayOnTop Then
         FlagsEx:= FlagsEx or WS_EX_TOPMOST;
       try
@@ -2018,8 +2021,10 @@
         writeln('Exception occured creating window');
       end;
       If (FMainForm = Nil) And (Application.MainForm = Nil) Then
+      begin
         FMainForm := TForm(Sender);
       FParentWindow := Window;
+      end;
       Assert(False, 'Trace:CreateComponent - Form Window Handle Value = $' + IntToHex(Window, 8));
       Assert(False, 'Trace:Creating a Form - SetProp');
       DoSubClass := false;





More information about the Lazarus mailing list