Does DeferWindowPos work well with the VCL?
Asked Answered
W

1

1

I'm considering to increase my usage of DeferWindowPos. Up to now I used it in some simple circumstances and didn't notice any problems. Do you know of any pitfalls, where e.g. the FLeft/FTop/... fields aren't updated correctly or similar things?

Wein answered 18/1, 2010 at 20:33 Comment(0)
C
6

DeferWindowPos should't be a problem because the WM_WINDOWPOSCHANGED, WM_MOVE and WM_SIZE messages are still sent after the move/resize is finished. DeferWindowPos works as if the user moves or resized the window and the VCL keeps track of all the changes and updates FLeft, FTop, FWidth and FHeight properly.

Clamatorial answered 18/1, 2010 at 20:44 Comment(2)
Remember that each window being resized/moved has to share the same parent in order for DeferWindowPos to work. This is a Windows requirement, not something that VCL would require.Terti
+1. I never had any problem with that function. One obvious caveat is that the controls being moved must have window handles, so that rules out things like TLabel and TImage. That was never really a problem for me, though.Especially

© 2022 - 2024 — McMap. All rights reserved.