Author: William Gerbert
Is it somehow possible to "check" in the WM_WindowPosChanging message if the window
is resized?
Answer:
In this message, Msg.WindowPos^.flags holds the flags which were originally used
with the SetWindowPos, etc. functions. The window will change its size if
SWP_NOSIZE is not contained in this flags, and either cx or cy are different,
compared to Width and Height values of the form:
1 2 procedure TForm1.WMWindowPosChanging(var Msg: TWMWindowPosChanging);
3 begin4 if (Msg.WindowPos^.flags and SWP_NOSIZE = 0) and ((Msg.WindowPos^.cx <> Width)
5 or (Msg.WindowPos^.cy <> Height)) then6 Windows.Beep(1000, 20); {sizing}7 end;