回复 8# whitehead
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
;
Opt("GUIOnEventMode", 1)
Local $label1, $label2, $label3, $label4, $label5
$Form1 = GUICreate("float", 104, 41, @DesktopWidth / 2 - 50, 10, $WS_POPUP, BitOR($WS_EX_TOPMOST, $GUI_WS_EX_PARENTDRAG));, $WS_EX_TOOLWINDOW
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUICtrlSetOnEvent($Form1, "mouseCHK")
$label1 = GUICtrlCreateButton("C", 0, 1, 20, 20, $BS_FLAT)
; GUICtrlSetBkColor( $label1 , $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent($label1, "_go1")
$label2 = GUICtrlCreateButton("D", 21, 1, 20, 20, $BS_FLAT)
; GUICtrlSetBkColor( $label2 , $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent($label2, "_go2")
$label3 = GUICtrlCreateButton("E", 42, 1, 20, 20, $BS_FLAT)
; GUICtrlSetBkColor( $label3 , $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent($label3, "_go3")
$label4 = GUICtrlCreateButton("F", 63, 1, 20, 20, $BS_FLAT)
; GUICtrlSetBkColor( $label4 , $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent($label4, "_go4")
$label5 = GUICtrlCreateButton("R", 84, 1, 20, 20, $BS_FLAT)
; GUICtrlSetBkColor( $label5 , $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent($label5, "_go5")
GUICtrlCreateLabel("", 0, 0, 104, 41, $SS_CENTERIMAGE, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func _go1()
ShellExecute("C:\")
EndFunc ;==>_go1
Func _go2()
ShellExecute("D:\")
EndFunc ;==>_go2
Func _go3()
ShellExecute("E:\")
EndFunc ;==>_go3
Func _go4()
ShellExecute("F:\")
EndFunc ;==>_go4
Func _go5()
ShellExecute("R:\")
EndFunc ;==>_go5
;mouseCHK
Func mouseCHK()
$MS = GUIGetCursorInfo($Form1)
MsgBox(0, "", "test")
If $MS[4] = $Form1 Then move()
EndFunc ;==>mouseCHK
;==>move
Func move()
Local $PosDiff[2], $MousePos, $WinPos
$MousePos = MouseGetPos()
$WinPos = WinGetPos($Form1, "")
$PosDiff[0] = $WinPos[0] - $MousePos[0]
$PosDiff[1] = $WinPos[1] - $MousePos[1]
While _IsPressed("01", DllOpen("user32.dll"))
$MousePos = MouseGetPos()
WinMove($Form1, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
Sleep(10)
WEnd
EndFunc ;==>move
Func SpecialEvents()
Exit
EndFunc ;==>SpecialEvents
|