AutoIT - WinList

12/24/2010 23:49 blackeagle93#1
Hello, I am making a program, which can detect mBot (SRO Bot) and then Hide it. I got the CLASS of the mBot window so a part of the code looks like this:
Code:
Func _RefreshBot()
    _GUICtrlListView_BeginUpdate($listviewmBot)
    _GUICtrlListView_DeleteAllItems($listviewmBot)
    $Client = WinList ("[CLASS:#32770]")
    If $Client[0][0] > 0 Then
        For $X = 1 To $Client[0][0]
            GUICtrlCreateListViewItem($Client[$X][0], $listviewmBot)
        Next
    Else
        GUICtrlCreateListViewItem("No Bots Found", $listviewmBot)
    EndIf
    _GUICtrlListView_EndUpdate($listviewmBot)
EndFunc
but
when I launch the script, it shows me all programs with CLASS:#32770...Is there any way to specify that I want to see only mBot windows?
I hope you understand what i want to do...If not, ask me, I can add screens...
Thanks in advance
12/25/2010 00:12 blackeagle93#2
oh, wrong section? sry then, where should I place it?

and i dont list windows with mbot name coz the title of the bot is: [X] mBot vY (ZSRO)
X=character name
Y=bot version
Z=silkroad version
12/25/2010 00:17 ZeraPain#3
we got an autoit section here..
[Only registered and activated users can see links. Click Here To Register...]


Code:
$windows = WinList()
For $i = 1 To $windows[0][0]
	If StringRegExp($windows[$i][0], "mBot") = 1 Then
		MsgBox(0,0,$windows[$i][0])
	EndIf
Next
12/25/2010 00:44 blackeagle93#4
thanks, but I am a newbie and dont rly know how to get it work that the mbot window appears in the GUI WinList...can send u the source by PM
12/25/2010 01:53 ZeraPain#5
instead of the msgbox create a listview item.
12/25/2010 10:59 blackeagle93#6
Code:
Func _RefreshBot()
    _GUICtrlListView_BeginUpdate($listviewmBot)
    _GUICtrlListView_DeleteAllItems($listviewmBot)
    $windows = WinList()
For $i = 1 To $windows[0][0]
	If StringRegExp($windows[$i][0], "mBot") = 1 Then
		GUICtrlCreateListViewItem($windows[$i][0], $listviewmBot)
	EndIf
Next
EndFunc
like this? it doesnt show the bot windows in the list
12/25/2010 11:22 mipez#7
Quote:
Originally Posted by blackeagle93 View Post
Code:
Func _RefreshBot()
    _GUICtrlListView_BeginUpdate($listviewmBot)
    _GUICtrlListView_DeleteAllItems($listviewmBot)
    $windows = WinList()
For $i = 1 To $windows[0][0]
	If StringRegExp($windows[$i][0], "mBot") = 1 Then
		GUICtrlCreateListViewItem($windows[$i][0], $listviewmBot)
	EndIf
Next
EndFunc
like this? it doesnt show the bot windows in the list
There you go:
Code:
$win = WinList()
			GUICtrlSetData($List1,"")
			For $i = 1 To $win[0][0]
				If $win[$i][0] <> "" AND $win[$i][0] <> "Program Manager" AND $win[$i][0] <>  "Start" AND _WinAPI_IsWindowVisible($win[$i][1]) Then 
					GUICtrlSetData($List1,$win[$i][0],"")
				EndIf
			Next
12/25/2010 11:47 blackeagle93#8
^I do not understand your code

btw is there any way to minimize the AutoIT program to the bar next to the clock?
pardon the language :X:X
12/25/2010 12:06 KDeluxe#9
AFAIK this should work:
Code:
Func _RefreshBot()
    _GUICtrlListView_BeginUpdate($listviewmBot)
    _GUICtrlListView_DeleteAllItems($listviewmBot)
    $Client = WinList("[CLASS:#32770[COLOR="Red"];TITLE:mBot[/COLOR]]")
    If $Client[0][0] > 0 Then
        For $X = 1 To $Client[0][0]
            GUICtrlCreateListViewItem($Client[$X][0], $listviewmBot)
        Next
    Else
        GUICtrlCreateListViewItem("No Bots Found", $listviewmBot)
    EndIf
    _GUICtrlListView_EndUpdate($listviewmBot)
EndFunc
12/25/2010 12:24 blackeagle93#10
ok so, i made it...mostly
ty all for your help
big thanks to mipez