PDA

View Full Version : HideSimu



Renian
08-18-2009, 12:24 PM
So I was messing around with AutoIt today, trying to learn it, and made a small little program that hides your Stormfront/Wizard windows when you hit Ctrl+Alt+D, and unhides them if you hit it again. Ctrl+Alt+Q closes the script.

OPEN SOURCE BITCHES
hidesimu.au3


#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=hidesimu.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Opt("WinTitleMatchMode", 2)
HotKeySet("^!d", "WindowManip")
HotKeySet("^!q", "Quit")
HotKeySet("^!m", "ShowState")
While True
Sleep(100)
WEnd

Func WindowManip()
$windowarray = WinList("The Wizard")
$windowarray2 = WinList("StormFront")
For $i = 1 TO $windowarray[0][0] Step 1
;MsgBox(0, "lol", $windowarray[$i][0])
;MsgBox(0, $i, WinGetState($windowarray[$i][0]))
If WinGetState($windowarray[$i][0]) = 7 Or WinGetState($windowarray[$i][0]) = 15 Then
WinSetState($windowarray[$i][0], "", @SW_HIDE)
ElseIf WinGetState($windowarray[$i][0]) = 5 Or WinGetState($windowarray[$i][0]) = 13 Then
WinSetState($windowarray[$i][0], "", @SW_SHOW)
EndIf
Next
For $i = 1 TO $windowarray2[0][0] Step 1
;MsgBox(0, "lol", $windowarray[$i][0])
;MsgBox(0, $i, WinGetState($windowarray[$i][0]))
If WinGetState($windowarray2[$i][0]) = 7 Or WinGetState($windowarray[$i][0]) = 15 Then
WinSetState($windowarray2[$i][0], "", @SW_HIDE)
ElseIf WinGetState($windowarray2[$i][0]) = 5 Or WinGetState($windowarray[$i][0]) = 13 Then
WinSetState($windowarray2[$i][0], "", @SW_SHOW)
EndIf
Next
EndFunc

Func ShowState()
$windowarray = WinList("The Wizard")
$windowarray2 = WinList("StormFront")
For $i = 1 TO $windowarray[0][0] Step 1
MsgBox(0, "Wizard Window " + $i, WinGetState($windowarray[$i][0]))
Next
For $i = 1 TO $windowarray2[0][0] Step 1
MsgBox(0, "StormfrontWindow " + $i, WinGetState($windowarray2[$i][0]))
Next
EndFunc

Func Quit()
MsgBox(0, "Script Closing", "Now closing script.")
Exit 0
EndFunc


Also compiled script so you don't need AutoIt attached. It's disturbingly large for the amount of code I made.

Drunken Durfin
08-18-2009, 12:46 PM
Interesting, I had never heard of AutoIT until this posting. Looks neat.

Donquix
08-18-2009, 12:59 PM
I've used autoit before, it's pretty handy. Simple scripting language you can compile. It's really good at emulating keyboard/mouse commands, which is why it's so popular with the MMO scripting crowds.

The last thing I used it for was at work...i made a quick user interface that has all of our programs we might have to install on a computer listed (office, sql, etc.) click the program name, it waits 5 seconds and then just types serial number. :)

quick and dirty but a lot easier than starring at the sheet and typing a B as an 8, or alt tabbing 10 times from a notepad file with the serial number to paste every set of numbers.

Renian
08-18-2009, 01:31 PM
I just fixed a bug that made it so it wasn't hiding/unhiding selected windows. Updated.