Bonjour, j'ai deux question :
- Comment créer un table avec une colonne : name et une autre value par exemple.
- Et je récupère les frappe clavier avec un Hook :
hHook = SetWindowsHookEx(WH_KEYBOARD_LL,(HOOKPROC)hookFonction,hInstance,NULL);
et
1 2 3 4 5 6 7 8 9 10
|
__declspec(dllexport) LRESULT CALLBACK hookFonction(int nCode,WPARAM wParam,LPARAM lParam ) {
if( wParam == WM_KEYDOWN ) {
KBDLLHOOKSTRUCT key = *(KBDLLHOOKSTRUCT*)lParam;
char chaine[1];
sprintf (chaine,"%lc",(char)key.vkCode);
SetWindowText(hControle,chaine); // hControle zone EDIT
}
return CallNextHookEx(hHook, nCode, wParam, lParam);
} |
Mais le problème, si je presse a il m'affiche A,
si je presse retour arrière un drole de signe,
1 du PAD il m'affiche a...
Donc ca bug.
J'aimerais donc savoir comment faire pour savoir qu'elle est la touche qui a été pressé. Dans le but de faire des statistiques des touches les plus utilisé.
merci de votre aide
Partager