Mouse_Event to send click to the Windows screen ?



I have found following code from Torry`s Delphi Page. Here, what does
X and Y refers to? Top-Left corner of Current Windows Screen or Top-
Left corner of Form1 or Image1?
My goal is to send mouse click to the Windows screen. (eg:
X:=10,Y:=1010 to click START icon in the windows. I assumed that
screen resolution is 1280×1024)

Could you help me?

Torry`s Code
______________________________________________
// Set the mouse cursor to position x,y:
SetCursorPos(x, y);

// Simulate the left mouse button down
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
.


Quantcast