Jump to content

Recommended Posts

Posted

I know that pid is X now how I get it's window name? for example notepad's pid is 1000 but it don't know it's window title, now how I get window title if i know only that pid is 1000?

edited

Posted

Use WinList and then WinGetProcess in a loop!

GUICreate ("A success!!")

$ret = _ProcessGetWindow (@AutoitPID)

MsgBox (0, "The test was...", $ret)

Func _ProcessGetWindow ($nPid)
   Local $aList = WinList ()

   For $i = 1 to $aList[0][0]
      If winGetProcess ($aList[$i][1]) = $nPid Then Return $aList[$i][0]
   Next
   Return SetError (1, 0, "")
EndFunc ; ==> _ProcessGetWindow

Here we know that the GUI's PID will be autoit, so we test for that.

Mat

Posted (edited)

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