Not on a window to hide the mouse (ShowCursor).
O way!
CodePudding user response:
Cutting & amp; Hidden
Void CdlgTDlg: : OnBnClickedButton1 ()
{
//TODO: add the control notification handler code
//get the client area location
CRect rc;
GetClientRect (& amp; Rc);
//coordinates to screen coordinates
ClientToScreen (& amp; Rc);
//limit the cursor area
ClipCursor (& amp; Rc);
//hide the cursor
ShowCursor (FALSE);
//start the timer (5 seconds after the cursor)
The SetTimer (10, 5000, NULL);
}
Void CdlgTDlg: : OnTimer (UINT_PTR nIDEvent)
{
If (nIDEvent==10)
{
//cancel the cursor clipping
ClipCursor (NULL);
//display the cursor
ShowCursor (TRUE);
//off timer
KillTimer (nIDEvent);
}
CDialog: : OnTimer (nIDEvent);
}