All right, it works when you set the focus on a button.
But if you want to click anywhere on a window, does it works ?
I tried :
SendMessage(window->Handle, WM_LBUTTONDOWN, 530, 35);
Where window is the name of my Form and 530,35 the coordonate of a boutton but nothing happens...
In fact, I don't want to click on a button or any particular object. I want to be able to click anywhere on the screen like I would do with my mouse. I was told to use a windows'API but I don't know how.
Just get the windows handle with needed coordinates and send both WM_LBUTTONDOWN and WM_LBUTTONUP. At the first you should set this window as foreground and after sending messages set the foreground the last active window. John Fill
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.