Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global hGui, moved
- Gui, +hwndhGui -Caption
- Gui, Add, Text, gText, Текст
- Gui, Add, Button, gButton, Кнопка
- Gui, Show, w100 h100
- return
- Text:
- WinMove()
- if moved
- return
- MsgBox, Text
- return
- Button:
- if moved
- return
- MsgBox, Button
- return
- WinMove()
- {
- static
- CoordMode, Mouse
- SetWinDelay, -1
- SetBatchLines, -1
- MouseGetPos, Start_X, Start_Y
- WinGetPos, X_Win, Y_Win,,, ahk_id %hGui%
- While GetKeyState("LButton", "P")
- {
- MouseGetPos, Current_X, Current_Y
- moved := (Current_X != Start_X || Current_Y != Start_Y) ? 1 : ""
- WinMove, ahk_id %hGui%,, X_Win + Current_X - Start_X, Y_Win + Current_Y - Start_Y
- Sleep, 10
- }
- }
- Esc::ExitApp
- #If WinActive("ahk_id" hGui)
- ~LButton:: WinMove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement