Advertisement

non-focusing

Started by November 30, 2001 09:08 PM
4 comments, last by Psycho1 23 years, 2 months ago
ok, is there a way i could have a program recieve messages like key presses when its not focused? or is that something windows aviods?
There sure is:

PeekMessage(&msg,NULL,0,0,PM_NOREMOVE);

Use PM_REMOVE if u want to kill the message after.

Hope this helps!

---------------

I finally got it all together...
...and then forgot where I put it.
Advertisement
ok, lemme explain my problem
i got this game where i want to make a rapid fire function. i made a program that sends msg's to make WM_KEYDOWN to KEYUP, but, i need it to change that in the game program, how would i do that?

you could say its like a keylogger. whenever a key is pressed, it acknolages that, but on this it sends a message to a outside program =/

(where would i put this, as well?)

Edited by - Psycho1 on November 30, 2001 10:17:28 PM
I dunno exactly what u mean, but for a game, I would suggest that you use GetAsyncKeyState(VK_UP) for checking if a key is down. That''s what i use anyway...

---------------

I finally got it all together...
...and then forgot where I put it.
Well, it could be fore any program
i just want one program to check if the button ''D'' is held down, if it is, then to send the msg WM_KEYUP to the program
Yeah, use GetAsyncKeyState to see if a key is pressed, the use keybd_event to send the messages.

This topic is closed to new replies.

Advertisement