|
模拟QQ隐藏窗口
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Declare Function PtInRect Lib "user32" (lpRect As RECT, ByVal ptx As Long, ByVal pty As Long) As Long
Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Type POINTAPI
X As Long
Y As Long
End Type
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub Form_Load()
Me.Left = 0
End Sub
Sub Timer1_Timer()
Dim MyPoint As POINTAPI
Dim MyRect As RECT
Call GetCursorPos(MyPoint)
Call GetWindowRect(Me.hwnd, MyRect)
If PtInRect(MyRect, MyPoint.X, MyPoint.Y) = 0 Then
Me.Top = 0 - Me.Height + 10
ShowWindow Me.hwnd, 0
Else
ShowWindow Me.hwnd, 5
Me.Top = 0
End If
End Sub |
|