 |
|
 |
Hi,
I'm using your code on WinCE 6.1. I need to detect whether the event the callback receives is an up or down press. Flags argument is always 0. Am I doing something wrong?
|
|
|
|
 |
|
 |
My code looks pretty much like your example, but when the callback function is called after pressing a key, I get a Prefetch Abort exception.
Prefetch Abort: Thread=869f4c80 Proc=8045d050 'myapp.exe'
AKY=00000009 PC=00000000(???+0x00000000) RA=00011f20(myapp.exe+0x00001f20) BVA=00000000 FSR=000004f0
One exception is thrown when the key is pressed and one when it is released. Each time, the program is at the line:
return CallNextHookEx( g_hInstalledLLKBDhook, nCode, wParam, lParam );
Everything works fine if I just "return 0;" instead. But, that may not be a good idea.
I'm using WM6.1, so maybe there's an issue with that.
By the way, how do you export the g_hInstalledLLKBDhook variable from the DLL to use in your application? I added to the DLL an exported "HHOOK GetHook(){ return hInstalledLLKBDhook; }" function, but that may also be wrong.
Thanks for any help,
PaulH
|
|
|
|
 |
|
 |
add code in files wincekbhook.cpp as below:
HRESULT DefHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
return CallNextHookEx(g_hInstalledLLKBDhook, nCode, wParam, lParam);
}
on your app, just call
return DefHookProc(nCode, wParam, lParam);
Then it's OK now.
|
|
|
|
 |
|
 |
It would more simple than we think
All we have to do are:
#include // "sipapi.h"
In Set Foucs event of the Edit box (for example we need to change edit box text)
plz call this one.. to show virtual key board
SipShowIM(SIPF_ON);
In Kill Foucs event of the Edit box
Plz call this one to hide keyboard
SipShowIM(SIPF_OFF);
(Thanks Mr. Bang)
|
|
|
|
 |
|
 |
How did you figure out the value for WH_KEYBOARD_LL?
I found some in winuser.h but they are all wrong
|
|
|
|
 |
|
 |
Hello all,
I am developing a screen saver application on Windows CE 5.0, using Visual C++ and Windows API.
Has anyone here worked on such application, could you please share me your experiences? It is not easy as what I thought at first.
As what I know, Windows CE (and Pocket PC) does not support Screen saver like Desktop. In Desktop, developing a Screen saver is easy, windows API supports DefScreenSaverProc function, we just develop screen saver as .exe and just rename it to .scr
But in WinCE, we cannot do like that. WinCE does not support Screen saver, so there is no DefScreenSaverProc function, and if we rename .exe file into .scr the OS does not execute the file.
So we have to do everything by ourself.
My idea is: To start screen saver, we have a background application (a service or no-window application) which will "listen to" the system, after a predefined time (for example, 5 minutes) if there is no action on machine (no tap on screen, no press on machine's keys...) the background application will start showing the Presentation of Screen saver.
To implement this, I think about Hook technology, but as what I researched until now, Windows CE also does not support SetWindowsHookEx function.
Now I'm getting stuck.
So, if anyone has deals with an application like mine, could you help give me some ideas? How did you solve this problem? How to activate the Screen saver in Windows CE? Which technologies do you think that can achieve this?
Your responses would be kindly appreciated.
Thanks.
Minh
|
|
|
|
 |
|
 |
I want my DLL to be injected in all the processes running on the Pocket PC emulator, so that I can capture keyboard event of any application. I tried this using the method written in the article, but the DLL is getting injected only in the calling process. Please Help!
|
|
|
|
 |
|
 |
Thanks for your method to set keyboard hooks in WinCE.
but you know,we use the virtual keyboard on Pocket PC,so do you know how to set virtual keyboard hooks?
|
|
|
|
 |
|
 |
Hi,
I am having same problem. I have to catch global Mouse, virtual keyboard and stylus events for a WinCE 4.2 based application. Can anybody suggest me How can i do that? I am able to trace keyboard events, but not mouse events. Its urgent. please help.
Thanks,
Rahul
|
|
|
|
 |
|
 |
First thanks for a good article. I had some problems using your source because of the following static declarations in winceKBhook.h, but perhaps I didn't fully understand your intended usage of the source files.
// Win32 Hook APIs
static _SetWindowsHookExW SetWindowsHookEx;
static _UnhookWindowsHookEx UnhookWindowsHookEx;
static _CallNextHookEx CallNextHookEx;
This caused the file I included winceKBhook.h to have it's own copies of SetWindowsHookEx, UnhookWindowsHookEx, and CallNextHookEx seperate from the ones in winceKBhook.cpp. To fix it I simply made them extern in winceKBhook.h and made them global in winceKBhook.cpp. Another alternative might be to declare these as functions in winceKBhook.h, and provide implementations that invoke function pointers loaded from coredll in winceKBhook.cpp.
|
|
|
|
 |
|
 |
I am happy to see your sample.
I have tried to go through so many code (involve hotkey) but none of them works well for me.
|
|
|
|
 |
|
 |
//now load the coredll.dll
if( GetModuleHandle(_T("coredll")== NULL)
g_hHookApiDLL = LoadLibrary(_T("coredll.dll"));
that will be more perfect!
|
|
|
|
 |
|
 |
Hello,
Not sure how I can contact you, but I'm looking for your permission to use this code in some sample code for my companies public SDK. We'll leave your name in it if you'd like.
Thanks,
steven
|
|
|
|
 |
|
 |
Okay go ahead and use it....
|
|
|
|
 |
|
 |
Hi,
Your article is great.
However, you forgot to say that keyboard hooks in WinCE only works for real hardware keys (not the Soft Input Panel one).
You also forgot to say that it is not supported in PPC 2002 (at least, like you've done it).
Anyway, the example you've given is a bad example (if you want to remap the left/right hardware key to the top key, you've better handled left/right keypressed messages like the top key in your application).
Sincerely,
Cyril
|
|
|
|
 |
|
 |
First & foremost my apologies for taking so long to reply.
I agree with you that I forgot to mention about Soft Input Panel issue. As far as PPC 2002 is concerned....I didn't know about it. Thanks for the info.
As far as the example is concerned, it was for the situation I faced wherein I had a dialog based application and I had to allow the user to rempa the keys.
|
|
|
|
 |