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. General Programming
  3. C / C++ / MFC
  4. CWaitCursor

CWaitCursor

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 Posters 0 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
    Steve Hopkins
    wrote on last edited by
    #1

    Hi, could anyone give me an answer to this. We have a long operation involving that we have wrapped with a CWaitCursor. However, during the processing, the cursor flickers back and forward to the pointer. Any ideas what we can do to keep the hourglass visible? Cheers, Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }

    L P 2 Replies Last reply
    0
    • S Steve Hopkins

      Hi, could anyone give me an answer to this. We have a long operation involving that we have wrapped with a CWaitCursor. However, during the processing, the cursor flickers back and forward to the pointer. Any ideas what we can do to keep the hourglass visible? Cheers, Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }

      L Offline
      L Offline
      lucy 0
      wrote on last edited by
      #2

      Whenever you window need redraw, the cursor is updated. If you want to stick to your CWaitCursor, you need to overwrite SetCursor().

      S 1 Reply Last reply
      0
      • L lucy 0

        Whenever you window need redraw, the cursor is updated. If you want to stick to your CWaitCursor, you need to overwrite SetCursor().

        S Offline
        S Offline
        Steve Hopkins
        wrote on last edited by
        #3

        Ahhhh, documentation. Maybe I should have read it in the first place. Thanx for your help. Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }

        RaviBeeR 1 Reply Last reply
        0
        • S Steve Hopkins

          Ahhhh, documentation. Maybe I should have read it in the first place. Thanx for your help. Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }

          RaviBeeR Offline
          RaviBeeR Offline
          RaviBee
          wrote on last edited by
          #4

          I think it's simpler to just do:

          AfxGetApp()->DoWaitCursor(1);
          doSomething();
          AfxGetApp()->DoWaitCursor(-1);

          /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

          1 Reply Last reply
          0
          • S Steve Hopkins

            Hi, could anyone give me an answer to this. We have a long operation involving that we have wrapped with a CWaitCursor. However, during the processing, the cursor flickers back and forward to the pointer. Any ideas what we can do to keep the hourglass visible? Cheers, Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }

            P Offline
            P Offline
            Philippe Mori
            wrote on last edited by
            #5

            If fact, temporary cursor are restored as soon as the mouse is moved (see SetCursor doc) and in pratice, it means that the cursor will be restored if windows messages are processed which may be the case if something with a message loop is called (COM apartment switching, message box,...). The only way to ensure that the wait cursor stay displayed is by calling something that will do a permanent change of the cursor (or also by processing WM_SETCURSOR) or by associating a NULL cursor with your window. In MSDN documentation, it is said that the cursor must be restored if an operation cause the cursor to be changed (see CWaitCursor::Restore). Philippe Mori

            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