-:|>VisualBasic 6.0
==============================================================
-:> Buat Form Baru (BorderStyle=None)
-:> Sebuah Timer (Enabled=True; Interval=10)
Di bagian '(Declarations)' dari Form ketik:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Di bagian 'Form_Load' ketik:
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, &H1 Or &H2 'selalu di depan
Di bagian 'Timer1_Timer' ketik:
Dim p As POINTAPI
GetCursorPos p
Me.Left = (p.X * Screen.TwipsPerPixelX) + 100
Me.Top = (p.Y * Screen.TwipsPerPixelY) + 100
Kamis, 28 Juni 2012
Langganan:
Posting Komentar (Atom)