Return to Snippet

Revision: 44902
at April 20, 2011 16:38 by tsatish


Updated Code
Dim controlObject
Dim currentX
Dim currentY
   
Set controlObject = DotNetFactory.CreateInstance("System.Windows.Forms.Control")
currentX = controlObject.MousePosition.X
currentY = controlObject.MousePosition.Y

Revision: 44901
at April 20, 2011 16:36 by tsatish


Initial Code
Dim controlObject
   Dim currentX
   Dim currentY
   
   Set controlObject = DotNetFactory.CreateInstance("System.Windows.Forms.Control")
   currentX = controlObject.MousePosition.X
   currentY = controlObject.MousePosition.Y

Initial URL

                                

Initial Description
Using this code snippet we can get the current cursor position in QTP. Dotnet factory is used to get the current cursor position as there is no direct way to get the current cursor position in QTP / Visual Basic

Initial Title
Get Cursor Position in QTP

Initial Tags

                                

Initial Language
Visual Basic