Sign in Join

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

Mailing lists / lazarus / 2023-06

Sciter for Lazarus: VCL Handle vs. LCL Handle

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Marcos Douglas B. Santos

Hi,

I'm trying to run Sciter.TIS https://sciter.com/download/ on Lazarus, which could be an open source project in the future ? yes, not the newer version (named Sciter.JS) as I don't need these new features.

I've started looking into https://github.com/da-baranov/SciDe (~8 years ago). Then, I discovered a fork https://github.com/Mikanoshi/SciDe (~5 years old) and forked from it because it is "newer".

The da-baranov's original repository already tried to run on Lazarus, but they have an issue which couldn't be solved:
https://github.com/da-baranov/SciDe/issues/3#issuecomment-87698772

I have the same issue, even using the newer version... When it calls API.SciterWindowAttachEventHandler() here https://github.com/Mikanoshi/SciDe/blob/master/source/Sciter.pas#L1439-L1440, the result is always SCDOM_INVALID_HWND.

Why am I asking this here? Well, the project claims that it works from Delphi 7 to newer; they could compile on Lazarus; I also could compile (creating a package, a component, etc) on Lazarus; but it do not work because something looks like different about how a Handle works on VCL comparing to LCL.

Please, do you have any ideas?

Best regards,
Marcos Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230613/6f1ed8c1/attachment.htm>

Reply by email

Michael Van Canneyt
to Marcos Douglas B. Santos
Marcos Douglas B. Santos wrote 9 lines
Hi, I'm trying to run Sciter.TIS https://sciter.com/download/ on Lazarus, which could be an open source project in the future ? yes, not the newer version (named Sciter.JS) as I don't need these new features. I've started looking into https://github.com/da-baranov/SciDe (~8 years ago). Then, I discovered a fork https://github.com/Mikanoshi/SciDe (~5 years old) and forked from it because it is "newer". The?da-baranov's original repository already tried to run on Lazarus, but they have an issue which couldn't be solved: https://github.com/da-baranov/SciDe/issues/3#issuecomment-87698772

If you look at the issue, you see there is a commit that claims to solve this issue. Did you test if that commit is incorporated in your code ?

Show quoted text 8 lines
I have the same issue, even using the newer version... When it calls?API.SciterWindowAttachEventHandler() here https://github.com/Mikanoshi/SciDe/blob/master/source/Sciter.pas#L1439-L1440, the result is always?SCDOM_INVALID_HWND. Why am I asking this here? Well, the project claims that it works from Delphi 7 to newer; they could compile on Lazarus; I also could compile (creating a package, a component, etc) on Lazarus; but it do not work because something looks like different about how a Handle works on VCL comparing to LCL.

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.

Michael.

Reply by email

Marcos Douglas B. Santos
to Michael Van Canneyt
Show quoted text 15 lines
On Tue, 13 Jun 2023, Marcos Douglas B. Santos via lazarus wrote: > Hi, > I'm trying to run Sciter.TIS https://sciter.com/download/ on Lazarus, which could be an open source project in the future ? yes, > not the newer version (named Sciter.JS) as I don't need these new features. > > I've started looking into https://github.com/da-baranov/SciDe (~8 years ago). Then, I discovered a fork > https://github.com/Mikanoshi/SciDe (~5 years old) and forked from it because it is "newer". > > The da-baranov's original repository already tried to run on Lazarus, but they have an issue which couldn't be solved: > https://github.com/da-baranov/SciDe/issues/3#issuecomment-87698772 If you look at the issue, you see there is a commit that claims to solve this issue. Did you test if that commit is incorporated in your code ?

Yes, it is incorporated. First I checked it, but later forked the repository from the author of this commit (mr. Mikanoshi), which is newer...
But it didn't work.

Show quoted text 11 lines
> I have the same issue, even using the newer version... > When it calls API.SciterWindowAttachEventHandler() here > https://github.com/Mikanoshi/SciDe/blob/master/source/Sciter.pas#L1439-L1440, the result is always SCDOM_INVALID_HWND. > > Why am I asking this here? Well, the project claims that it works from Delphi 7 to newer; they could compile on Lazarus; I also > could compile (creating a package, a component, etc) on Lazarus; but it do not work because something looks like different about > how a Handle works on VCL comparing to LCL. 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.

Marcos Douglas

Reply by email

Marcos Douglas B. Santos
to Marcos Douglas B. Santos
Show quoted text 38 lines
On Wed, Jun 14, 2023 at 6:47?AM Michael Van Canneyt via lazarus wrote: > > On Tue, 13 Jun 2023, Marcos Douglas B. Santos via lazarus wrote: > > > Hi, > > I'm trying to run Sciter.TIS https://sciter.com/download/ on Lazarus, which could be an open source project in the future ? yes, > > not the newer version (named Sciter.JS) as I don't need these new features. > > > > I've started looking into https://github.com/da-baranov/SciDe (~8 years ago). Then, I discovered a fork > > https://github.com/Mikanoshi/SciDe (~5 years old) and forked from it because it is "newer". > > > > The da-baranov's original repository already tried to run on Lazarus, but they have an issue which couldn't be solved: > > https://github.com/da-baranov/SciDe/issues/3#issuecomment-87698772 > > If you look at the issue, you see there is a commit that claims to solve > this issue. Did you test if that commit is incorporated in your code ? Yes, it is incorporated. First I checked it, but later forked the repository from the author of this commit (mr. Mikanoshi), which is newer... But it didn't work. > > I have the same issue, even using the newer version... > > When it calls API.SciterWindowAttachEventHandler() here > > https://github.com/Mikanoshi/SciDe/blob/master/source/Sciter.pas#L1439-L1440, the result is always SCDOM_INVALID_HWND. > > > > Why am I asking this here? Well, the project claims that it works from Delphi 7 to newer; they could compile on Lazarus; I also > > could compile (creating a package, a component, etc) on Lazarus; but it do not work because something looks like different about > > how a Handle works on VCL comparing to LCL. > > 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?

Thanks,

best regards,
Marcos Douglas

Reply by email

Michael Van Canneyt
to Marcos Douglas B. Santos
Marcos Douglas B. Santos wrote 9 lines
>> 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.

Reply by email