PDA

View Full Version : Does WM6.1 have a new Keyboard hooker id definition?


cashmore
13-04-2008, 03:13 AM
In order to save the battery life, I always make the backlight to the darkest indoor, but when I get into the outdoor, the sunlight makes the screen unreadable, and if I need to increase the backlight by 'Start' -> 'Settings' -> 'Backlight', I have to 'guess' where I tapped.

I wrote a program to do this by hotkey. The program binds itself to "Key 6" (The code in registry is 0x40C6, short press of the voice command key above the scroll wheel, this key is not defined in a shipped rom). It will hooks the scroll and 5-ways keys events,such as VK_UP/VK_DOWN ect, and adjust the backlight by keypress.

This program works well in WM6.0, but cannot work on WM6.1, it can only get and display current backlight level correctly, but can't hook the keyboard events.

Here is the codes:

g_hKeyboardHook = ::SetWindowsHookExW( 20,//WH_KEYBOARD_LL,which is not the same value as PC windows
(HOOKPROC) KeyboardProc,
0,
0);
err = ::GetLastError();
err returns 'Not enough privilege', but I've changed in the registry table and disabled the Unsigned Applications Policy checking.

So my question is :

1.Does WM6.1 have a new security policy setting?
2.Or Microsoft changed the undocumented API SetWindowsHookExW and WH_KEYBOARD_LL definition in WM6.1?

Thanks for you help:)