Anonymous user
Mouse position: Difference between revisions
→{{header|Delphi}}
Line 134:
lblMousePosition.Caption := ('X:' + IntToStr(X) + ', Y:' + IntToStr(Y));
end;</lang>
== Delphi Console Program ==
The following program will help capture mouse position with the help of Windows and classes units.
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils, Controls, Windows;
var
MyMouse : TMouse;
begin
MyMouse := TMouse.Create;
While True do
begin
WriteLn('(X, y) = (' + inttostr(TPoint(MyMouse.CursorPos).x) + ',' + inttostr(TPoint(MyMouse.CursorPos).y) + ')');
sleep(300);
end
end.
--[[User:Neo.abhinav|Neo.abhinav]] 17:00, 6 May 2011 (UTC)
=={{header|F_Sharp|F#}}==
|