30. oktober 2001 - 23:53
#1
\'Det her er det nærmeste på et klik
\'----------------------- Form1 -----------------------
Private Declare Function WindowFromPoint Lib \"user32\" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetParent Lib \"user32\" (ByVal hWnd As Long) As Long
Private Declare Function GetCursorPos Lib \"user32\" (lpPoint As POINTAPI) As Long
Private Declare Function SendMessageLong& Lib \"user32\" Alias \"SendMessageA\" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Sub Form_Load()
Timer1.Interval = 1000 \'1 sec
End Sub
Private Sub Timer1_Timer()
Dim lhwnd As Long
Dim PtMouse As POINTAPI
GetCursorPos PtMouse \'Updater (PtMouse)
lhwnd = WindowFromPoint(PtMouse.X, PtMouse.Y) \'Get hwnd X,Y
SendMessageLong lhwnd, &H201, 0&, 0& \'Simuler Click(L) (Mouse Down)
SendMessageLong lhwnd, &H202, 0&, 0& \'Simuler Click(L) (Mouse Up)
End Sub
\'----------------------- Form1 -----------------------