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 


SendMessage() API questions

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
False Prophet
Expert Cheater
Reputation: -1

Joined: 28 May 2006
Posts: 121

PostPosted: Mon Jan 04, 2010 1:57 pm    Post subject: SendMessage() API questions Reply with quote

Hi guys, how can I send a text string to a Console window without it being in focus? SendMessage() would be great if I could actually use it with console windows.
_________________
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Mon Jan 04, 2010 3:11 pm    Post subject: Reply with quote

sendmessage will send window message to the specific window
since console isn't actually a window it won't work for u
but there's other way to get the console's handle and call WriteConsole
using the handle of the console
should do the job
GetStdHandle: http://msdn.microsoft.com/en-us/library/ms683231%28VS.85%29.aspx
return the handle to the standard IO device by your request
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Mon Jan 04, 2010 3:59 pm    Post subject: Reply with quote

@Oggy

Code:

HWND Console = FindWindow(CLASSNAME, WINDOWNAME);

SendMessageA(Console, 0, 0, (LPARAM) "Your Message");

// That should do the trick
Back to top
View user's profile Send private message MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Jan 04, 2010 4:45 pm    Post subject: Reply with quote

redirect output to it and go to town?

http://msdn.microsoft.com/en-us/library/ms682075%28VS.85%29.aspx
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Mon Jan 04, 2010 7:40 pm    Post subject: Reply with quote

I have some code that pipes input and output from a console window if you are interested
Back to top
View user's profile Send private message
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