Parameters
- handle
Type: System.Int32
The handle of the window.
- x
Type: System.Int32
The x coordinate relative to the window.
- y
Type: System.Int32
The y coordinate relative to the window.
Return Value
Type: System.String
The answer with information about the success of the current command's execution. If current command was successful then this answer is "ok"; otherwise message describing the error.
The following code example demonstrates uses of the MouseMove method.
C# | ![]() |
---|---|
// find the html element HtmlElement he = instance.ActiveTab.FindElementByTag("input:submit", 0); // check the element if (!he.IsVoid) { // move the mouse to the html element location string result = Emulator.MouseMove(instance.ActiveTab.Handle, he.DisplacementInTabWindow.X + 10, he.DisplacementInTabWindow.Y + 10); if (result == "ok" && !Emulator.ErrorDetected) { // wait a little bit System.Threading.Thread.Sleep(200); // perform the click result = Emulator.MouseClick(instance.ActiveTab.Handle, MouseButton.Left, MouseButtonEvent.Click, he.DisplacementInTabWindow.X + 10, he.DisplacementInTabWindow.Y + 10); if (result == "ok" && !Emulator.ErrorDetected) return "All done"; return "Mouse click failed"; } else return "Mouse move failed"; } return "Element not found"; |
PHP | ![]() |
---|---|
// find the html element $he = $instance->ActiveTab->FindElementByTag("input:submit", 0); // check the element if (!$he->IsVoid) { // move the mouse to the html element location $result = ZennoLab\Emulation\Emulator::MouseMove($instance->ActiveTab->Handle, $he->DisplacementInTabWindow->X + 10, $he->DisplacementInTabWindow->Y + 10); if ($result == "ok" && !ZennoLab\Emulation\Emulator::ErrorDetected) { // wait a little bit System\Threading.\Thread\Sleep(200); // perform the click $result = ZennoLab\Emulation\Emulator::MouseClick($instance->ActiveTab->Handle, MouseButton::Left, MouseButtonEvent::Click, $he->DisplacementInTabWindow->X + 10, he->DisplacementInTabWindow->Y + 10); if ($result == "ok" && !ZennoLab\Emulation\Emulator::ErrorDetected) return "All done"; return "Mouse click failed"; } else return "Mouse move failed"; } return "Element not found"; |
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family