|
wince下捕获键盘消息可以用SetWindowsHookExW的hook实现,但是我在ppc 6.0下不能捕获鼠标
以下是实现:
[code] HINSTANCE library;
sethook sethookfunction;
if((library=LoadLibrary(L"coredll.dll"))==NULL)
OutputDebugString(L"LoadLibrary coredll.dll failed!\n");
if((sethookfunction=(sethook) GetProcAddress(library,L"SetWindowsHookExW"))==NULL)
OutputDebugString(L"GetProcAddress SetWindowsHookEx failed!\n");
if((nexthookfunction=(nexthook) GetProcAddress(library,L"CallNextHookEx"))==NULL)
OutputDebugString(L"GetProcAddress CallNextHookEx failed!\n");
if((hook=sethookfunction(12,QASetWindowsJournalHookProc,hInstance,0))== NULL)
OutputDebugString(L"sethookfunction failed\n");
|
|