Jump to content

Recommended Posts

Posted

How can I get the owner of a process when all I have is a handle from WinGetHandle()? Most everything I've seen has been trying to from PIDs to handles. I'm guessing that this needs to go in the opposite direction, and then take the PID and find the user... But I'm not sure how to do it. 

Posted (edited)

Hi,

Here you go:

#include <Array.au3>
#include <WinAPIEx.au3>

Run("notepad.exe")

Local $iPID = 0
Do
    $iPID = WinGetProcess("[CLASS:Notepad]")
Until $iPID > 0

Local $aUser = _WinAPI_GetProcessUser($iPID)
_ArrayDisplay($aUser)
Note: This is an example, you only need the WinGetProcess, _WinAPI_GetProcessUser functions ;)

Br, FireFox.

Edited by FireFox
Posted (edited)

yeah sure. But it was not the point.

The OP wanted to have the PID from a window handle.

Edited by FireFox

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