[Lazarus] Sciter for Lazarus: VCL Handle vs. LCL Handle

Michael Van Canneyt michael at freepascal.org
Wed Jun 14 23:45:03 CEST 2023



On Wed, 14 Jun 2023, Marcos Douglas B. Santos wrote:

>>> On windows, the handle should work the same. If you're working on another
>>> platform, then it works very different, and then you'll need to see what sciter
>>> actually expects.
>>
>> I would like it to work on Windows, Linux and MacOS, but for now I
>> will be glad that it only works on Windows.
>
> Michael,
> Do you have any more ideas to try to solve this issue?

I think that first of all the result of API.SciterSetCallback (2 lines
before) needs to be checked. If this also gives an error, then we at least
know the window handle is totally not OK.

If that does not give an error, then I think it means the createparams are
not OK for the event handler.

It can be that the customcontrol window handle is created with different create
params than the one in Delphi. I don't know how to check this.

There is also 'HANDLE_ALL' which requests event handling for all kinds of
events, including DND

So I would also change HANDLE_ALL to something like

HANDLE_MOUSE OR HANDLE_KEY OR HANDLE_FOCUS

Because maybe the window handle is not created with the correct parameters
for HANDLE_ALL. I found some Go code that initializes OLE stuff for the
window, and I would be surprised if Lazarus does this by default; if
HANDLE_ALL also must handle OLE messages, then it can be it fails for those
messages.

Unfortunately, the sciter documentation is very unclear in terms of what is
expected of the window handle.

Michael.



More information about the lazarus mailing list