Advertisement
CivReborn

AutoHotKey Commands Tutorial #2: MouseGetPos

Jan 29th, 2017
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. ;AutoHotKey Commands Tutorial #2: MouseGetPos
  2. ;Written By: CivReborn
  3. ;YouTube Page: https://www.youtube.com/channel/UCge0TKjySLXd8xeLib8F0rA
  4. ;Date: Jan 29th, 2017
  5. ;MouseGetPos, [OutputVarX, OutputVarY, OutputVarWin, OutputVarControl, 1|2|3]
  6. /*
  7. 1: Uses a simpler method to determine OutputVarControl.
  8. This method correctly retrieves the active/topmost child window of an Multiple Document Interface (MDI) application such as SysEdit or TextPad. However,
  9. it is less accurate for other purposes such as detecting controls inside a GroupBox control.
  10.  
  11.  
  12. 2 [v1.0.43.06+]: Stores the control's HWND in OutputVarControl rather than the control's ClassNN.
  13.  
  14.  
  15. 3 [v1.0.43.06+]: A combination of 1 and 2 above.
  16. */
  17. #SingleInstance, Force
  18. CoordMode, Mouse, Screen
  19. Gui, Font, cAqua
  20. Gui, Add, Text, x10 y10,X =
  21. Gui, Add, Edit,cBlack x+10 w100 h15
  22. Gui, Add, Text, x+10,Y =
  23. Gui, Add, Edit,cBlack x+10 w100 h15
  24. Gui, Add, Text, x10, Window ID:
  25. Gui, Add, Edit,cBlack x+10 w220 h15
  26. Gui, Add, Text, x10, Control ID:
  27. Gui, Add, Edit,cBlack x+10 w220 h15
  28. Gui, Add, Button,x10 y75 w135 h20 gGet_INFO,GET INFO
  29. Gui, Add, Button,x+10 y75 w135 h20 gMouse_Move,Mouse Move
  30. Gui, Color, Black
  31. Gui, +AlwaysOnTop
  32. Gui, Show, w300 h100, MouseGetPos
  33. return
  34. GuiClose:
  35. ExitApp
  36. Get_INFO:
  37. i := 0
  38. Loop
  39. {
  40. Left_Mouse := GetKeyState("LButton")
  41. if(Left_Mouse==False&&i==0
  42. i := 1
  43. if(Left_Mouse==True&&i==1)
  44. {
  45.  
  46. break
  47. }
  48. }
  49. ;GuiControl,,**,%%
  50. ;GuiControl,,**,%%
  51. ;GuiControl,,**,%%
  52. ;GuiControl,,**,%%
  53. return
  54. Mouse_Move:
  55. return
  56. ^NumPad0::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement