CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: SetWindowsHookEx stops receiving WH_MOUSE_LL notifications after focus lost

  1. #1
    Join Date
    Oct 2020
    Posts
    1

    SetWindowsHookEx stops receiving WH_MOUSE_LL notifications after focus lost

    Hi, I found this forum by stumbling onto the similar question here.
    The difference is, that in my case I have a SetWindowsHookEx in a simple c++ program, not a dll. The program creates an SDL2 window. But when that window loses focus, the SetWindowsHookEx stops receiving WH_MOUSE_LL messages.
    I tried to include the code snippet suggested by Igor Vartanov in the link above, but it did not help in my case.

    Any suggestion on how to make SetWindowsHookEx continue receiving WH_MOUSE_LL messages after focus of the SDL2 window is lost?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,400

    Re: SetWindowsHookEx stops receiving WH_MOUSE_LL notifications after focus lost

    Your hook doesn't stop working per se, it's just that Windows quits sending mouse messages to your window when it's lost focus.

    You have at least two options:
    1) keep your app in focus
    2) use a global hook

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)