I'm having troubles to port an old program of mine (based on this code) to Windows 10 (coming from Win7)
When I start nlh.exe as a non-elevated process, only non-elevated programs seems to react to the hook. Starting nlh.exe with admin-rights only works on elevated, but not on non-elevated programs. I've already tried uiAccess=true inside the manifest, test-signed my program (Jimmy Brush's reply) and installed the .cert on Win10, but I still get the "A referral was returned from the server."-Message. Is there anything else I have to do, to make it work on Win10? Is uiAccess=true the only way?
All suggestions are welcome Thx
edit1: Seems like I made a mistake installing the certificate... uiAccess=true works now without the error message, but I still don't get a signal from non-elevated and elevated programs at the same time
(Solved) Mousehook troubles (Win10)
(Solved) Mousehook troubles (Win10)
Last edited by chi on Tue Sep 24, 2019 1:48 pm, edited 1 time in total.
Et cetera is my worst enemy
Re: Mousehook troubles (Win10)
The mouse hook procedure should be outsourced in a DLL. Is that the case with you?
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Re: Mousehook troubles (Win10)
Yes, the dll is separate, of course (code).Sicro wrote:The mouse hook procedure should be outsourced in a DLL. Is that the case with you?
The mousehook currently works on Win7 without UAC for both non-elevated and elevated programs simultaneously. With UAC on, I need to launch the exe with admin rights to catch all elevated programs, but this wont catch any non-elevated programs. And launching it without admin rights just collects messages from non-elevated programs. Same behavior on Windows 10, except that it doesn't matter anymore if UAC is on or off...
Et cetera is my worst enemy
Re: Mousehook troubles (Win10)
Use ChangeWindowMessageFilter_() or ChangeWindowMessageFilterEx_() in your exe
and allow it to receive the message your dll sends.
and allow it to receive the message your dll sends.
Re: Mousehook troubles (Win10)
You gotta love the PB community
Thank you, fryquez! Exactly what I was looking for (but didn't know)...
Adding to the program and running it with admin rights, catches now both elevated and non-elevated messages!
Thank you, fryquez! Exactly what I was looking for (but didn't know)...
Adding
Code: Select all
ChangeWindowMessageFilter_(#NLH_DLL_CONTROL, #MSGFLT_ADD)
Et cetera is my worst enemy
Re: (Solved) Mousehook troubles (Win10)
Cool. I've been using Win32 for years and never knew about this. Always learning something new.