Jump to content
Sign in to follow this  

find what applications are open?

Recommended Posts


Heyo all!

I'm trying to work on a context sensitive virtual toolbar of hotkeys for many different apps.

I have little snippets and tests here and there but a few things have been confusing me early on

one is how I can find what applications are open at the moment, or what windows belong to what applications even :P

any help is greatly appreciated! :unsure:

Edited by FunkyBunnies

Share this post

Link to post
Share on other sites

Haven't tried, but looked promising... You might have to read to the end?



Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post

Link to post
Share on other sites

Try this........... I didn't make it, I got it off the forum somewhere and tweaked. You have window name and class of each window. Combine the two and you can associate the window a specific program.

#include <Array.au3>

#include <Winapi.au3>

Global $aWinList, $aRetWinList

$sExclude_List = "Start[CL:102939]|Start|Desktop|Start Menu[CL:102938]|desktop[CL:102937]|Program Manager"

$aWinList = _WinListEx(Default, Default, $sExclude_List)


Func _WinListEx($sTitle="", $sText="", $sExclude_List="")

$sExclude_List = "|" & $sExclude_List & "|"

If $sTitle = -1 Or (IsKeyword($sTitle) And $sTitle = Default) Then

$aWinList = WinList()


$aWinList = WinList($sTitle, $sText)


Dim $aRetWinList[$aWinList[0][0]][6]

For $i = 1 To $aWinList[0][0]

;Only display visible windows that have a title

If $aWinList[$i][0] = "" Or Not BitAND(WinGetState($aWinList[$i][1]), 2) Then ContinueLoop

;Add to array all win titles that is not in the exclude list

If Not StringInStr($sExclude_List, "|" & $aWinList[$i][0] & "|") Then

$aRetWinList[0][1] += 1

$aRetWinList[$aRetWinList[0][1]][0] = $aWinList[$i][0]

$aRetWinList[$aRetWinList[0][1]][1] = $aWinList[$i][1]

$classed = _WinAPI_GetClassName($aWinList[$i][1])

$aRetWinList[$aRetWinList[0][1]][2] = "[CLASS:"&$classed&"]"



ReDim $aRetWinList[$i][6]

Return $aRetWinList


Share this post

Link to post
Share on other sites

Awesome, thank you both a ton :P

after looking into this, I'm not sure I can get the information I need out of the Class of the window.

If I can bother you with more questions, is there any way to find the executable associated with a window or even to list what .exe's are running?

Share this post

Link to post
Share on other sites

WinGetProcess(). For a list of exe's running, PRocessList(). It's all there in the Help file

*sorry, should have noted - you can combine both to find the exe *name* (first gets the PID, 2nd gets a list of names with PIDs)

Edited by ascendant

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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.