mouse(int* x, int* y, HWND hWnd): int
Returns the mouse button state and mouse coordinates, relative to a window or to
x, y - pointers to int variables to be filled with the mouse coordinates.
hWnd - window handle as returned by the
window function, or 0 for returning
the mouse position in screen coordinates.
0 for no mouse button pressed down, 1 for left, 2 for right, 4 for middle button.
- The mouse function can be used for calibrating the positions of "Buy" and "Sell" buttons on a broker's web interface, f.i. for binary options. Automated buying and selling can then be performed by clicking those buttons with the keys function.
HWND h = window("Script Editor");
int button = mouse(&x,&y,h);
printf("\r%04d %04d %d",x,y,button);