Saturday, April 23, 2011

Get Cursor Position using Visual basic

Visual Basic has a tool Spy + + is good. Spy + + has a feature that allows you to get all sorts of information, such as the Class Name, Window Handle, Window Caption, even all the style attributes and message contained in the window. This is simply done by moving the Finder Tool according dengann your own. All the secret behind that found in desktop applications can be found by using the Finder Tool. Finder Tool Information generated, can be used to helps to build applications programmers wanted.
Finder Tool on Spy + + utilizing the API function GetCursorpos and WindowFromPoint and both embedded (embedded) in a procedure library user32.dll. Here's a complete documentation about GetCursorPos.


Syntax
GetCursorPos Lib "USER32" (lpPoint as POINTAPI) as Long

Function
Returns the position coordinates (x, y) cursor on the screen.
Parameter
lpPoint: a declaration of POINTAPI structure that receives the coordinates of the position of the cursor on the screen. Before filling this parameter, first declaring Type POINTAPI be done.

Type POINTAPI
x as Long
y as Long
End Type


Sample preview program:



to download sample program, click here.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Blogger Templates