Jump to content

Cannot handle this class : XamlExplorerHostIslandWindow ! it is the Windows 11 Task view !


Go to solution Solved by Syla,

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

 

Posted (edited)

console write is doing strange things actually in my side but if i print an array of classes + msgboxes of getting classes list of them, here is what i get: 2 msgbox were empty (no class list i guess)

i've tried to look at the handle i've got from The Window info from Autoit ( launched in the same time ), even in the all winlist results, ( not visible ). No way, i cannot find it.

 

Sans titre 2.png

Sans titre.png

Edited by Syla
Posted (edited)

Just to add a bit of context to this -  XAML Islands are a way to embed UWP controls in a win32 app.

So its possible we're just seeing a container, and not necessarily something that we can interact with in a traditional way.
I would like to be proven wrong though!

Edit: sorry - should've read the thread a bit closer, junkew's beaten me to it!

Edited by MattyD
Posted

i'm sorry but even after read it, i don't really understand how i could use UIAutomation to handle a window... could you help me a little more please ? 🙃

  • Solution
Posted

Ok Guys, I found something who can give me what i want: 

WinGetTitle("[active]")

it gives me the title of the task view and i can test it to know when it's closed.

Thanks for you help

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