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. Get current cursor type

Get current cursor type

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
5 Posts 3 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.
  • K Offline
    K Offline
    khb
    wrote on last edited by
    #1

    Hi together, is it somehow possible to get the current type of the mouse cursor? I'd like to check whether the current cursor is the context help cursor (IDC_HELP) or not. However, I have no idea how to accomplish that :( Thank you very much for your help, Marcus.

    R 1 Reply Last reply
    0
    • K khb

      Hi together, is it somehow possible to get the current type of the mouse cursor? I'd like to check whether the current cursor is the context help cursor (IDC_HELP) or not. However, I have no idea how to accomplish that :( Thank you very much for your help, Marcus.

      R Offline
      R Offline
      Ryan Binns
      wrote on last edited by
      #2

      GetCursor() or GetCursorInfo()

      Ryan

      "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

      K 1 Reply Last reply
      0
      • R Ryan Binns

        GetCursor() or GetCursorInfo()

        Ryan

        "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

        K Offline
        K Offline
        khb
        wrote on last edited by
        #3

        Hi Ryan, thank you very much for your hint. I got it working! However, for me it wasn't that straightforward to get it run. If anybody is interested in the solution, here it is:

        // Load a cursor of the type that should be checked.
        // The clue: The handle to the cursor is unique, so we can use it for comparison.
        HCURSOR hHelpCursor = LoadCursor(NULL, IDC_HELP);

        // Use GetCursorInfo() to get information about the current (global) cursor.
        CURSORINFO ci;
        ci.cbSize = sizeof(ci);
        if(GetCursorInfo(&ci))
        {
        if(ci.hCursor == hHelpCursor)
        cout << "Context help cursor active!" << endl;
        }

        Any hints for improvement are welcome! Thanks again, Marcus.

        R 1 Reply Last reply
        0
        • K khb

          Hi Ryan, thank you very much for your hint. I got it working! However, for me it wasn't that straightforward to get it run. If anybody is interested in the solution, here it is:

          // Load a cursor of the type that should be checked.
          // The clue: The handle to the cursor is unique, so we can use it for comparison.
          HCURSOR hHelpCursor = LoadCursor(NULL, IDC_HELP);

          // Use GetCursorInfo() to get information about the current (global) cursor.
          CURSORINFO ci;
          ci.cbSize = sizeof(ci);
          if(GetCursorInfo(&ci))
          {
          if(ci.hCursor == hHelpCursor)
          cout << "Context help cursor active!" << endl;
          }

          Any hints for improvement are welcome! Thanks again, Marcus.

          R Offline
          R Offline
          Ryan Binns
          wrote on last edited by
          #4

          khb wrote:

          Any hints for improvement are welcome!

          It's exactly what I'd do :)

          Ryan

          "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

          B 1 Reply Last reply
          0
          • R Ryan Binns

            khb wrote:

            Any hints for improvement are welcome!

            It's exactly what I'd do :)

            Ryan

            "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

            B Offline
            B Offline
            balaji167
            wrote on last edited by
            #5

            How to check the CListCtrl's column resize cursor. I don't know that resource id.

            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