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 


bounding console windows to a dialog

 
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: Tue Jul 14, 2009 3:31 pm    Post subject: bounding console windows to a dialog Reply with quote

if i have a main dialog and i want to force multiple console windows inside it how would i go about doing that ?

to explain properly, i want to bind multiple consoles within the same place in a main window ( which i create ) then i can use tab controls to switch between the different consoles
Back to top
View user's profile Send private message
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Tue Jul 14, 2009 5:43 pm    Post subject: Reply with quote

Do you mean using AllocConsole() to make new consoles, then using GetStdHandle() to get a handle to all of them?
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Jul 15, 2009 5:59 am    Post subject: Reply with quote

pretend i just opened up 2 instances of command prompt ( cmd.exe ) one running ping and one running tracert. i wanna force those two windows inside my main one. and then be able to tab between them using tab controls.

i had an idea which was to get the window handles of the 2 consoles. then change their style attributes so they can be child windows. the setparent() but not sure if that's gonna work. i'll try that when i get home tonight

illustration :



//edit : gay, i need to think of something else.. setwindowlong to force it to become a child window won't work since the same process doesn't own it.. making the handle inherited in the createprocess call doesn't work either. still access_denied
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Thu Jul 16, 2009 8:32 pm    Post subject: Reply with quote

I don't think that is possible....But take a look at something called MDI (Multiple Document Interface)
_________________
Back to top
View user's profile Send private message Send e-mail
Chaosis13
Master Cheater
Reputation: 0

Joined: 14 Aug 2007
Posts: 372

PostPosted: Thu Jul 16, 2009 9:48 pm    Post subject: Reply with quote

I think it isn't possible, but you can use this:

Code:
string command = textBox1->Text;
string rtn = system(command);
textBox2->Text = rtn;


Or I think there is a powershell control... You will need to install powershell.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Jul 17, 2009 5:16 am    Post subject: Reply with quote

i know about powershell + MDI. last solution i'm considering now is piping which seems like a nice one to look at
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Fri Jul 17, 2009 9:13 am    Post subject: Reply with quote

Slugsnack wrote:
i know about powershell + MDI. last solution i'm considering now is piping which seems like a nice one to look at


you could at least bind them by getting the coords of the parent window and not letting WM_MOVE move them outside of that coord.

_________________
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Jul 17, 2009 12:02 pm    Post subject: Reply with quote

nah putting it as a child window just makes it display all weird anyway.. see :



nah piping seems like the perfect solution. home now, gonna try it now
Back to top
View user's profile Send private message
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Fri Jul 17, 2009 12:14 pm    Post subject: Reply with quote

http://www.autoitscript.com/forum/index.php?showtopic=18059

I Wrote that a "long" time ago..although it should provide some idea's Smile
I know it is not workable code cause many updates to autoit have changed\broken alot of things but the concept and parameters to the APIS didnt change Wink

also try sending a WM_REFRESH to the "child" window Wink

I hope this helps.

regards BanMe

_________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you.
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: Fri Jul 17, 2009 3:44 pm    Post subject: Reply with quote



wahoo

thanks banme but pipe is so much better for what i want now i got it working : )
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Jul 17, 2009 6:21 pm    Post subject: Reply with quote

I was using a console in as a 'log' in one of my programs a while ago. If WriteConsole is too restrictive, you can use freopen to redirect it.

printf is certainly nicer than WriteConsole.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Jul 17, 2009 6:41 pm    Post subject: Reply with quote

freopen seems to do basically what pipes do o_O
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Fri Jul 17, 2009 7:29 pm    Post subject: Reply with quote

can you post / pm me the source to the piping. I wanna see how its done
_________________
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat Jul 18, 2009 2:31 am    Post subject: Reply with quote

http://9dt.zwit.org/

sorry it's not a direct link, i don't want googling my website's URL make it appear on dozens of hacking forums since i'm using webspace provided by my uni : |

there is a small 'bug' in the code in case you can't see it btw. so when createprocess is called it creates cmd.exe with commandline parameters to make it call PING.exe. now the problem is i am using terminateprocess to close the cmd.exe. however the PING.exe remains....... i don't even know how to get rid of that short of enumerating processes and finding it. i tried to enumerate windows and getwindowthreadprocessid and openprocess but there were no matches to the handle returned by createprocess. what i originally intended to do was if i got the window to send it a wm_close message which should make it properly terminate ping.exe as well

i was also thinking of piping 'ctrl-c' and the string 'exit' back to the console but haven't gotten around to that yet, i'm sure there must be an elegant solution to this

either way this should give you an idea to how piping works, it's really really simple as you can see

//edit : about to edit it. there IS an elegant way haha. there is no need for the cmd.exe. i could just createprocess on ping.exe straight off
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