C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 08-24-2007, 09:43 PM   #1
Registered User
 
Join Date: Aug 2007
Posts: 33
How to...

I was wandering how to code to open up a new window or console while already programming in console. In other words... After the code is run, make it open up the main console window, and then other windows after it and have specific code run in each separate window...

Could anyone help me on achieving this?
Diablo02 is offline   Reply With Quote
Old 08-25-2007, 03:31 AM   #2
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Simple answer is that you can't. If you are using console applications, you can only have one window - there is a function to create a console window, AllocConsole(), but the description of it says:
Quote:
Originally Posted by Microsoft
A process can be associated with only one console, so the AllocConsole function fails if the calling process already has a console. A process can use the FreeConsole function to detach itself from its current console, and then it can call AllocConsole to create a new console or AttachConsole to attach to another console. If the calling process creates a child process, the child inherits the new console.
You have to use the Windows application mode if you want to use multiple windows with one application.

--
Mats
matsp is offline   Reply With Quote
Old 08-25-2007, 03:47 AM   #3
Woof, woof!
 
zacs7's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 3,295
You could spawn a child process with inherited STDOUT, STDERR and STDIN streams (over a pipe).

Or, simply communicate over pipes, process to process, rather than having inherited handles.
__________________
"I.T. gets the chicky-babes" - M. Kelly
bakefile | vim
zacs7 is offline   Reply With Quote
Old 08-25-2007, 10:59 AM   #4
Registered User
 
Join Date: Aug 2007
Posts: 33
hmmm... ok, how would i do it with application mode to create multiple windows?
Diablo02 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump


All times are GMT -6. The time now is 10:22 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22