本帖最后由 happytc 于 2011-7-12 03:33 编辑
看到居然这么多人对这个感兴趣,贴一个我以前写的这个功能的函数:
Func HideCaptureBar($hwdGuiBar, $Duration = 500)
Local $MousePos, $WinPos, $AW_SHOW = 0, $Flag = 0
If Not IsHWnd($hwdGuiBar) Then Return
$MousePos = MouseGetPos()
$WinPos = WinGetPos($hwdGuiBar)
If Not IsArray($WinPos) Or Not IsArray($MousePos) Then Return
If $MousePos[1] <= 1 And Not BitAND(WinGetState($hwdGuiBar), 2) Then
If $WinPos[1] < 0 Then
$WinPos[1] = 0
WinMove($hwdGuiBar, "", $WinPos[0], $WinPos[1])
EndIf
_WinAPI_AnimateWindow($hwdGuiBar, $AW_SLIDE + $AW_SHOW + $AW_VER_POSITIVE, $Duration)
$Flag = 1
ElseIf $MousePos[1] >= @DesktopHeight - 1 And Not BitAND(WinGetState($hwdGuiBar), 2) Then
If $WinPos[1] > @DesktopHeight - $WinPos[3] Then
$WinPos[1] = @DesktopHeight - $WinPos[3]
WinMove($hwdGuiBar, "", $WinPos[0], $WinPos[1])
EndIf
_WinAPI_AnimateWindow($hwdGuiBar, $AW_SLIDE + $AW_SHOW + $AW_VER_NEGATIVE, $Duration)
$Flag = 1
ElseIf $MousePos[0] >= @DesktopWidth - 1 And Not BitAND(WinGetState($hwdGuiBar), 2) Then
If $WinPos[0] > @DesktopWidth - $WinPos[2] Then
$WinPos[0] = @DesktopWidth - $WinPos[2]
WinMove($hwdGuiBar, "", $WinPos[0], $WinPos[1])
EndIf
_WinAPI_AnimateWindow($hwdGuiBar, $AW_SLIDE + $AW_SHOW + $AW_HOR_NEGATIVE, $Duration)
$Flag = 1
ElseIf $MousePos[0] <= 1 And Not BitAND(WinGetState($hwdGuiBar), 2) Then
If $WinPos[0] < 0 Then
$WinPos[0] = 0
WinMove($hwdGuiBar, "", $WinPos[0], $WinPos[1])
EndIf
_WinAPI_AnimateWindow($hwdGuiBar, $AW_SLIDE + $AW_SHOW + $AW_HOR_POSITIVE, $Duration)
$Flag = 1
EndIf
If $Flag Then Return
If $WinPos[1] < 0 And BitAND(WinGetState($hwdGuiBar), 2) Then
_WinAPI_AnimateWindow($hwdGuiBar, $AW_SLIDE + $AW_HIDE + $AW_VER_NEGATIVE, $Duration)
ElseIf $WinPos[1] + $WinPos[3] > @DesktopHeight And BitAND(WinGetState($hwdGuiBar), 2) Then
_WinAPI_AnimateWindow($hwdGuiBar, $AW_SLIDE + $AW_HIDE + $AW_VER_POSITIVE, $Duration)
ElseIf $WinPos[0] + $WinPos[2] > @DesktopWidth And BitAND(WinGetState($hwdGuiBar), 2) Then
_WinAPI_AnimateWindow($hwdGuiBar, $AW_SLIDE + $AW_HIDE + $AW_HOR_POSITIVE, $Duration)
ElseIf $WinPos[0] < 0 And BitAND(WinGetState($hwdGuiBar), 2) Then
_WinAPI_AnimateWindow($hwdGuiBar, $AW_SLIDE + $AW_HIDE + $AW_HOR_NEGATIVE, $Duration)
EndIf
EndFunc
|