Posted By

tsatish on 04/20/11


Tagged

get cursor position QTP DotnetFactory


Versions (?)

Get Cursor Position in QTP


 / Published in: Visual Basic
 

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

  1. Dim controlObject
  2. Dim currentX
  3. Dim currentY
  4.  
  5. Set controlObject = DotNetFactory.CreateInstance("System.Windows.Forms.Control")
  6. currentX = controlObject.MousePosition.X
  7. currentY = controlObject.MousePosition.Y

Report this snippet  

You need to login to post a comment.