silentHill

I would like to send mouse click on the position that is base on the active window. I can send a mouse anywhere on the screen with a given position, but I'm unable to send a mouse to a position based on the active window not the whole screen. How can I achieve that


Re: Visual C++ General mouse event?

einaros

If I'm interpreting you right, this is merely a matter of doing a calculation such as: Position within window = position on screen - position of window.

mouse_event has no knowledge of windows, so you should just offset your positions accordingly.





Re: Visual C++ General mouse event?

silentHill

I see... So there is no such function that allows me to send the mouse position base on the active window position. The equation that you replied is that the correct one or you're just giving an example In either cases, what number or equation I should use




Re: Visual C++ General mouse event?

einaros

No, there's no such function. But it's really not a problem either. Just retrieve the windows base coordinates and add those to the position within the window. There's really not much more to it Smile