BUG: ClipCursor() Restricts Mouse Movement in Debugger (116182)



The information in this article applies to:

  • Microsoft CodeView for Windows 4.0
  • Microsoft CodeView for Windows 4.01
  • Microsoft CodeView for Windows 4.1
  • Microsoft Visual C++ 1.0
  • Microsoft Visual C++ 1.5

This article was previously published under Q116182

SYMPTOMS

Calling the ClipCursor() function restricts mouse movement in CodeView for Windows, the Visual C++ integrated debugger, and the application being debugged. The problem also occurs when you use CodeView for Windows in dual- monitor mode.

RESOLUTION

To work around the problem, enter commands using the keyboard when mouse movement is restricted.

STATUS

Microsoft has confirmed this to be a bug in CodeView for Windows and the Visual C++ debugger. We are researching this problem and will post new information in the Microsoft Knowledge Base as soon as it becomes available.

MORE INFORMATION

To reproduce this problem, use the following steps:
  1. Add the sample code shown below to the MainWndProc() function in the GENERIC sample found in the SAMPLES directory.
  2. Build the application in debug mode and set a breakpoint on the ClipCursor function.
  3. Press F5 to run "Generic". Size the Generic window to be a fraction of the total screen size.
  4. Choose "Help.About Generic".
  5. Click the "OK" button in the About dialog box to hit the breakpoint.
  6. Continue debugging using F8, F10, or F5.
The mouse is now restricted to the small area of the screen that you resized in step 3.

Sample Code

long CALLBACK __export MainWndProc(/* ... */)
   {
    RECT rect;                         /* add this line */ 

    switch (message)
    {
      case WM_COMMAND:
        if (wParam == IDM_ABOUT)
        {
         DialogBox(/* ... */);
         GetWindowRect(hWnd, &rect);    /* add this line */ 
         ClipCursor(&rect);             /* add this line */ 
         break;
        }
				

Modification Type:MajorLast Reviewed:12/1/2003
Keywords:kb16bitonly kbbug KB116182