About Me

Kamis, 28 Juni 2012

Form Mengikuti Kusor

-:|>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

0 komentar:

Postingan Populer

Diberdayakan oleh Blogger.

Popular Posts

 

Postingan Populer

New Story of My Life

Copyright© 2012 Angelz-Hackedz | Designer by : AlexCucuMbahGoogle |