Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;AutoHotKey Commands Tutorial #2: MouseGetPos
- ;Written By: CivReborn
- ;YouTube Page: https://www.youtube.com/channel/UCge0TKjySLXd8xeLib8F0rA
- ;Date: Jan 29th, 2017
- ;MouseGetPos, [OutputVarX, OutputVarY, OutputVarWin, OutputVarControl, 1|2|3]
- /*
- 1: Uses a simpler method to determine OutputVarControl.
- This method correctly retrieves the active/topmost child window of an Multiple Document Interface (MDI) application such as SysEdit or TextPad. However,
- it is less accurate for other purposes such as detecting controls inside a GroupBox control.
- 2 [v1.0.43.06+]: Stores the control's HWND in OutputVarControl rather than the control's ClassNN.
- 3 [v1.0.43.06+]: A combination of 1 and 2 above.
- */
- #SingleInstance, Force
- CoordMode, Mouse, Screen
- Gui, Font, cAqua
- Gui, Add, Text, x10 y10,X =
- Gui, Add, Edit,cBlack x+10 w100 h15
- Gui, Add, Text, x+10,Y =
- Gui, Add, Edit,cBlack x+10 w100 h15
- Gui, Add, Text, x10, Window ID:
- Gui, Add, Edit,cBlack x+10 w220 h15
- Gui, Add, Text, x10, Control ID:
- Gui, Add, Edit,cBlack x+10 w220 h15
- Gui, Add, Button,x10 y75 w135 h20 gGet_INFO,GET INFO
- Gui, Add, Button,x+10 y75 w135 h20 gMouse_Move,Mouse Move
- Gui, Color, Black
- Gui, +AlwaysOnTop
- Gui, Show, w300 h100, MouseGetPos
- return
- GuiClose:
- ExitApp
- Get_INFO:
- i := 0
- Loop
- {
- Left_Mouse := GetKeyState("LButton")
- if(Left_Mouse==False&&i==0
- i := 1
- if(Left_Mouse==True&&i==1)
- {
- break
- }
- }
- ;GuiControl,,**,%%
- ;GuiControl,,**,%%
- ;GuiControl,,**,%%
- ;GuiControl,,**,%%
- return
- Mouse_Move:
- return
- ^NumPad0::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement