Jump to content

wingetstate question


Recommended Posts

try

$state = WinGetState ("Windows Live Messenger","")
If $state = 23 Or $state = 7 Or $state = 37 or $state = 21 Then ...

or

If WinGetState ("Windows Live Messenger","") = 23 Or WinGetState ("Windows Live Messenger","") = 7 Or WinGetState ("Windows Live Messenger","") = 37 or WinGetState ("Windows Live Messenger","") = 21 Then ...

You must use BitAND to checks values. Look at the WinGetState in the help file

Edited by jguinch
Link to comment
Share on other sites

Hi there,

Try this in the begining of your script:

Opt("WinTitleMatchMode", -1)

Cheers

Edited by November

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

 

try

$state = WinGetState ("Windows Live Messenger","")
If $state = 23 Or $state = 7 Or $state = 37 or $state = 21 Then ...

or

If WinGetState ("Windows Live Messenger","") = 23 Or WinGetState ("Windows Live Messenger","") = 7 Or WinGetState ("Windows Live Messenger","") = 37 or WinGetState ("Windows Live Messenger","") = 21 Then ...

 

didn't worker for me

i believe the problem is in the numbers but yes my condition was wrong thanks ...

 

Hi there,

Try this in the begining of your script:

Opt("WinTitleMatchMode", -1)

Cheers

also didn't worked...

Link to comment
Share on other sites

Example using bitAnd

#include <Array.au3>
Local $aWindowState_A[4]=[1,2,4,16]
Local $aWindowState_B[3]=[1,2,4]
Local $aWindowState_C[3]=[1,4,32]
Local $aWindowState_D[3]=[1,4,16]

Local $aWindowState[4]=[$aWindowState_A,$aWindowState_B,$aWindowState_C,$aWindowState_D]
$iWinState = WinGetState(HWnd("0x00000000003B103A"))
ConsoleWrite("Window state=" & $iWinState & @CRLF)
For $i = 0 To UBound($aWindowState) - 1
    $aTemp = $aWindowState[$i]
    $bMatch = True
    For $j = 0 To UBound($aTemp)-1
        If Not BitAND($iWinState, $aTemp[$j]) Then
            $bMatch = False
            ExitLoop
        EndIf
    Next
    ConsoleWrite("is state=[" & _ArrayToString($aTemp) & "]?: " & @TAB & $bMatch & @CRLF)
Next

or, this could do it...i like the granularity of the above, though.

$state = WinGetState ("Windows Live Messenger","")
Switch $state
    Case 23,7,37,21
        ;do something
EndSwitch
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...