Не стоит заниматься членовредительством.
SetBatchLines, -1
CoordMode, Mouse
WinGet, WinID, ID, ahk_class Shell_TrayWnd
WinGetPos,,, Width, Height, % "ahk_id" WinID
Width:=12
GUIXPos:=A_ScreenWidth-Width
GUIYPos:=(A_ScreenHeight-Height)-(Height+1)
GUIYPos2:=GUIYPos-(Height+1)
GUIYPos3:=GUIYPos2-(Height+1)
Hotkey, Ctrl & Esc, ExitScript
SetTimer, ChaseCoordinates, 250
SetTimer, ChaseCoordinates2, 250
SetTimer, ChaseCoordinates3, 250
Gosub, TrayMenu
Return
ChaseCoordinates:
MouseGetPos, XPos, YPos, WinID
WinGetClass, WinClass, % "ahk_id" WinID
If (WinID=GUIID)
{
Gui, Color, Red
RevealGUI()
If ((GetKeyState("vk01" "P")
Or GetKeyState("vk02" "P"))
And XPos>=GUIXPos
And YPos>=GUIYPos And !Iterate)
{
TrayTip, Действие первое, при перетаскивании,, 2
Iterate:=1
}
}
Else
{
Gui, Color, Green
RevealGUI()
Iterate:=0
}
Return
ChaseCoordinates2:
MouseGetPos, XPos2, YPos2, WinID2
WinGetClass, WinClass, % "ahk_id" WinID2
If (WinID2=GUIID2)
{
Gui, 2:Color, Blue
RevealGUI2()
If ((GetKeyState("vk01" "P")
Or GetKeyState("vk02" "P"))
And XPos2>=GUIXPos
And YPos2>=GUIYPos2 And !Iterate2)
{
TrayTip, Действие второе, при перетаскивании,, 2
Iterate2:=1
}
}
Else
{
Gui, 2:Color, Yellow
RevealGUI2()
Iterate2:=0
}
Return
ChaseCoordinates3:
MouseGetPos, XPos3, YPos3, WinID3
WinGetClass, WinClass, % "ahk_id" WinID3
If (WinID3=GUIID3)
{
Gui, 3:Color, Fuchsia
RevealGUI3()
If ((GetKeyState("vk01" "P")
Or GetKeyState("vk02" "P"))
And XPos3>=GUIXPos
And YPos3>=GUIYPos3 And !Iterate3)
{
TrayTip, Действие третье, при перетаскивании,, 2
Iterate3:=1
}
}
Else
{
Gui, 3:Color, Aqua
RevealGUI3()
Iterate3:=0
}
Return
~LButton::
~RButton::
If (XPos>=GUIXPos And YPos>=GUIYPos)
{
SetTimer, ChaseCoordinates, Off
TrayTip, Действие первое, по клику,, 1
Iterate:=1
SetTimer, ChaseCoordinates, 250
}
Else If (XPos2>=GUIXPos And YPos2>=GUIYPos2)
{
SetTimer, ChaseCoordinates2, Off
TrayTip, Действие второе, по клику,, 1
Iterate2:=1
SetTimer, ChaseCoordinates2, 250
}
Else If (XPos3>=GUIXPos And YPos3>=GUIYPos3)
{
SetTimer, ChaseCoordinates3, Off
TrayTip, Действие третье, по клику,, 1
Iterate3:=1
SetTimer, ChaseCoordinates3, 250
}
Return
TrayMenu:
Menu, Tray, NoStandard
Menu, Tray, Icon, shell32.dll, 35
Menu, Tray, Tip, Hide/Show Desktop
Menu, Tray, Add, &About, About
Menu, Tray, Add, &Exit (Ctrl+Esc), ExitScript
OnMessage(0x404, "WM_LBUTTONDOWN")
Return
About:
OpenAbout:=1
Hotkey, Ctrl & Esc, Off
SetTimer, ChaseCoordinates, Off
SetTimer, ChaseCoordinates2, Off
SetTimer, ChaseCoordinates3, Off
Gui, Destroy
Gui, 2:Destroy
Gui, 3:Destroy
Gui, Add
, Text
, x32 y30 w140 h20 +Center
, Made using AutoHotkey for
Gui, Font, Bold
Gui, Add
, Text
, x32 y50 w140 h20 +Center
, Vasya Pupkin
Gui, Font
Gui, Font, CBlue Underline
Gui, Add
, Text
, x22 y90 w160 h20 gAHKHome +Center
, www.autohotkey.com
Gui, Font
Gui, Add, GroupBox, x22 y10 w160 h110
Gui, -MinimizeBox -Resize
Gui, Show, Center h135 w205, About
hHandCursor:=DllCall("LoadCursor", UInt, 0
, Int, 32649)
OnMessage(0x200, "WM_MOUSEMOVE")
Return
AHKHome:
Run, http://www.autohotkey.com,, UseErrorLevel
Return
GuiClose:
OpenAbout:=0
Gui, Destroy
SetTimer, ChaseCoordinates, 250
SetTimer, ChaseCoordinates2, 250
SetTimer, ChaseCoordinates3, 250
Hotkey, Ctrl & Esc, On
Return
ExitScript:
ExitApp
RevealGUI()
{
Global
Gui, +AlwaysOnTop
. -Caption
. +ToolWindow
. +ToolWindow
. +Border
. +LastFound
; WinSet, Trans, 125, ahk_class AutoHotkeyGUI
Gui, Show, NoActivate x%GUIXPos%
. y%GUIYPos%
. w%Width%
. h%Height%
GUIID:=WinExist()
}
RevealGUI2()
{
Global
Gui, 2:+AlwaysOnTop
. -Caption
. +ToolWindow
. +ToolWindow
. +Border
. +LastFound
; WinSet, Trans, 125, ahk_class AutoHotkeyGUI
Gui, 2:Show, NoActivate x%GUIXPos%
. y%GUIYPos2%
. w%Width%
. h%Height%
GUIID2:=WinExist()
}
RevealGUI3()
{
Global
Gui, 3:+AlwaysOnTop
. -Caption
. +ToolWindow
. +ToolWindow
. +Border
. +LastFound
; WinSet, Trans, 125, ahk_class AutoHotkeyGUI
Gui, 3:Show, NoActivate x%GUIXPos%
. y%GUIYPos3%
. w%Width%
. h%Height%
GUIID3:=WinExist()
}
WM_MOUSEMOVE(wParam, lParam)
{
Global hHandCursor, Hover
MouseGetPos,,,, WinControl
If WinControl=Static3
DllCall("SetCursor", UInt, hHandCursor)
}
WM_LBUTTONDOWN(uMsg, lParam)
{
Global
If (uMsg=0x404 And lParam=0x201)
{
If OpenAbout
SetTimer, GuiClose, -0
Else
SetTimer, About, -0
}
}