Not that I know exactly how that code is being executed, since you're retarded and only gave us the barest of code snippets, but shouldn't you be looping on GetAsyncKeyState instead of just an if-statement? I mean, if you're executing this snippet in a larger loop, that's fine, but if this is just getting executed the once and you expect it to wait for you to hit F11, you're mistaken.