Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn ; Enable warnings to assist with detecting common errors.
  3. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  5. ;C:\Users\benne\Documents\Autohotkey\Lib\Class_ImageButton_1_2.ahk
  6. ;WinGetTitle, activeWindow, A
  7. ;notificationMessage := "The window """ . activeWindow . """ is now always on top."
  8. ;notificationIcon := 16 + 1 ; No notification sound (16) + Info icon (1)
  9. ;MsgBox test
  10. ;return
  11.  
  12. #SingleInstance Force
  13. #NoEnv
  14. SetWorkingDir %A_ScriptDir%
  15. SetBatchLines -1
  16.  
  17. #Include C:\Users\benne\Documents\programmering\ahk\ControlColor.ahk
  18.  
  19. Gui +hWndhMainWnd
  20. Gui Color, 0x8000FF
  21. Gui Add, ListView, x8 y8 w200 h440 vtest123 +HwndHLV, Title|Hwnd
  22. Gui Add, Button, hWndhBtnActivate x224 y77 w51 h23, Activate
  23. ControlColor(hBtnActivate, hMainWnd, 0x000000)
  24. Gui Add, Slider, hWndhSldr vopacity x208 y40 w149 h32, 0-250
  25. ControlColor(hSldr, hMainWnd, 0x000000)
  26. Gui Add, Button, hWndhBtnAppyOpacity2 grownumber x288 y77 w69 h23 gopacity, Apply opacity
  27. ControlColor(hBtnAppyOpacity2, hMainWnd, 0x000000, 0x008000)
  28. Gui Add, Button, gontop x216 y392 w72 h25 , Always on top
  29. Gui Add, Button, x296 y392 w72 h25 gGetSelection, Kill process
  30. Gui Add, ComboBox, vSearchList x216 y427 w131, ahk|Linux |Ubuntu
  31. Gui Add, Button, x216 y360 w74 h23 ggetpid, get pid
  32. Gui Add, Button, x296 y360 w74 h23 ggettitle, get title
  33. Gui Add, Button, x256 y312 w80 h23 ggetrow, get row
  34.  
  35. Gui Show, w418 h458,
  36. LoadWindows()
  37. Return
  38.  
  39. setopacity:
  40. Return
  41.  
  42. ontop:
  43. Return
  44.  
  45. GuiEscape:
  46. GuiClose:
  47. ExitApp
  48. return
  49.  
  50. rownumber:
  51. RowNumber := 0 ; This causes the first loop iteration to start the search at the top of the list.
  52. test(){
  53. RowNumber := 0
  54. RowNumber := LV_GetNext(RowNumber)
  55. return RowNumber
  56. }
  57.  
  58.  
  59. GetSelection:
  60. If !(SelectedRow := LV_GetNext()) {
  61. MsgBox, 0, %A_ThisLabel%, Select a row in the list-view, please!
  62. Return
  63. }
  64. LV_GetText(RowText, SelectedRow)
  65. MsgBox, 0, %A_ThisLabel%, Selected row: %SelectedRow%`nText: %RowText%
  66. Return
  67. ;f4::
  68. getrow:
  69. ;selectrow:
  70. kuk:= test()
  71. apa:=""
  72. apa:= LV_GetCount("S")
  73. ;LV_GetText(col2,1,2)
  74.  
  75. msgbox %kuk%
  76. return
  77. ;gethwnd:
  78. getpid:
  79. kuk:= test()
  80.  
  81. LV_GetText(outvar,kuk,2)
  82. msgbox %outvar%
  83. return
  84.  
  85. ;Gui, Add, ListView, w200 +HwndHLV, Title|Hwnd
  86. ;Gui, Add, Button, ys gActivateWin, Activate
  87.  
  88. ;Gui, Show
  89. ;return
  90.  
  91. LoadWindows() {
  92. wins := GetAllWindows()
  93. for i, hwnd in wins {
  94. WinGetTitle, title, % "ahk_id " hwnd
  95. if(title) {
  96. LV_Add(, title, hwnd)
  97. }
  98. }
  99. LV_ModifyCol(1, 110)
  100. LV_ModifyCol(2, "AutoHdr")
  101. }
  102.  
  103. ActivateWin() {
  104. LV_GetText(hwnd, LV_GetNext(), 2)
  105. WinActivate, % "ahk_id " hwnd
  106. }
  107.  
  108. GetAllWindows() {
  109. windows := []
  110. WinGet, wins, List
  111. loop % wins {
  112. windows.Push(wins%A_Index%)
  113. }
  114. return windows
  115. }
  116.  
  117. ;Gui, Submit, Nohide
  118. ;GuiControlGet var1 , , %test123%
  119. ;MsgBox %var1%
  120.  
  121.  
  122. gettitle:
  123. kuk:= test()
  124.  
  125. LV_GetText(outvar,kuk,1)
  126. msgbox %outvar%
  127. return
  128.  
  129.  
  130. opacity:
  131. kuk:= test()
  132. LV_GetText(outvar,kuk,2)
  133. WinSet,TransColor, 150 , ahk_id %outvar%
  134.  
  135.  
  136.  
  137. f7::
  138. ControlGet, OutputVar, Hwnd , , , A
  139. msgbox %OutputVar%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement