If you have installed the mouse initial value is 0. For example:In the dialog-based application to place two Button, names, respectively HideCursor and ShowCursor; then placed on a CStatic control, named Label1, used to display the cursor counter. The Source as follows:
Code:
/ / Make the cursor counter minus one, if less than zero, hide the cursor
void CMyTestDlg:: OnHideCursor ()
{
int i;
i = ShowCursor (FALSE);
Cstring string;
string.Format (_T ( "% d"), i);
Label123.SetWindowText (& string);
}
/ / Make the cursor counter value plus one, if greater than zero, display the cursor
void CMyTestDlg:: OnShowCursor ()
{
int j;
j = ShowCursor (TRUE);
Cstring string;
string.Format (_T ( "% d"), j);
Label123.SetWindowText (& string);
}
Run the program, a continuous click ShowCursor button, you will see the counter from 1 (the cursor is displayed with an initial value 0) and began to increase 1; HideCursor button and then click a row, will continue to see the counter by one, when the counter is -1 when the began to hide the cursor.
Bookmarks