How can I change the cursor position?
Applies To: C++Builder 1 or higher
Category: Knowledge Base
- I can determine the cursor position but how can I change it?
-
- Start a new project using File | New Application.
-
- Add a Button. Edit its OnClick event:
-
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- SetCursorPos(0, 0);
- }
-
- The Win32 API function SetCursorPos allows you to set the cursor position.
-
- Notes
- · The cursor coordinates are screen based and not client based: the (0, 0) point is in the top left corner of the screen not the form.
C++Builder Developer's Network
Copyright © Yoto Yotov