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 


Get hWnd of self C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Thu Jan 29, 2009 6:10 pm    Post subject: Get hWnd of self C++ Reply with quote

So then I want to get the hWnd of the main program aka the program I'm running.

Any ideas? thanks

oh, in C++ native. thanks!

_________________
Back to top
View user's profile Send private message AIM Address
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Jan 29, 2009 6:12 pm    Post subject: Reply with quote

Well if you're using a Dialog, or a window created by CreateWindowEx (After registering a class via RegisterClassEx) you should have a Windows Procedure that contains the hWnd, and if you used CreateWindowEx you should have the return of that, and not only that you'll already know the class name and such seeing as you registered the class, meaning you can just use FindWindow
_________________
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Thu Jan 29, 2009 6:20 pm    Post subject: Reply with quote

ahh i'm using console, but the title name is always my location of where the program is, so i want like the output hwnd. thanks!
_________________
Back to top
View user's profile Send private message AIM Address
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Thu Jan 29, 2009 6:42 pm    Post subject: Reply with quote

Quote:
GetStdHandle()

I'm assuming this is what you mean by "output handle".

_________________
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Thu Jan 29, 2009 7:22 pm    Post subject: Reply with quote

yea, i know std_output_handle, but that's a handle. unless there's a way to convert it to a hwnd, i need it as a hwnd because i'm using SetWindowText(*hwnd here*, (LPCSTR) "blabla");
_________________
Back to top
View user's profile Send private message AIM Address
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Jan 29, 2009 7:49 pm    Post subject: Reply with quote

SetConsoleTitle
_________________
Back to top
View user's profile Send private message
BirdsEye
Advanced Cheater
Reputation: 0

Joined: 05 Apr 2008
Posts: 94

PostPosted: Thu Jan 29, 2009 9:04 pm    Post subject: Reply with quote

lurc wrote:
SetConsoleTitle


Or you could just provide GetConsoleTitle to FindWindow
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Jan 29, 2009 10:02 pm    Post subject: Reply with quote

But he's trying to change the text of the console window anyways.... so why go to the trouble of getting the current title, using FindWindow, and then SetWindowText...
_________________
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Thu Jan 29, 2009 10:28 pm    Post subject: Reply with quote

oh.... ;-; i'm retarded. THANKS GUISE I +REP YOU GUISE BOTH!
_________________
Back to top
View user's profile Send private message AIM Address
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