Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Process Handle from Window Handle

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun May 08, 2011 6:25 am    Post subject: Process Handle from Window Handle Reply with quote

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
View user's profile Send private message
Mal1t1a
Cheater
Reputation: 0

Joined: 03 Jan 2010
Posts: 40

PostPosted: Wed May 18, 2011 2:25 am    Post subject: Reply with quote

I'm most likely wrong, but was it FindWindow or FindWindowEx?
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed May 18, 2011 2:35 am    Post subject: Reply with quote

No that gets window handle from class name/window name. Maybe it was a dream..
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Wed May 18, 2011 3:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed May 18, 2011 9:58 am    Post subject: Reply with quote

Yeaaa it's sad 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 Sad
Back to top
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Sun May 22, 2011 3:14 am    Post subject: Reply with quote

So... why do you not make a function for get it?

I mean, make a loop for get process info (one by one (obvius lol)) and... check if got the window handle.

I guess you had already thought it, but... it's never too late. Embarassed

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun May 22, 2011 4:02 am    Post subject: Reply with quote

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
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Sun May 22, 2011 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Ax3l
Cheater
Reputation: 1

Joined: 22 May 2011
Posts: 37

PostPosted: Sun May 22, 2011 2:48 pm    Post subject: Reply with quote

Hmm good question I only know how to get the PID from the window handle
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites