1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| #include <windows.h>
#include <iostream>
int main ()
{
HANDLE hIn;
INPUT_RECORD irInBuf;
DWORD dw;
keybd_event(VK_MENU,0x38,0,0);
keybd_event(VK_RETURN,0x1c,0,0);
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
hIn = GetStdHandle(STD_INPUT_HANDLE);
while (1)
{
std::cout << "\nC'est une solution..." << "\nspacebar to exit";
ReadConsoleInput(hIn,&irInBuf,1,&dw);
switch (irInBuf.EventType)
{
case KEY_EVENT:
if(irInBuf.Event.KeyEvent.wVirtualScanCode == 57)
return 0;
case MOUSE_EVENT:
system("cls");
break;
default :
break;
}
}
} |
Partager