Jump to content

Recommended Posts

Hello when I send this script it doesn't react I think it's because of this character # but I don't know how to do it thank you for your help


if WinActive ("[CLASS:ad_win#2]", "") Then MsgBox($MB_SYSTEMMODAL, "test", "Is Active.", 10)

Link to post
Share on other sites

 

This works

Local $hWnd = WinGetHandle("[title:AnyDesk]")
$a=_WinAPI_GetClassName($hwnd)
If WinActive("[CLASS:"& $a &"]") Then MsgBox(0, "test", "Is Active.", 10)

But this is not working
 

 Local $hWnd = WinGetHandle("[title:AnyDesk]")
 $a=_WinAPI_GetClassName($hwnd)
 
IniWrite ( @ScriptDir & "\screen.ini", "Capture", "x1",$a)
$m=IniRead ( @ScriptDir & "\screen.ini", "Capture", "x1", "")
If WinActive("[CLASS:"& $m &"]") Then MsgBox(0, "test", "Is Active.", 10)

I did not solve my problem

Link to post
Share on other sites

Probably not exactly what you need. However, this should get you on the right path at the very least. 

$Title = "AnyDesk"
$ListAnyDesk = WinList($Title)

For $i = 1 To $ListAnyDesk[0][0]
    $hwnd = $ListAnyDesk[$i][1]
    If $hwnd = WinActivate($Title) Then
        ControlClick($hwnd, "", "basic_button#91")
    EndIf
Next

 

Life's simple. You make choices and you don't look back.

Link to post
Share on other sites
#include <Array.au3>
#include <WinAPIDlg.au3>
#include <MsgBoxConstants.au3>

Local $WinTitle ="[REGEXPCLASS:ad_win#3]" ;

$aInfo = _CtrlInfo($WinTitle) ; Sort Array method

WinActivate("[REGEXPCLASS:ad_win#3]")
$a=$aInfo[27][0]

$hnd="[REGEXPCLASS:ad_win#3]"
ControlEnable ($hnd, "",$a)
MsgBox($MB_TOPMOST, $aInfo[27][0], $a, 30)
_ArrayDisplay($aInfo, "ArrayDisplay", "", 0, 8, "ClassnameNN")


Func _CtrlInfo($WinTitle)
    Local $iCount = 0
   $class = StringStripWS(WinGetClassList($WinTitle, ""), 2) ;   $STR_STRIPTRAILING (2) = strip trailing white space
   $aClass = StringSplit($class, @LF, 2) ; $STR_NOCOUNT (2) = disable the return count in the first element - effectively makes the array 0-based.
   Local $aArray[UBound($aClass)][1] ; New 2D array.

     _ArraySort($aClass)
    For $i = 0 To UBound($aClass) - 1
        $iCount = (($i = 0 Or $aClass[$i] == $aClass[$i - 1]) ? $iCount + 1 : 1)
        $aArray[$i][0] = $aClass[$i] & $iCount                            ; ClassnameNN

      Next
    Return $aArray
EndFunc   ;==>_CtrlInfo

It chooses the ClassnameNN but it still doesn't work

Edited by Gavriels
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...