Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <ListViewConstants.au3>
- #include <WindowsConstants.au3>
- #include <GUIListBox.au3>
- Opt("GUIOnEventMode", 1)
- Opt("TrayMenuMode", 3)
- Opt("TrayOnEventMode", 1)
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("iBot Window Manager", 347, 249, 302, 218)
- $MenuItem1 = GUICtrlCreateMenu("File")
- $exit = GUICtrlCreateMenuItem("Exit", $MenuItem1)
- $MenuItem3 = GUICtrlCreateMenu("Help")
- $about = GUICtrlCreateMenuItem("About", $MenuItem3)
- GUICtrlSetOnEvent(-1, "About")
- GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
- GUISetOnEvent($GUI_EVENT_MINIMIZE, "_Hide")
- $List = GUICtrlCreateList("", 8, 8, 225, 209)
- $ListView1context = GUICtrlCreateContextMenu($List)
- $MenuItem2 = GUICtrlCreateMenuItem("Refresh", $ListView1context)
- $Button1 = GUICtrlCreateButton("Hide", 240, 8, 97, 25, $WS_GROUP)
- GUICtrlSetOnEvent(-1, "Hide")
- $Button2 = GUICtrlCreateButton("Show", 240, 48, 97, 25, $WS_GROUP)
- GUICtrlSetOnEvent(-1, "Show")
- $Button3 = GUICtrlCreateButton("Kill", 240, 96, 97, 25, $WS_GROUP)
- GUICtrlSetBkColor(-1, 0xFF0000)
- GUICtrlSetOnEvent($Button3, "Kill")
- GUICtrlSetOnEvent($exit, "_Exit")
- GUICtrlSetOnEvent($MenuItem2, "GetWindows")
- TraySetOnEvent(-13, "_Tray")
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- GetWindows()
- While 1
- Sleep(100) ; to keep the program running :)
- WEnd
- Func About()
- MsgBox(0, "iBot Window Manager", "Created by NoN_Stop")
- EndFunc ;==>About
- Func _Exit()
- Exit
- EndFunc ;==>_Exit
- Func _Hide()
- If BitAND(WinGetState($Form1), 1) Or Not BitAND(WinGetState($Form1), 16) Then
- WinSetState($Form1, "", @SW_HIDE)
- EndIf
- EndFunc ;==>_Hide
- Func _Tray()
- If BitAND(WinGetState($Form1), 1) Or Not BitAND(WinGetState($Form1), 16) And BitAND(WinGetState($Form1), 2) Then
- WinSetState($Form1, '', @SW_HIDE)
- Else
- WinSetState($Form1, '', @SW_SHOW)
- EndIf
- EndFunc ;==>_Tray
- Func GetWindows()
- Local $win
- $win = WinList("[CLASS:CLIENT]")
- For $i = 1 To $win[0][0]
- If $win[$i][0] <> "" Then
- _GUICtrlListBox_AddString($List, $win[$i][0])
- EndIf
- Next ; gets sro_client windows
- $win = WinList("[CLASS:ThunderRT6FormDC]")
- For $i = 1 To $win[0][0]
- If $win[$i][0] <> "" Then
- If StringInStr($win[$i][0], "iB0t") And Not StringInStr($win[$i][0], "Forgotten") Then
- _GUICtrlListBox_AddString($List, $win[$i][0])
- EndIf
- EndIf
- Next ; gets iBot windows
- $win = WinList("[CLASS:ConsoleWindowClass]")
- For $i = 1 To $win[0][0]
- If $win[$i][0] <> "" Then
- If StringInStr($win[$i][0], "HACK") Then
- _GUICtrlListBox_AddString($List, $win[$i][0])
- EndIf
- EndIf
- Next ; gets
- EndFunc ;==>GetWindows
- Func Hide()
- $read = GUICtrlRead($List)
- If $read <> "" Then
- $handle = WinGetHandle($read)
- WinSetState($handle, '', @SW_HIDE)
- EndIf
- EndFunc ;==>Hide
- Func Kill()
- $read = GUICtrlRead($List)
- If $read <> "" Then ; checks if selected any window
- $handle = WinGetHandle($read)
- WinKill($handle)
- $index = _GUICtrlListBox_FindString($List, $read) ; gets the number of the selected window
- _GUICtrlListBox_DeleteString($List, $index) ;deletes the selected window
- EndIf
- EndFunc ;==>Kill
- Func Show()
- $read = GUICtrlRead($List)
- If $read <> "" Then
- $handle = WinGetHandle($read)
- WinSetState($handle, '', @SW_SHOW)
- EndIf
- EndFunc ;==>Show
Advertisement
Add Comment
Please, Sign In to add comment