| View previous topic :: View next topic |
| Author |
Message |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun May 08, 2011 6:25 am Post subject: Process Handle from Window Handle |
|
|
There was an API to do this. I think it was introduced Vista+. I forgot it and can't find it again. It's been bugging me for a while now..
Btw I'm not referring to GetWindowThreadProcessId + OpenProcess. There was something that did both in one step :/
|
|
| Back to top |
|
 |
Mal1t1a Cheater
Reputation: 0
Joined: 03 Jan 2010 Posts: 40
|
Posted: Wed May 18, 2011 2:25 am Post subject: |
|
|
| I'm most likely wrong, but was it FindWindow or FindWindowEx?
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Wed May 18, 2011 2:35 am Post subject: |
|
|
| No that gets window handle from class name/window name. Maybe it was a dream..
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Wed May 18, 2011 3:19 am Post subject: |
|
|
| Slugsnack wrote: | | No that gets window handle from class name/window name. Maybe it was a dream.. | Dreaming of WinAPI. Poor you :p Well, I agree it's not very wise to code before going to sleep, you'll have nightmares!
Anyway, here's a list of new APIs introduced with Windows Vista: http://msdn.microsoft.com/en-us/library/aa383874.aspx. I can't really spot anything related to this imaginary function of yours. You're sure you're not mixing it with eg. GetWindowLong which can retrieve HINSTANCE (which is no process handle)? Only three ways to get a process handle come to my mind: OpenProcess, CreateProcess and GetCurrentProcess (which doesn't return a real handle, use DuplicateHandle).
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Wed May 18, 2011 9:58 am Post subject: |
|
|
Yeaaa it's sad I seem to remember dark byte posting it in a post and I looked it up and thought wow how cool. From what I recall it was just window handle >> process handle. Arghhhh
|
|
| Back to top |
|
 |
Krähne Expert Cheater
Reputation: 0
Joined: 06 Jun 2010 Posts: 108 Location: Inside of my Kernel
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun May 22, 2011 4:02 am Post subject: |
|
|
| that is not the point. that's also the wrong way to go about it. you should use getwindowthreadprocessid and then openprocess
|
|
| Back to top |
|
 |
Krähne Expert Cheater
Reputation: 0
Joined: 06 Jun 2010 Posts: 108 Location: Inside of my Kernel
|
Posted: Sun May 22, 2011 2:45 pm Post subject: |
|
|
| Slugsnack wrote: | | that is not the point. that's also the wrong way to go about it. you should use getwindowthreadprocessid and then openprocess |
Yep, i use it when the process got a visible window and is not hidden the process name.
And i had to guess it, I never should come here to annoy trying to help.
Excuse!...
_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language. |
|
| Back to top |
|
 |
Ax3l Cheater
Reputation: 1
Joined: 22 May 2011 Posts: 37
|
Posted: Sun May 22, 2011 2:48 pm Post subject: |
|
|
| Hmm good question I only know how to get the PID from the window handle
|
|
| Back to top |
|
 |
|