Sign in Join

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

Mailing lists / lazarus / 2015-10

WMEnterSizeMove Messages not firing

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Aradeonas

Hi,

Just tested this code and only WMMove works and?WMEnterSizeMove doesn't. It simply works in Delphi. Why?

Show quoted text 38 lines
unit Unit1; {$mode objfpc}{$H+} interface uses? Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Messages; type { TForm1 } TForm1 = class(TForm)? private? public? ? procedure WMEnterSizeMove(var Message: TMessage); message WM_ENTERSIZEMOVE; procedure WMMove(var Message: TMessage); message WM_MOVE;? ? procedure WMExitSizeMove(var Message: TMessage); message WM_EXITSIZEMOVE;? end; var? Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.WMEnterSizeMove(var Message: TMessage); begin Caption := 'Move / resize started'; end; (*WMEnterSizeMove*) procedure TForm1.WMMove(var Message: TMessage); begin? Caption := Format('Form is being moved. Client area x: %d, y:%d', [TWMMove(Message).XPos, TWMMove(Message).YPos]); end; (*WMMove*) procedure TForm1.WMExitSizeMove(var Message: TMessage); begin ShowMessage('Move / resize complete!'); end; (*WMExitSizeMove*) end.

Regards, Ara

http://www.fastmail.com - Accessible with your email software or over the web -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151008/09976b42/attachment.html>

Reply by email

Ondrej Pokorny
to Aradeonas
Aradeonas wrote
Is there any other way to make it work for now?

It depends on what you want to do in WM_ENTERSIZEMOVE. For most uses you can use a workaround with MouseDown etc.

If you really need WM_ENTERSIZEMOVE, it should be possible to make win32 widgetset to pass it through but I didn't investigate further and used a MouseDown workaround.

Ondrej

Reply by email

Aradeonas
to Aradeonas

Now I get a kind message from Sz?kely Bal?zs that show a temporary way.

Show quoted text 21 lines
Hi Ara, I saw your conversation with Ondrej about catching the WMEnterSizeMove and WMExitSizeMove message. I did respond on the mailing list, unfortunately my mails still get filtered out(this was also confirmed by Juha). Anyway here is a possible solution. Feel free to post in the mailing list if you like: uses windows; var? PrevWndProc: WNDPROC; function WndCallback(AHWND: HWND; uMsg: UINT; wParam: WParam; lParam: LParam): LRESULT; stdcall; begin? case uMsg of??? WM_ENTERSIZEMOVE: begin????? //...????? Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, LParam);??? end;??? WM_EXITSIZEMOVE:??? begin????? //... Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, LParam); end;??? else????? Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, LParam);? end; end; procedure TForm1.FormCreate(Sender: TObject); begin? PrevWndProc := Windows.WNDPROC(SetWindowLongPtr(Self.Handle, GWL_WNDPROC, PtrInt(@WndCallback))); end; regards, Bal?zs

Regards, Ara

http://www.fastmail.com - Access your email from home and the web -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151010/04c5caf9/attachment.html>

Reply by email

Ondrej Pokorny
to Ondrej Pokorny: Great! Thanks Bal?zs for the code and also thanks for sharing! I added the workaround to…
Ondrej Pokorny wrote 7 lines
On 10.10.2015 15:36, Aradeonas wrote: > Now I get a kind message from Sz?kely Bal?zs that show a temporary way. > Great! Thanks Bal?zs for the code and also thanks for sharing! I added the workaround to the bug report: http://bugs.freepascal.org/view.php?id=23302

Juha, just to keep the discussion about unhandled messages in Windows:

From http://bugs.freepascal.org/view.php?id=23302#c86677 :

/> But even if they do not exist everywhere IMO they could be passed through to LCL at least from widgetsets where they are supported (?).// //No, that goes against the fundamental idea of a cross-platform library.// /
It's a matter of discussion. The message handling is low-level. So there can be differences between widgetsets. It's important to have as little differences in the high-level (events, virtual methods etc.). But small differences even in those exist, unfortunately.

It is extremely useful to be able to access the low-level messages without workarounds even with the limitation that they are available only on some widgetsets (maybe only one).

Zeljko stated in the "How to create a non focusable form?" thread http://lists.lazarus.freepascal.org/pipermail/lazarus/2015-October/095047.html that WMNCHitTest is Windows-only. And it is indeed passed to LCL. So LCL is not very systematic about this 't it be easier to pass all messages to the LCL? Furthermore, compatibility to Delphi would be achieved - only on Windows, though, but still better than nothing.

Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20151027/2863f976/attachment.html>

Reply by email

Juha Manninen
to Ondrej Pokorny
Ondrej Pokorny wrote 15 lines
It's a matter of discussion. The message handling is low-level. So there can be differences between widgetsets. It's important to have as little differences in the high-level (events, virtual methods etc.). But small differences even in those exist, unfortunately. It is extremely useful to be able to access the low-level messages without workarounds even with the limitation that they are available only on some widgetsets (maybe only one). Zeljko stated in the "How to create a non focusable form?" thread http://lists.lazarus.freepascal.org/pipermail/lazarus/2015-October/095047.html that WMNCHitTest is Windows-only. And it is indeed passed to LCL. So LCL is not very systematic about this 't it be easier to pass all messages to the LCL? Furthermore, compatibility to Delphi would be achieved - only on Windows, though, but still better than nothing.

True. Maybe the important question is "how badly it breaks the application in other widgetsets?"
The functionality based on WMEnterSizeMove message is then missing in other system.
Maybe it does not matter, the app is usable but some fancy resize feature is missing.
I am not against adding it. I know there are widgetsets differences already including non-supported properties.

Juha

Reply by email