Sign in to follow this  
Followers 0
erezlevi

geting process ID window to come up?

2 posts in this topic

hi,

I have a process called: "sametime75.exe", now I know its PID using :

#include <Array.au3>

$m=ProcessList ()
;$n=number($m)
;MsgBox (0,"$m",$n)
_ArrayDisplay ($m)

but, how do I make it to bring its window up? it is minimized to the Tray and I don't have an active window.

Share this post


Link to post
Share on other sites



You could try finding the classname of the window with the autoit window info tool, OR, you could modify this script to your liking:

#include <winapi.au3>

$ExplorerWindows = _ProcessGetWin("explorer.exe")
For $i = 1 To $ExplorerWindows[0]
    MsgBox(0, "Exploder Window #" & $i & "/" & $ExplorerWindows[0], "Title: " & WinGetTitle($ExplorerWindows[$i]) & " Class: " & _WinAPI_GetClassName($ExplorerWindows[$i]))
Next

Func _ProcessGetWin($ivPid)
    
    $ivPid = ProcessExists($ivPid)
    If Not $ivPid Then Return(SetError(1, 0, 0))
    
    Local $avwArray = WinList()
    Local $avRet[1] = [0]
    
    For $i = 1 To $avwArray[0][0]
        If WinGetProcess($avwArray[$i][1]) = $ivPid Then
            $avRet[0] += 1
            ReDim $avRet[$avRet[0]+1]
            $avRet[$avRet[0]] = $avwArray[$i][1]
        EndIf
    Next
    
    Return $avRet
    
EndFunc

After you have the handle of the window, you can just use WinSetState on it

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  
Followers 0