Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialog boxes

Status
Not open for further replies.

Berras

Programmer
Feb 24, 2002
42
GB
Is there anywhy of stoping the user move the cursor out of the a dialog box, and only allowed to keep itn inside the window??
 
override your dialog's onShowWindow(), add
CRect rcCursor;
GetWindowRect(rcCursor);
ClipCursor(&rcCursor);
 
I usually override OnMove instead(and, in case, onSize, using the same code) so, if you move the window (or resize it) nothing changes. Remember to release the cursor using ClipCursor(NULL), for example in your dialog's OnDestroy().

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top