Jump to content

Recommended Posts

Posted

Hi, i'm trying to get the handle of this class but without success. All others WinGetHandle are working in my code, not this one. the WinWait before WinGetHandle launched when the window is activ does not see it and wait until i close it ! The Window info from Autoit is able to see and get every information, any idea would be really appreciate.

 

image.png.7da8665a97e052e7b12187525218cfdb.png

 

 

 

 

image.png

Posted

What happens if you use windows title? Show the code you are using. It might be easier someone to help you that way. If you copy handle from AutoIt info tool are you able to get any data for window?

Posted

if i use windows title it's the same problem ! i've tried to copy the handle given by the autoit app, but the handle number is changing at every new launch of it.

Posted

What @ahmet meant is : after you launch the application and you plug the handle into your code, do you have access to the window ?

Have you tried to use WinList instead ?  Maybe there is multiple windows with the same class ?

And please show your code when you ask for help.  Here how to post code.

Posted
;===================================================================
; Callback function
;===================================================================

Func _KeyboardHook($nCode, $wParam, $lParam)

    Local $tKHS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
    Local $vkCode
    If $nCode > -1 Then
        $vkCode = DllStructGetData($tKHS, 'vkCode')

        Switch $vkCode
            Case 9
                $bVKTab = True
            Case 13
                _OnTaskViewExit()
            Case 27
                _OnTaskViewExit()
            Case 37
                $bVKLeftArrow = True
            Case 39
                $bVKRightArrow = True
            Case 91 To 92
                $bVKWin = True
            Case 162 To 163
                $bVKCtrl = True
        EndSwitch

        If $bVKWin Then
            $bVKWin = False
            If $bVKCtrl Then
                $bVKCtrl = False
                If $bVKLeftArrow Then ;Left switch
                    $bVKLeftArrow = False
                ElseIf $bVKRightArrow Then ;Right switch
                    $bVKRightArrow = False
                EndIf
            ElseIf $bVKTab Then ;Task view
                $bVKTab = False
                If Not $bTaskView Then
                    $bTaskView = True
                    WinWait("[CLASS:XamlExplorerHostIslandWindow]")
                    $hWnd = WinGetHandle("[CLASS:XamlExplorerHostIslandWindow]")
                Else
                    $bTaskView = False
                    ;_TestIfDesktopsChanged()
                EndIf
            EndIf
        EndIf

    EndIf

    Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)

EndFunc

 

Posted (edited)

Task View is launched by windows in full screen, i could get the handle but no way to use it without quit and relaunch again ( and then loose the handle ) !

WinList does not show it !!!

Edited by Syla
Posted

Interesting but if Au3Inf is seeing it you should be able to handle it.
https://learn.microsoft.com/en-us/shows/visual-studio-toolbox/xaml-islands 

Try FAQ 31 with UIAutomation 

 

Whats the output of this

Example()

Func Example()
        ; Retrieve a list of window handles.
        Local $aList = WinList()

        ; Loop through the array displaying only visable windows with a title.
        For $i = 1 To $aList[0][0]
                If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then
                        consolewrite("Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1] & @CRLF)
                         ; Retrieve the classlist of the window using the handle returned .
                        Local $sClassList = WinGetClassList($aList[$i][1])
                        consolewrite(stringreplace($sClassList,@LF,@LF & " -")& @CRLF)
                EndIf
        Next
EndFunc   ;==>Example

 

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...