Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. #NoEnv
  2. #Persistent
  3. #MaxHotkeysPerInterval, 5000
  4. #SingleInstance, force
  5. SetBatchLines, -1
  6. SendMode Input
  7. SetWinDelay, 0
  8. SetMouseDelay,0
  9. SetKeyDelay, -1
  10. CoordMode, MOUSE, Screen
  11. DetectHiddenWindows, Off
  12.  
  13. RClick = 0
  14.  
  15. Menu Tray, Icon, Imageres.dll, 106
  16. Menu, Tray, Click, 1
  17. Menu, Tray, NoStandard
  18.  
  19. Menu, Tray, Add, Quit, GuiClose
  20. Menu, Tray, Icon, Quit, Imageres.dll, 219
  21. Menu, Tray, Default, Quit
  22.  
  23. Gui, 1: +LastFound +AlwaysOnTop -caption +ToolWindow +E0x08000000
  24. Gui, 1: Margin, 0, 0
  25. Gui, 1: -dpiscale
  26. Gui, 1: Color, fdfdfd
  27.  
  28. Gui_1_ID := WinExist()
  29.  
  30. Gui, 1: Add, Picture, x0 y50 w100 h100 Icon106 vPicture2 gNextRightClick, imageres.dll
  31. Gui, 1: Add, Picture, x0 y0 w50 h50 Icon149 gMoveGui, imageres.dll
  32.  
  33. Gui, 1: Show, Autosize
  34.  
  35. WinSet, Transcolor, fdfdfd
  36.  
  37. SetTimer, Keep_On_Top, 60
  38.  
  39. Return
  40.  
  41. NextRightClick:
  42. RClick = 1
  43. Return
  44.  
  45. #If RClick = 1
  46. LButton::
  47. Click right
  48. RClick = 0
  49. Return
  50. #If
  51.  
  52.  
  53. F9::
  54. Reload
  55. Return
  56.  
  57. MoveGui:
  58. If GetKeyState("LButton","d")
  59. DragNotActivate(Gui_1_ID)
  60. Return
  61.  
  62.  
  63. ; Function by Learning one
  64. DragNotActivate(hwnd,WhileKeyDown="LButton") {
  65. CoordMode, Mouse, Screen
  66. MouseGetPos, mx,my
  67. WinGetPos, wx,wy,,, ahk_id %hwnd%
  68. offsetX := mx-wx, offsetY := my-wy
  69. owd := A_WinDelay
  70. SetWinDelay, -1
  71. While (GetKeyState(WhileKeyDown,"d")) {
  72. Sleep, 20
  73. MouseGetPos, x,y
  74. WinMove, ahk_id %hwnd%,, x-offsetX,y-offsetY
  75. }
  76. ;CoordMode, Menu, Relative
  77. SetWinDelay, %owd%
  78. }
  79.  
  80.  
  81. Keep_On_Top:
  82. WinSet, AlwaysOnTop, ON, ahk_id %Gui_1_ID%
  83. Return
  84.  
  85. GuiClose:
  86. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement