[Lazarus] [lazarus] Patch for processing WM_COPYDATA in Win32 / BugID 9210

Vincent Snijders vsnijders at quicknet.nl
Mon Feb 18 13:34:08 CET 2008


Lukas Gradl schreef:
> Vincent Snijders schrieb:
>>
>> Let's keep the LCL win32 widgetset interface clean and just add things 
>> that are used by the LCL and keep custom extension outside it.
> 
> SetWindowLong is an option I've to check.
> 
> But IMHO this is not a real solution to the problem. The Pascal-way of 
> handling Messages is to define a custom messagehandler. This is how it 
> is done in countless applications.
> 
> In some later post in this thread you write "...we want the LCL to be 
> *VCL* compatible..." and in the VCL this is the way to go.

To a certain height. I should have added, as long as we can make it work cross 
widgetset, cross platform.

> 
> So I'm quite shure, that this should work in Lazarus accordingly.
> 
> So perhaps we should take a look at the LCL messagehandler in total to 
> stop it from eating up messages that are not necessary for the LCL.
> 

Maybe this patch works:
Index: win32/win32callback.inc
===================================================================
--- win32/win32callback.inc	(revision 14180)
+++ win32/win32callback.inc	(working copy)
@@ -2141,14 +2141,10 @@
          exit(TWin32WidgetSet(WidgetSet).FOnAsyncSocketMsg(WParam, LParam))
      end;
    else
-    // pass along user defined messages
-    if Msg >= WM_USER then
-    begin
-      LMessage.Msg := Msg;
-      LMessage.WParam := WParam;
-      LMessage.LParam := LParam;
-      WinProcess := False;
-    end;
+    // pass along all messages
+    LMessage.Msg := Msg;
+    LMessage.WParam := WParam;
+    LMessage.LParam := LParam;
    end;

    if WinProcess then


If this is accepted, we never have to worry about blocked messages, only about 
messages that may crash the LCL (because of an unexpected message), slower 
applications because some messages are sent to the LCL unnecessary and messages that 
are only sent on windows.

Vincent



More information about the Lazarus mailing list