Jump to content
Mateo

ApplicationFrameHost.exe - getting the real app

Recommended Posts

Hi,

Continuing with my previous questions, I try to get information about all the open windows, and I have a problem, applications like "Settings", "Music", "Calculator" and the like are displayed to me as ApplicationFrameHost.exe.

Anyone have any idea how I find the real app he wanted? (I want to get the real list of apps, as it appears in the task manager (under "Apps"))

(I tried to search a bit in forums that are not necessarily autoit's and could not find anything)

thank you all ūüėÉ!

 

Share this post


Link to post
Share on other sites
1 hour ago, Mateo said:

Continuing with my previous questions,

Please explain for people that are not aware of the first question. 

From what I  understand maybe the next functions will help you : 

WinList ()
WinExists ()

 


My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Sorry, I'm really sorry I did not explain myself properly.

I meant this post (which is not what I asked for in the post, but the code appears in the post), where I try to take out the list of windows visible to the user (as it appears in the "Apps" task manager)

Share this post


Link to post
Share on other sites

What code are you using to obtain such a result ?

Share this post


Link to post
Share on other sites
On 1/6/2021 at 2:50 PM, Nine said:

What code are you using to obtain such a result ?

Sorry for the late response, but I did not understand your question

Share this post


Link to post
Share on other sites

But by and large, regardless of my code, I just want to know what window is currently in focus for the user, and if it is one of the Windows applications (settings, calculator, weather, etc.) then the resulting process is ApplicationFrameHost.exe.

I'm trying to find a workaround to know what the process really is running ... (maybe try to figure out how Windows manages it, because when it displays the list of "applications" that run (within the task manager) it displays them correctly, without ApplicationFrameHost.exe).

Share this post


Link to post
Share on other sites

WinList does not give you the name of the process.

So I repeat, show me the code that gives you the name of the process instead of the title of the window

Share this post


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

Local $aPrograms[0][2]
Local $aWinList = WinList()
For $i = 1 To $aWinList[0][0]
  If $aWinList[$i][0] <> "" And BitAND(WinGetState($aWinList[$i][1]), 2) Then
    ReDim $aPrograms[UBound($aPrograms) + 1][2]
    $aPrograms[UBound($aPrograms)-1][0] = $aWinList[$i][0]
    $aPrograms[UBound($aPrograms)-1][1] = _ProcessGetName(WinGetProcess($aWinList[$i][1])) ;here
  EndIf
Next
_ArrayDisplay($aPrograms)

 

Share this post


Link to post
Share on other sites

So why do you change window's title (because this is what you want) to the unwanted process name ?

Share this post


Link to post
Share on other sites

I did not understand?
I do not change any process name, just when I check what process is now in focus and open one of the Windows apps then it is displayed as "ApplicationFrameHost.exe".

Local $sName = _ProcessGetName(WinGetProcess("[ACTIVE]"))
; ==> $sName = "ApplicationFrameHost.exe"

 

Share this post


Link to post
Share on other sites

Sorry, I misread the code.  You are replacing window handle with process name.  Fine.  But why window title is not enough for you ?  You know that the window is Calculator or other tool.  i do not understand what you need more.

Ok maybe this is what you are looking for :

#include <Array.au3>
#include <Process.au3>

Local $aPrograms[0][3]
Local $aWinList = WinList()
For $i = 1 To $aWinList[0][0]
  If $aWinList[$i][0] <> "" And BitAND(WinGetState($aWinList[$i][1]), 2) Then
    ReDim $aPrograms[UBound($aPrograms) + 1][3]
    $aPrograms[UBound($aPrograms)-1][0] = $aWinList[$i][0]
    $aPrograms[UBound($aPrograms)-1][1] = $aWinList[$i][1]
    $aPrograms[UBound($aPrograms)-1][2] = _ProcessGetName(WinGetProcess($aWinList[$i][1]))
  EndIf
Next
_ArrayDisplay($aPrograms)

$hWnd = WinGetHandle("[ACTIVE]")
ConsoleWrite ($hWnd & @CRLF)
Local $ind = _ArraySearch($aPrograms, $hWnd, Default, Default, Default, 2, Default, 1)
If Not @error Then MsgBox ($MB_SYSTEMMODAL,"","You are running " & $aPrograms[$ind][0])

 

Edited by Nine

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...