I'm trying to write a program for Windows that will control the mouse with the keyboard, but I'm not sure I understand how Windows works.
My theory is that I will need to send mouse event messages for the mouse and hook the messages from the keys that are used to control the mouse. And I thought that I was going to need to send those messages to the in-focus window via a handle, but there isn't a handle parameter in the message sending function...
So, the question is, "Do I send the messages with no destination?" and "Does the OS grab messages and route them itself?"
If you want to move the mouse, for example using your arrow keys, you would set up event handling using your windows procedure fuction, and depending on what key is pressed(determined throuhg a switch statement of your lParam), you move the mouse. Im not sure if there is a windows function you can call to move the mouse, but if you do some research Im sure you could figure it out.
I appreciate the response, but it doesn't seem like you answered the question I asked.
My question was more like, how does Windows work?
The intent behind my program is to replace all the functionality of the mouse with key presses. It will not have a graphical component. It will be a keyboard mouse.
As far as I understand it, an application receives events from the OS and it receives them only when it is "in-focus". If that's correct (maybe it's not), then when another program is in-focus, the key-combo's will not work.
My understanding is that the Windows Proc function of my program will have to hook the appropriate messages from the keyboard and replace them with mouse event messages.