| |
| Trapping for when a user is done resizing a window |
 |
I want to trap when the user is finished sizing or moving my window. I trapped the WM_SIZE and the WM_MOVE messages, but I receive many of these messages, and seems impossible to tell when the user has completed the operation. How can I tell when the user is finished moving and sizing the window?
The following example demonstrates trapping the WM_EXITSIZEMOVE message to determine when the user has exited a Window sizing or moving event. Although the message is documented as available only under Windows NT, it does work equally as well under Windows 95. Note that you can also trap the WM_ENTERSIZEMOVE to determine when the user is initiating a window move or size operation.
Example:
type
TForm = class(TForm)
private
{ Private declarations }
public
procedure WMEXITSIZEMOVE(var Message: TMessage);
message WM_EXITSIZEMOVE;
{ Public declarations }
end;var
Form : TForm ; implementation {$R *.DFM}
procedure TForm .WMEXITSIZEMOVE(var Message: TMessage);
begin
Form .Caption := 'Finished Moving and sizing';
end;
|
|
| Hits/month |
2,500,000+ |
Downloads (Since May 2000) |
7,393,709 |
| Total Files |
6,023 |
| Forum msgs |
7,670 |
| Articles/FAQs |
70+/900+ |
Top Selling Software at Amazon
|