If your program's callback function processes the WM_SYSCOMMAND message, here is an important Windows "quirk" to keep in mind.
Here's a typical block of DDT code, but exactly the same thing applies to API-based windows too...
The problem is that the last byte of the wParam value (CBWPARAM in DDT programs) is not always predictable when WM_SYSCOMMAND is detected. For example, if you click the Restore button on a dialog's title bar the wParam value will be %SC_RESTORE, or &HF120&. But if you double-click the dialog's title bar, %SC_RESTORE+2 (&HF122&) will be generated by Windows!.
So you always need to do some extra processing of a WM_SYSCOMMAND's wParam...
For more information about this, see WM_SYSCOMMAND in the Win32.HLP file.
-- Eric
-------------
Perfect Sync: Perfect Sync Development Tools
Email: mailto:[email protected][email protected]</A>
[This message has been edited by Eric Pearson (edited April 02, 2001).]
Here's a typical block of DDT code, but exactly the same thing applies to API-based windows too...
Code:
IF CBMSG = %WM_SYSCOMMAND THEN IF CBWPARAM = %SC_CLOSE THEN 'do something here END IF END IF
So you always need to do some extra processing of a WM_SYSCOMMAND's wParam...
Code:
IF CBMSG = %WMSYSCOMMAND THEN IF [b](CBWPARAM AND &hFFF0)[/b] = %SC_CLOSE THEN 'do something here END IF END IF
-- Eric
-------------
Perfect Sync: Perfect Sync Development Tools
Email: mailto:[email protected][email protected]</A>
[This message has been edited by Eric Pearson (edited April 02, 2001).]