WH_MOUSE_LL Abilities

Is there a way I can use the LL mouse hook to capture other information besides which button was clicked For example, these are the events I'm wanting to watch for:

Window State Change (Minimize, Restore, etc.)

Which window control was clicked (Minbutton, Maxbutton, etc.)

System Menu opened

I know I can use the LL hook to find out which button was clicked and where the mouse is and such, but I'm having some trouble with the above information. Any help on this is very appreciated.

--W



Answer this question

WH_MOUSE_LL Abilities

  • R. Child

    Not directly, but you can certainly take the coordinates you get and use them in calls to the windowing APIs to figure out what's under the mouse cursor.

    Just keep in mind that you can open menus and change window state without using the mouse, so don't rely on this as the only way to detect such actions.



  • Daniel P

    form.windowstate maybe :)

    http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.addmessagefilter(VS.80).aspx

    u can try this to get the original application loop messages ... search your msdn lib to get the values (should all start with WM_)


  • Gulden

    basically I'm trying to write my own app to minimize other windows to the system tray. I'm using VC# Express and it appears I cannot hook CBT globally with .Net and since the VC++ Express version doesn't fully support creating a DLL or at least the MFC libraries anyway, I am having difficulty finding some way to globally hook CBT.

    Any Suggestions


  • Hmmm.... Threads......

    I'm sorry I forgot to mention this. I'm using the WH_MOUSE_LL hook for a global hook. I want to know what was clicked on the non-client areas of windows other than my application.

    I know I can use the CBT hooks but I'm wanting to try to do this on a global hook so I have to use the LL hook to catch it for other apps.


  • WH_MOUSE_LL Abilities