Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. Clipping cursor still active after stopping debugger

Clipping cursor still active after stopping debugger

Scheduled Pinned Locked Moved Clever Code
visual-studiodebuggingcsharpphpcom
3 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sarath C
    wrote on last edited by
    #1

    I have written code in Visual Studio 2005 to show list box as a pop-up window. On Clicking the main window, I show/hide the window accordingly. Yea the program working as I expected without having any problems. When I had some issues, i decided to debug the program. On showing the Listbox( cursor will be clipped ), I stopped debugging using Shift+F5. The thing is, the Cursor Clipping was still there. After closing some opened windows from Visual Studio IDE and Switching to other windows resolved issue. but it was hectic for minute. I’m sure the process was not at all active. because it’s a very small application which exit on Shift+F5 press

    // Code to clip the cursor on showing/hdie the window
    void CListBoxEx::OnShowWindow(BOOL bShow, UINT nStatus)
    {
    CListBox::OnShowWindow(bShow, nStatus);

    if( SW\_SHOWNORMAL == bShow ) // Clip the cursor if window showing
    {
        CRect rect;
        GetWindowRect(rect);
        ClipCursor( rect );
    }
    else if( SW\_HIDE == bShow ) // remove clipping on hiding
    {
        ClipCursor(NULL);
    }
    

    }

    -Sarath_._ "Great hopes make everything great possible" - Benjamin Franklin

    My blog - Sharing My Thoughts, An Article - Understanding Statepattern

    S M 2 Replies Last reply
    0
    • S Sarath C

      I have written code in Visual Studio 2005 to show list box as a pop-up window. On Clicking the main window, I show/hide the window accordingly. Yea the program working as I expected without having any problems. When I had some issues, i decided to debug the program. On showing the Listbox( cursor will be clipped ), I stopped debugging using Shift+F5. The thing is, the Cursor Clipping was still there. After closing some opened windows from Visual Studio IDE and Switching to other windows resolved issue. but it was hectic for minute. I’m sure the process was not at all active. because it’s a very small application which exit on Shift+F5 press

      // Code to clip the cursor on showing/hdie the window
      void CListBoxEx::OnShowWindow(BOOL bShow, UINT nStatus)
      {
      CListBox::OnShowWindow(bShow, nStatus);

      if( SW\_SHOWNORMAL == bShow ) // Clip the cursor if window showing
      {
          CRect rect;
          GetWindowRect(rect);
          ClipCursor( rect );
      }
      else if( SW\_HIDE == bShow ) // remove clipping on hiding
      {
          ClipCursor(NULL);
      }
      

      }

      -Sarath_._ "Great hopes make everything great possible" - Benjamin Franklin

      My blog - Sharing My Thoughts, An Article - Understanding Statepattern

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      AFAIK, Cursor clipping is handled by the OS/Window Manager/whatever. Not the app; the app just tells the OS what the clipping should be for a given desktop. So yeah, if your program fails to remove clipping for whatever reason, it sticks around. BTW - how is this a subtle bug?

      every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- Chris Losinger, Online Poker Players?

      1 Reply Last reply
      0
      • S Sarath C

        I have written code in Visual Studio 2005 to show list box as a pop-up window. On Clicking the main window, I show/hide the window accordingly. Yea the program working as I expected without having any problems. When I had some issues, i decided to debug the program. On showing the Listbox( cursor will be clipped ), I stopped debugging using Shift+F5. The thing is, the Cursor Clipping was still there. After closing some opened windows from Visual Studio IDE and Switching to other windows resolved issue. but it was hectic for minute. I’m sure the process was not at all active. because it’s a very small application which exit on Shift+F5 press

        // Code to clip the cursor on showing/hdie the window
        void CListBoxEx::OnShowWindow(BOOL bShow, UINT nStatus)
        {
        CListBox::OnShowWindow(bShow, nStatus);

        if( SW\_SHOWNORMAL == bShow ) // Clip the cursor if window showing
        {
            CRect rect;
            GetWindowRect(rect);
            ClipCursor( rect );
        }
        else if( SW\_HIDE == bShow ) // remove clipping on hiding
        {
            ClipCursor(NULL);
        }
        

        }

        -Sarath_._ "Great hopes make everything great possible" - Benjamin Franklin

        My blog - Sharing My Thoughts, An Article - Understanding Statepattern

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        From the documentation for ClipCursor... "The cursor is a shared resource. If an application confines the cursor, it must release the cursor by using ClipCursor before relinquishing control to another application"

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups