Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ;C:\Users\benne\Documents\Autohotkey\Lib\Class_ImageButton_1_2.ahk
- ;WinGetTitle, activeWindow, A
- ;notificationMessage := "The window """ . activeWindow . """ is now always on top."
- ;notificationIcon := 16 + 1 ; No notification sound (16) + Info icon (1)
- ;MsgBox test
- ;return
- #SingleInstance Force
- #NoEnv
- SetWorkingDir %A_ScriptDir%
- SetBatchLines -1
- #Include C:\Users\benne\Documents\programmering\ahk\ControlColor.ahk
- Gui +hWndhMainWnd
- Gui Color, 0x8000FF
- Gui Add, ListView, x8 y8 w200 h440 vtest123 +HwndHLV, Title|Hwnd
- Gui Add, Button, hWndhBtnActivate x224 y77 w51 h23, Activate
- ControlColor(hBtnActivate, hMainWnd, 0x000000)
- Gui Add, Slider, hWndhSldr vopacity x208 y40 w149 h32, 0-250
- ControlColor(hSldr, hMainWnd, 0x000000)
- Gui Add, Button, hWndhBtnAppyOpacity2 grownumber x288 y77 w69 h23 gopacity, Apply opacity
- ControlColor(hBtnAppyOpacity2, hMainWnd, 0x000000, 0x008000)
- Gui Add, Button, gontop x216 y392 w72 h25 , Always on top
- Gui Add, Button, x296 y392 w72 h25 gGetSelection, Kill process
- Gui Add, ComboBox, vSearchList x216 y427 w131, ahk|Linux |Ubuntu
- Gui Add, Button, x216 y360 w74 h23 ggetpid, get pid
- Gui Add, Button, x296 y360 w74 h23 ggettitle, get title
- Gui Add, Button, x256 y312 w80 h23 ggetrow, get row
- Gui Show, w418 h458,
- LoadWindows()
- Return
- setopacity:
- Return
- ontop:
- Return
- GuiEscape:
- GuiClose:
- ExitApp
- return
- rownumber:
- RowNumber := 0 ; This causes the first loop iteration to start the search at the top of the list.
- test(){
- RowNumber := 0
- RowNumber := LV_GetNext(RowNumber)
- return RowNumber
- }
- GetSelection:
- If !(SelectedRow := LV_GetNext()) {
- MsgBox, 0, %A_ThisLabel%, Select a row in the list-view, please!
- Return
- }
- LV_GetText(RowText, SelectedRow)
- MsgBox, 0, %A_ThisLabel%, Selected row: %SelectedRow%`nText: %RowText%
- Return
- ;f4::
- getrow:
- ;selectrow:
- kuk:= test()
- apa:=""
- apa:= LV_GetCount("S")
- ;LV_GetText(col2,1,2)
- msgbox %kuk%
- return
- ;gethwnd:
- getpid:
- kuk:= test()
- LV_GetText(outvar,kuk,2)
- msgbox %outvar%
- return
- ;Gui, Add, ListView, w200 +HwndHLV, Title|Hwnd
- ;Gui, Add, Button, ys gActivateWin, Activate
- ;Gui, Show
- ;return
- LoadWindows() {
- wins := GetAllWindows()
- for i, hwnd in wins {
- WinGetTitle, title, % "ahk_id " hwnd
- if(title) {
- LV_Add(, title, hwnd)
- }
- }
- LV_ModifyCol(1, 110)
- LV_ModifyCol(2, "AutoHdr")
- }
- ActivateWin() {
- LV_GetText(hwnd, LV_GetNext(), 2)
- WinActivate, % "ahk_id " hwnd
- }
- GetAllWindows() {
- windows := []
- WinGet, wins, List
- loop % wins {
- windows.Push(wins%A_Index%)
- }
- return windows
- }
- ;Gui, Submit, Nohide
- ;GuiControlGet var1 , , %test123%
- ;MsgBox %var1%
- gettitle:
- kuk:= test()
- LV_GetText(outvar,kuk,1)
- msgbox %outvar%
- return
- opacity:
- kuk:= test()
- LV_GetText(outvar,kuk,2)
- WinSet,TransColor, 150 , ahk_id %outvar%
- f7::
- ControlGet, OutputVar, Hwnd , , , A
- msgbox %OutputVar%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement