BUG: ClipCursor() Restricts Mouse Movement in Debugger

Last reviewed: July 22, 1997
Article ID: Q116182
4.00 4.01 4.10 1.00 1.50 1.50.01 WINDOWS kbtool kbcode kbbuglist

The information in this article applies to:

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

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;
        }


Additional reference words: 4.00 4.01 4.10 1.00 1.50 1.50.01
KBCategory: kbtool kbcode kbbuglist
KBSubcategory: CvwIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.