views:

39

answers:

2

Dear all, I want to set a global hook by SetWindowsHookEx. The hook is wrapped in hook.dll and is registered by a GUI window app.exe. Everything works fine on window NT/xp. But on Win7, how could I start app.exe process without UAC prompt and it can successfully load hook.dll to register gloal hook on Win7?? I use VC2005.

Any ideas are appreciated!!

Best whishes, Kevin

A: 

Without changing the end users UAC settings (which would require either being at the keyboard or having been elevated and thus having seen a UAC prompt), there is no way to do this. This is by design. Being able to do something that the user has required a UAC prompt be presented for without the system presenting a UAC prompt would be classed as a bug by Microsoft and pretty immediately patched.

Take a read of this MSDN article.

Rob
Hi Rob, thanks for your kind help! I'm puzzled why starting some applications there is no UAC prompt but others have. I compiled test.exe by vc2005. Then double click it, it runs without UAC prompt. test.exe loaded hook.dll and call installHook function to register setWindowHookEx for keyboard hook. Then Win7 has no response and seems suspend there. I don't know why, could you or anyone give some help? 3X!
Kevin Hou
A: 

Kevin, please see my answer that deals with that same question. There IS a specific way to avoid the UAC prompt.

Warner Young

related questions