Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-02

Patch for processing WM_COPYDATA in Win32 / BugID 9210

35 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Christian U.

I want to remember this Patch, its good and as i see the correct Way. Why it is not applied ?

best regards
Christian Ulrich

Show quoted text 40 lines
Some time ago I reported a problem with sending WM_COPYDATA-Messages under windows: http://bugs.freepascal.org/view.php?id=9210 As far as I could find the function WindowProc in win32callback.inc eats up the message so it never reaches the MessageHandler defined in the app. So I changed LCL\interfaces\win32\win32callback.inc This is the diff-File: Index: win32callback.inc =================================================================== --- win32callback.inc (revision 13779) +++ win32callback.inc (working copy) @@ -1141,6 +1141,13 @@ Assert(False, Format('Trace:WindowProc - Window Value: $%S-%d; Msg Value: %S; WParam: $%S; LParam: $%S', [IntToHex(Window, 4), Window, WM_To_String(Msg), IntToHex(WParam, sizeof(WParam)*4), IntToHex(LParam, sizeof(LParam)*4)])); case Msg of + WM_COPYDATA: // passthrough of WM_COPYDATA-Messages + begin + LMessage.Msg := Msg; + LMessage.WParam := WParam; + LMessage.LParam := LParam; + WinProcess := false; + end; WM_ACTIVATE: begin case LOWORD(WParam) Of regards Lukas

Reply by email

Christian U.
to Vincent Snijders
Show quoted text 8 lines
Christian U. schreef: > I want to remember this Patch, its good and as i see the correct Way. > Why it is not applied ? > What LCL components listen to WM_COPYDATA?

Why needs lcl components have to lissen to this ?
Its not possible to interface at example Winamp or Skype and a lot of other Win32 Applications becouse the lcl eats up this message.

Why the Win32 LCL message Handler can not transfer all Messages that he not process to the Application ? this is no overhead for the Message Handler.

best regards
Christian

Show quoted text 7 lines
Vincent _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Lukas Gradl
to Vincent Snijders: What LCL components listen to WM_COPYDATA? Vincent
Show quoted text 6 lines
Christian U. schreef: > I want to remember this Patch, its good and as i see the correct Way. > Why it is not applied ? What LCL components listen to WM_COPYDATA?

This patch was not for the LCL but for general Windows compatibility. At the moment the Windows part of the LCL eats up the WM_COPYDATA-Messages, so you can't interact with quite some application using this message to exchange control information with other apps.

With this patch WM_COPYDATA will get throug the LCL-Messagehandler untouched and can be handled in the application specific messagehandler.

regards
Lukas

---------------------------- software security networks Lukas Gradl <lazarus#ssn.at> Eduard-Bodem-Gasse 9 A - 6020 Innsbruck Tel: +43-720-300168-0 Fax: +43-512-341033-19 ----------------------------

Reply by email

Vincent Snijders
to Lukas Gradl
Lukas Gradl wrote 8 lines
Vincent Snijders schrieb: > Christian U. schreef: >> I want to remember this Patch, its good and as i see the correct Way. >> Why it is not applied ? > What LCL components listen to WM_COPYDATA? > This patch was not for the LCL but for general Windows compatibility.

Compatibility with windows?

At the moment the Windows part of the LCL eats up the WM_COPYDATA-Messages, so you can't interact with quite some application using this message to exchange control information with other apps.

If you want to use WM_COPYDATA messages on windows, you can add your own windows handler with windows.setwindowlong. No need to polute own LCL-message handler with it.

With this patch WM_COPYDATA will get throug the LCL-Messagehandler untouched and can be handled in the application specific messagehandler.

I don't think we should add this to our event handler. Let the application specific message handler handle it. Maybe it should be easier to add one, but OTOH, what is difficult about this? Windows.SetWindowLong(MyForm.Handle, GWL_WNDPROC,
PtrInt(SubClassWndProc));

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.

Vincent

Reply by email

Christian U.
to Vincent Snijders
If you want to use WM_COPYDATA messages on windows, you can add your own windows handler with windows.setwindowlong. No need to polute own LCL-message handler with it.

We want to be Delphi comaptible, right ???
And i dont know if this is real an pollution, i suggest to transfer all unknown Messages to the Application so we never have the problem and its no overhead for the lcl.

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.

Then please remove the WM_USER message support.
We cannot decide one time for something and next ime for another.

best reagrds
Christian

Show quoted text 7 lines
Vincent _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Felipe Monteiro de Carvalho
to Vincent Snijders: Compatibility with windows? If you want to use WM_COPYDATA messages on windows, you can…

In the past I thougth that using SetWindowLong was hard. It isn't. It will return the address of the current WndProc, so you can just have your WndProc like this:

begin
  if Msg = WM_COPYDATA then
 ...
  else CallOldWindowProc;
end;

And you don't lose anything. With a clever code you can even use the same wndproc for any control, just take care to call the correct old wndproc in each case.

Felipe Monteiro de Carvalho

Reply by email

Vincent Snijders
to Christian U.: We want to be Delphi comaptible, right ??? And i dont know if this is real an pollution,…
Christian U. wrote 5 lines
> If you want to use WM_COPYDATA messages on windows, you can add your own > windows handler with windows.setwindowlong. No need to polute own > LCL-message handler with it. > We want to be Delphi comaptible, right ???

No. To a certain height, we want the LCL to be *VCL* compatible. Currently LCL doesn't need handling of WM_COPYDATA, so no need to let the interface send it to the LCL.

And i dont know if this is real an pollution, i suggest to transfer all unknown Messages to the Application so we never have the problem and its no overhead for the lcl.

That would break the LCL, removing or not adding WM_COPYDATA would not. I do suggest to create component specific windowproc and move all relevant parts to that. But that is a different subject.

Show quoted text 6 lines
> 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. > Then please remove the WM_USER message support. We cannot decide one time for something and next ime for another.

That would be my favorite too.

Vincent

Reply by email

Lukas Gradl
to Vincent Snijders: Compatibility with windows? If you want to use WM_COPYDATA messages on windows, you can…
Show quoted text 32 lines
Lukas Gradl schreef: > Vincent Snijders schrieb: >> Christian U. schreef: >>> I want to remember this Patch, its good and as i see the correct Way. >>> Why it is not applied ? >> What LCL components listen to WM_COPYDATA? >> > This patch was not for the LCL but for general Windows compatibility. Compatibility with windows? > At the moment the Windows part of the LCL eats up the > WM_COPYDATA-Messages, so you can't interact with quite some application > using this message to exchange control information with other apps. > If you want to use WM_COPYDATA messages on windows, you can add your own windows handler with windows.setwindowlong. No need to polute own LCL-message handler with it. > With this patch WM_COPYDATA will get throug the LCL-Messagehandler > untouched and can be handled in the application specific messagehandler. > I don't think we should add this to our event handler. Let the application specific message handler handle it. Maybe it should be easier to add one, but OTOH, what is difficult about this? Windows.SetWindowLong(MyForm.Handle, GWL_WNDPROC, PtrInt(SubClassWndProc)); 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.

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.

I, for my part will keep my patch till there is a better solution - I'm not willing to change all the custom Message-Handlers I wrote in the last 15 years (or something like that - I use WM_COPYDATA quite a lot) if there is a simple way to avoid this.

regards
Lukas

---------------------------- software security networks Lukas Gradl <lazarus#ssn.at> Eduard-Bodem-Gasse 9 A - 6020 Innsbruck Tel: +43-720-300168-0 Fax: +43-512-341033-19 ----------------------------

Reply by email

Felipe Monteiro de Carvalho
to Mattias Gärtner
Mattias G?rtner wrote
Where is this documented?

On MSDN. Unless you are implying this should also be on the wiki, which is only true if it's really decided that WM_COPYDATA shouldn't be sent to the application, and the discussion doesn't seam to be over.

Felipe Monteiro de Carvalho

Reply by email

Mattias Gärtner
to Felipe Monteiro de Carvalho

Zitat von Felipe Monteiro de Carvalho :

Show quoted text 7 lines
On Feb 18, 2008 12:19 PM, Mattias G?rtner wrote: > Where is this documented? On MSDN. Unless you are implying this should also be on the wiki, which is only true if it's really decided that WM_COPYDATA shouldn't be sent to the application, and the discussion doesn't seam to be over.

As far as I am concerned the discussion is over: There is SetWindowLong to setup win32/64 specials messages. Where is this trick documented? I would expect it either under tipps/tricks and/or the win32 interface page.

Mattias

Reply by email

Vincent Snijders
to Lukas Gradl: SetWindowLong is an option I've to check. But IMHO this is not a real solution to the…
Lukas Gradl wrote 13 lines
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.

Show quoted text 6 lines
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

Reply by email

Christian U.
to Mattias Gärtner: Zitat von Felipe Monteiro de Carvalho : As far as I am concerned the discussion is over:…
Show quoted text 17 lines
Zitat von Felipe Monteiro de Carvalho : > On Feb 18, 2008 12:19 PM, Mattias G?rtner wrote: > >> Where is this documented? >> > On MSDN. Unless you are implying this should also be on the wiki, > which is only true if it's really decided that WM_COPYDATA shouldn't > be sent to the application, and the discussion doesn't seam to be > over. > As far as I am concerned the discussion is over: There is SetWindowLong to setup win32/64 specials messages. Where is this trick documented? I would expect it either under tipps/tricks and/or the win32 interface page.

Seems taht the core developers work against the users here. WM_COPYDATA is an thing that is used very often in Windows. For my opinion the best way is to pass this message also to the lcl. The overhad is minimal and only on windows there and the compatibiliy we win with this is big.

Who from you (The core developer) works realy on windows ? And who on "real world" Applications ?

best regards
Christian Ulrich

Reply by email

Christian U.
to Vincent Snijders: To a certain height. I should have added, as long as we can make it work cross widgetset,…
Show quoted text 59 lines
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.

Maybe an define is the best way to hide this. Who realy needs all messages can define

-dPassAllWin32MessagesToLCL

so everyone is happy....

best regards
Christian

Show quoted text 7 lines
Vincent _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Vincent Snijders
to Christian U.: Maybe an define is the best way to hide this. Who realy needs all messages can define…
Christian U. wrote 14 lines
> > 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. > Maybe an define is the best way to hide this. Who realy needs all messages can define -dPassAllWin32MessagesToLCL so everyone is happy....

I tried it and it didn't work. Too much tabs were created in the IDE, causing an out of index exception for the pages. But maybe it is ok for real world applications. ;-)

Vincent

Reply by email

Mattias Gaertner
to Christian U.: Seems taht the core developers work against the users here. WM_COPYDATA is an thing that…
Show quoted text 27 lines
Mattias G?rtner schrieb: > Zitat von Felipe Monteiro de Carvalho > : > > >> On Feb 18, 2008 12:19 PM, Mattias G?rtner >> wrote: >>> Where is this documented? >>> >> On MSDN. Unless you are implying this should also be on the wiki, >> which is only true if it's really decided that WM_COPYDATA >> shouldn't be sent to the application, and the discussion doesn't >> seam to be over. >> > > As far as I am concerned the discussion is over: There is > SetWindowLong to setup win32/64 specials messages. Where is this > trick documented? I would expect it either under tipps/tricks > and/or the win32 interface page. Seems taht the core developers work against the users here. WM_COPYDATA is an thing that is used very often in Windows. For my opinion the best way is to pass this message also to the lcl. The overhad is minimal and only on windows there and the compatibiliy we win with this is big. Who from you (The core developer) works realy on windows ? And who on "real world" Applications ?

If you implement WM_COPYDATA on qt and/or gtk to prove that it can be implemented platform independently, then it can be added to the LCL. Otherwise it is a win32 special and should be kept there (i.e. the win32 intf).

Mattias

Reply by email

Vincent Snijders
to Christian U.: Seems taht the core developers work against the users here. WM_COPYDATA is an thing that…
Christian U. wrote 9 lines
Seems taht the core developers work against the users here. WM_COPYDATA is an thing that is used very often in Windows. For my opinion the best way is to pass this message also to the lcl. The overhad is minimal and only on windows there and the compatibiliy we win with this is big. Who from you (The core developer) works realy on windows ? And who on "real world" Applications ?

I guess people working on real world applications use TSimpleIPC for interprocess communication, it is crossplatform and cross widgetset. I just inspected its implementation and not much to my surprise it uses WM_COPYDATA on windows.

So using TSimpleIPC instead of WM_COPYDATA has a minimal overhead, is not only on windows and the cross platform compatility we win is big.

Vincent

Reply by email

Christian U.
to Vincent Snijders: I tried it and it didn't work. Too much tabs were created in the IDE, causing an out of…
Show quoted text 21 lines
Christian U. schreef: >> 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. >> >> > Maybe an define is the best way to hide this. Who realy needs all > messages can define > > -dPassAllWin32MessagesToLCL > > so everyone is happy.... > > I tried it and it didn't work. Too much tabs were created in the IDE, causing an out of index exception for the pages. But maybe it is ok for real world applications. ;-)

*grml* ;)

So maybe we can just add the WM_COPYDATA patch ? Also possible in an define ?

best reagards
Christian

Show quoted text 7 lines
Vincent _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Christian U.
to Mattias Gaertner: On Mon, 18 Feb 2008 19:13:00 +0100 If you implement WM_COPYDATA on qt and/or gtk to prove…
Show quoted text 43 lines
On Mon, 18 Feb 2008 19:13:00 +0100 "Christian U." wrote: > Mattias G?rtner schrieb: > >> Zitat von Felipe Monteiro de Carvalho >> : >> >> >> >>> On Feb 18, 2008 12:19 PM, Mattias G?rtner >>> wrote: >>> >>>> Where is this documented? >>>> >>>> >>> On MSDN. Unless you are implying this should also be on the wiki, >>> which is only true if it's really decided that WM_COPYDATA >>> shouldn't be sent to the application, and the discussion doesn't >>> seam to be over. >>> >>> >> As far as I am concerned the discussion is over: There is >> SetWindowLong to setup win32/64 specials messages. Where is this >> trick documented? I would expect it either under tipps/tricks >> and/or the win32 interface page. >> > Seems taht the core developers work against the users here. > WM_COPYDATA is an thing that is used very often in Windows. > For my opinion the best way is to pass this message also to the lcl. > The overhad is minimal and only on windows there and the compatibiliy > we win with this is big. > > Who from you (The core developer) works realy on windows ? And who on > "real world" Applications ? > If you implement WM_COPYDATA on qt and/or gtk to prove that it can be implemented platform independently, then it can be added to the LCL. Otherwise it is a win32 special and should be kept there (i.e. the win32 intf).

I dont want it in the LCL, i want that only the WIN32 Interface posts this message to the Application.
An Cross Plattform Version of this makes no sense for me, we have bedder IPC Services in other OS.

Show quoted text 8 lines
Mattias _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Christian U.
to Vincent Snijders: I guess people working on real world applications use TSimpleIPC for interprocess…
Show quoted text 18 lines
Christian U. schreef: > Seems taht the core developers work against the users here. > WM_COPYDATA is an thing that is used very often in Windows. > For my opinion the best way is to pass this message also to the lcl. > The overhad is minimal and only on windows there and the compatibiliy we > win with this is big. > > Who from you (The core developer) works realy on windows ? And who on > "real world" Applications ? > > I guess people working on real world applications use TSimpleIPC for interprocess communication, it is crossplatform and cross widgetset. I just inspected its implementation and not much to my surprise it uses WM_COPYDATA on windows.

I use also the IPC Classes when i can but a lot of already exising Win32 Apps use WM_COPYDATA so i have no choice.

Show quoted text 10 lines
So using TSimpleIPC instead of WM_COPYDATA has a minimal overhead, is not only on windows and the cross platform compatility we win is big. Vincent _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Lukas Gradl
to Vincent Snijders: I guess people working on real world applications use TSimpleIPC for interprocess…
Show quoted text 15 lines
Christian U. schreef: > Seems taht the core developers work against the users here. > WM_COPYDATA is an thing that is used very often in Windows. > For my opinion the best way is to pass this message also to the lcl. > The overhad is minimal and only on windows there and the compatibiliy we > win with this is big. > > Who from you (The core developer) works realy on windows ? And who on > "real world" Applications ? > I guess people working on real world applications use TSimpleIPC for interprocess communication, it is crossplatform and cross widgetset. I just inspected its implementation and not much to my surprise it uses WM_COPYDATA on windows.

That's needs a definition of "real world applications". I have to interact with a bunch of applications outside the Lazarus world - so TSimpleIPC is not an option.

So using TSimpleIPC instead of WM_COPYDATA has a minimal overhead, is not only on windows and the cross platform compatility we win is big.

This is true for applications which are built from scratch using Lazarus /FPC and without interaction to software built outside of Lazarus.

I think there are quite some developers out there that have (like me) several millions lines of code they don't want to throw in the waste basket. For us compatibility is a real big issue.

I, for my part, need a solid tool to earn my living with, and I'm willing to improve this tool in the areas I'm working on. But my main focus has to be my business and the usability for my customers and not the tool itsself.

regards
Lukas

---------------------------- software security networks Lukas Gradl <lazarus#ssn.at> Eduard-Bodem-Gasse 9 A - 6020 Innsbruck Tel: +43-720-300168-0 Fax: +43-512-341033-19 ----------------------------

Reply by email

Felipe Monteiro de Carvalho
to Lukas Gradl

I think we should apply the WM_COPYDATA patch.

I don't think this small modification, specially if well commented and documented on the wiki would alone increase the difficulty of developing the win32 interface.

Lazarus exists exactly to be useful for people, and if this will make it more useful then it's a good thing. Of course we need to balance that with having a consistent and easy to maintain framework, but being a small patch which covers an important use case I'd go for it.

Similarly I'd be against sending any message to the application, because it's a change with multiple repercussions.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Mattias Gaertner
to Felipe Monteiro de Carvalho
Show quoted text 10 lines
I think we should apply the WM_COPYDATA patch. I don't think this small modification, specially if well commented and documented on the wiki would alone increase the difficulty of developing the win32 interface. Lazarus exists exactly to be useful for people, and if this will make it more useful then it's a good thing. Of course we need to balance that with having a consistent and easy to maintain framework, but being a small patch which covers an important use case I'd go for it.

Maybe it becomes an 'important use case' if it mentioned on http://wiki.lazarus.freepascal.org/Projects_using_Lazarus

;)

We should leave the final decision to the win32 devels. They have to maintain it the next years.

Similarly I'd be against sending any message to the application, because it's a change with multiple repercussions.

Mattias

Reply by email

Marc Weustink
to Felipe Monteiro de Carvalho: I think we should apply the WM_COPYDATA patch. I don't think this small modification,…
Felipe Monteiro de Carvalho wrote
I think we should apply the WM_COPYDATA patch.

I don't agree on that.

The messages received by the LCL are for VCL compatebility only. That they happen to have the same values as the messages the win32 widgetset uses is just a "coincidence"
Like we won't pass all events/signals/messages available for carbon/gtk/qt, we won't pass all for win32.
For the simple reason that messages are not cross platform.

I agree that we should think of a way that users can simply hook into the main message/event/signal loop it they want to write an app specific for one widgetset.
Adding all these messages/evets/signals to the LCL is not the way to do this.

Marc

Reply by email

Paul Ishenin
to Marc Weustink
Marc Weustink wrote 19 lines
Felipe Monteiro de Carvalho wrote: > I think we should apply the WM_COPYDATA patch. > I don't agree on that. The messages received by the LCL are for VCL compatebility only. That they happen to have the same values as the messages the win32 widgetset uses is just a "coincidence" Like we won't pass all events/signals/messages available for carbon/gtk/qt, we won't pass all for win32. For the simple reason that messages are not cross platform. I agree that we should think of a way that users can simply hook into the main message/event/signal loop it they want to write an app specific for one widgetset. Adding all these messages/evets/signals to the LCL is not the way to do this

Maybe Win32Widgetset.AllowMessage('WM_COPYDATA') ?

Best regards,
Paul Ishenin.

Reply by email

Giuliano Colla
to Paul Ishenin

Paul Ishenin ha scritto:

Show quoted text 26 lines
Marc Weustink wrote: > Felipe Monteiro de Carvalho wrote: > > >> I think we should apply the WM_COPYDATA patch. >> >> > I don't agree on that. > > The messages received by the LCL are for VCL compatebility only. That > they happen to have the same values as the messages the win32 widgetset > uses is just a "coincidence" > Like we won't pass all events/signals/messages available for > carbon/gtk/qt, we won't pass all for win32. > For the simple reason that messages are not cross platform. > > I agree that we should think of a way that users can simply hook into > the main message/event/signal loop it they want to write an app specific > for one widgetset. > Adding all these messages/evets/signals to the LCL is not the way to do > this > Maybe Win32Widgetset.AllowMessage('WM_COPYDATA') ?
or
{$ifdef PASS_WM_COPYDATA}
..Patch
{$Endif}

Then those who really need it (because of zillions of source code lines already written) will compile LCL with -dPASS_WM_COPYDATA. The others will never notice.

Giuliano

Reply by email

Christian U.
to Lukas Gradl: That's needs a definition of "real world applications". I have to interact with a bunch…
Show quoted text 12 lines
This is true for applications which are built from scratch using Lazarus /FPC and without interaction to software built outside of Lazarus. I think there are quite some developers out there that have (like me) several millions lines of code they don't want to throw in the waste basket. For us compatibility is a real big issue. I, for my part, need a solid tool to earn my living with, and I'm willing to improve this tool in the areas I'm working on. But my main focus has to be my business and the usability for my customers and not the tool itsself.

^Thats what i mean with "real World" Applications

regards Lukas

Reply by email

Christian U.
to Paul Ishenin: Maybe Win32Widgetset.AllowMessage('WM_COPYDATA') ? Paul Ishenin.
Maybe Win32Widgetset.AllowMessage('WM_COPYDATA') ?

I think this makes the Interface much more complex and for what ? Maybe this discussion happens for again 2-3 Messages. I dont think that it will be more.
The overhead of these 2-3 real importand messages that are passed to the LCL is minimal.
Also makes no sense to try to make some crossplatform stuff of them they have to exist only in win32.
Lazarus can,must and is not 100% cross plattform.

best regards
Christian

Reply by email

Lukas Gradl
to Marc Weustink: I don't agree on that. The messages received by the LCL are for VCL compatebility only.…
Show quoted text 17 lines
Felipe Monteiro de Carvalho wrote: > I think we should apply the WM_COPYDATA patch. I don't agree on that. The messages received by the LCL are for VCL compatebility only. That they happen to have the same values as the messages the win32 widgetset uses is just a "coincidence" Like we won't pass all events/signals/messages available for carbon/gtk/qt, we won't pass all for win32. For the simple reason that messages are not cross platform. I agree that we should think of a way that users can simply hook into the main message/event/signal loop it they want to write an app specific for one widgetset. Adding all these messages/evets/signals to the LCL is not the way to do this.

Speaking of that specific WM_COPYDATA patch we're talking about: That patch only influences the Win32-part of the LCL and not the carbon/gtk/qt-part.

What I don't understand is, why the LCL eats up messages at all - IMHO it should handle the messages it knows and leave all others untouched.

regards
Lukas

---------------------------- software security networks Lukas Gradl <lazarus#ssn.at> Eduard-Bodem-Gasse 9 A - 6020 Innsbruck Tel: +43-720-300168-0 Fax: +43-512-341033-19 ----------------------------

Reply by email

Christian U.
to Felipe Monteiro de Carvalho: In the past I thougth that using SetWindowLong was hard. It isn't. It will return the…

Please, can you provide an complete Example ?
Ill get silly exceptions every time when i try the stuff in C it works.

best reagrds
Christian

Show quoted text 15 lines
In the past I thougth that using SetWindowLong was hard. It isn't. It will return the address of the current WndProc, so you can just have your WndProc like this: begin if Msg = WM_COPYDATA then ... else CallOldWindowProc; end; And you don't lose anything. With a clever code you can even use the same wndproc for any control, just take care to call the correct old wndproc in each case.

Reply by email

Felipe Monteiro de Carvalho
to Christian U.
Christian U. wrote
Please, can you provide an complete Example ?

I don't have enougth free time for that. Maybe we could do the inverse? You create a complete example and posts here and we try to find out what you did wrong.

Felipe Monteiro de Carvalho

Reply by email

Christian U.
to Felipe Monteiro de Carvalho
Show quoted text 9 lines
On Feb 20, 2008 7:51 AM, Christian U. wrote: > Please, can you provide an complete Example ? > I don't have enougth free time for that. Maybe we could do the inverse? You create a complete example and posts here and we try to find out what you did wrong.

I havend declared the new windowproc as stdcall. Works now. I will see what i can do to make an usefiull example (i think it will be an winamp interface) that we can put to the lazarus examples.

best regards
Christian

Reply by email