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. Mouse Hook Problem on virtual desktop

Mouse Hook Problem on virtual desktop

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 2 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
    sharda bhagwatkar
    wrote on last edited by
    #1

    Hi, I have installed global mouse hooks in my application using following call g_MouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseProc , hInstance, 0); The mouse procedure is as follows extern "C" _declspec(dllexport) LRESULT CALLBACK MouseProc (int nCode, WPARAM wParam, LPARAM lParam) The MouseProc is calling successfully when current active desktop is "default". When i switch the desktop to some other desktop, the MouseProc is not calling. Can anyone tell me reason for this and also solution. sharda

    I 1 Reply Last reply
    0
    • S sharda bhagwatkar

      Hi, I have installed global mouse hooks in my application using following call g_MouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseProc , hInstance, 0); The mouse procedure is as follows extern "C" _declspec(dllexport) LRESULT CALLBACK MouseProc (int nCode, WPARAM wParam, LPARAM lParam) The MouseProc is calling successfully when current active desktop is "default". When i switch the desktop to some other desktop, the MouseProc is not calling. Can anyone tell me reason for this and also solution. sharda

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      From the documentation for SetWindowsHookEx:

      dwThreadId
      [in] Specifies the identifier of the thread with which the hook procedure is to be associated. If this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread.

      This doesn't actually cure your problem, but hopefully it reassures you that you haven't made a daft mistake. Iain.

      S 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        From the documentation for SetWindowsHookEx:

        dwThreadId
        [in] Specifies the identifier of the thread with which the hook procedure is to be associated. If this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread.

        This doesn't actually cure your problem, but hopefully it reassures you that you haven't made a daft mistake. Iain.

        S Offline
        S Offline
        sharda bhagwatkar
        wrote on last edited by
        #3

        thanks Iain, Actually i tried with both the options like g_MouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseProc , NULL,0); and g_MouseHook = SetWindowsHookEx(WH_MOUSE, MouseProc , NULL,GetCurrentThreadID()); Still in both the cases MouseProc is not called.

        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