1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| #include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int _tmain(int argc, _TCHAR* argv[])
{
_sleep(5000); //le temps de cliquer sur la fenêtre de mon MMO pour récupérer le bon handle
printf("Start\n");
HWND hSro = GetForegroundWindow();
printf("le handle de la fenêtre est : 0x%X\n",hSro);
TCHAR title[255];
GetWindowText(hSro,&*title,255);
HWND hFoc = GetFocus();
printf("La fenêtre avec le focus est : 0x%X",hSro);
keybd_event(VkKeyScan('i'),0,0,0);
keybd_event(VkKeyScan('i'),0,KEYEVENTF_KEYUP,0);
MessageBox(NULL,title,NULL,0);
} |
Partager