Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows Processes
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00706360
Message ID:
00706397
Views:
26
This message has been marked as the solution to the initial question of the thread.
>Thanks Ed...
>I dont understand ... how can i do to differentiate teh owner with GetThreadDesktop, im intrested in this one becauser its easy with application.ThreadId to get the current threadid but the GetThreadDesktop returns a handle to the desktop...
>Maybe you can explain it to me a little bit more deeper...

You have an hWnd at this point; given the hWnd, you can get the owning Process information with GetWindowThreadProcessID(), and through that, then get the User via GetProcessWindowStation().

Frankly, the easiest mechanism is GetUserObjectInformation()

>
>Sorry about my poor english
>
>
>------------------------------------------------
>>Hi,
>>Im trying to check for a process running in one machine with api calls, all works fine but the problem rises when i try to get the processes only for the current user not for all the logged in...
>>Does anybody knows how to differentiate between?
>
>
>Given a Process handle, you could use GetUserObjectInformation() or GetUserObjectSecurity() or given a threadID, you could use GetThreadDesktop() to differentiate the owner of a given process.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform