Sign in to follow this  
Followers 0
onedayillpay

WinList

4 posts in this topic

after using winlist, how can i check every tittle to see if any of these key words are listed " .com .exe .dll "

Share this post


Link to post
Share on other sites



I gather there'd be more then 1 way to do it.

Maybe could try using StringInStr() on the winlist array.

Share this post


Link to post
Share on other sites

$var = WinList()

For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
    Call("ExEcheck")
    Call("DLLcheck")
    call("COMcheck")
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

Func ExEcheck()
    ;If Tittle reads(".exe") then     <----- lol just to give you idea 
    MsgBox(0,"tittle","Exe was found")
EndFunc
Func DLLcheck()
    ;If Tittle reads(".Dll") then
    MsgBox(0,"tittle","Dll was found")
EndFunc
Func COMcheck()
    ;If Tittle reads(".COM") then
    MsgBox(0,"tittle","COM was found")
    EndFunc

as i did read the help file for StringInStr...

im not understanding the proper use of StringInStr

Share this post


Link to post
Share on other sites

Errr.... You don't have any conditions to even check if something was found to do something, you are only calling if it is visible and not an empty string (Straight out of the help file it looks like).

$var = WinList()
For $i = 1 To $var[0][0]
    If $var[$i][0] <> "" And BitAND(WinGetState($var[$i][1]), 2) Then
        If StringInStr($var[$i][0], '.exe') Then
            _ExECheck($var[$i][0], $var[$i][1])
        ElseIf StringInStr($var[$i][0], '.dll') Then
            _DLLCheck($var[$i][0], $var[$i][1])
        ElseIf StringInStr($var[$i][0], '.com') Then
            _COMCheck($var[$i][0], $var[$i][1])
        EndIf
    EndIf
Next
Func _ExECheck($sWin, $hWnd)
    ;If Tittle reads(".exe") then     <----- lol just to give you idea
    MsgBox(0, "tittle", "Exe was found" & @CR & 'WinName = ' & $sWin & @CR & 'Handle = ' & $hWnd)
EndFunc   ;==>_ExECheck
Func _DLLCheck($sWin, $hWnd)
    ;If Tittle reads(".Dll") then
    MsgBox(0, "tittle", "Dll was found" & @CR & 'WinName = ' & $sWin & @CR & 'Handle = ' & $hWnd)
EndFunc   ;==>_DLLCheck
Func _COMCheck($sWin, $hWnd)
    ;If Tittle reads(".COM") then
    MsgBox(0, "tittle", "COM was found" & @CR & 'WinName = ' & $sWin & @CR & 'Handle = ' & $hWnd)
EndFunc   ;==>_COMCheck

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0