code

I want this program to press ctrl+alt+z , but it does not :|
What's wrong ?

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>


int main()
{


// press DOWN "CTRL+ALT+Z"
keybd_event(VK_CONTROL, 0, 0, 0);
keybd_event(VK_MENU, 0, 0, 0);
keybd_event('z', 0, 0, 0);


// stop pressing "CTRL+ALT+Z"
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
keybd_event('z', 0, KEYEVENTF_KEYUP, 0);


}
even if that code worked the pressing would be virtually instantaneous so youre likely not to notice it
Topic archived. No new replies allowed.