Thread: Multiple Windows

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    6

    Multiple Windows

    I want to write a command line program the utilizes two windows, so user can look at data side by side

    I'm writing a command line game

    I want one window to essentially be the entire game, while the other window displays a map of the users location

    Or perhaps think of a tic tac toe game

    The left window would be where the user decides to place their piece, and the right window would constantly display the board

    I could write two programs
    A tic tac toe program and a display program
    The main game program sends information about the board to the display program which then displays it. But I would really like to be able to do this with one .c file and without using graphics.

  2. #2
    Registered User carrotcake1029's Avatar
    Join Date
    Apr 2008
    Posts
    404
    Why would you make this a command line program. Just make a Win32 project. Also, instead of two different programs, just make one that consists of a main window and a child window. If you made them separate, making them communicate could get messy unless you do some strategic programming.

    By the way, do you have a question or something?

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    6
    My question is how do I get two windows?

    It has to be a command line program

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    There is no such thing as multiple windows in a Windows console program. You could of course use "textgraphics" to provide a "split screen" - so you have a box at the top of the screen and another one at the bottom. This is far from trivial, but possible. You would need to use the Windows Console functions or some third party (pdCurses perhaps).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    You could write two programs that work independently of one another in a sort of client/host fashion in order to share data. You could also write a program that just directly alters memory from the other. Long story short, the ends just simply do not justify the means. You are asking the equivalent how can I drive two cars simultaneously.

    Far be it for any of us to utter the words "impossible." But its somewhat of a fool's venture.

  6. #6
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Hold on, actually. If this is an assignment for a class that demands you write in a console, perhaps you can bend the rules instead of breaking them altogether. You can certainly register a window class within a console app. Thus you could have your second window without breaking the cardinal rule in front of you.

    Perhaps you could even take a vastly more liberal view of this rule and write your own psuedo-console for your game to run in.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. Codec Bitrates?
    By gvector1 in forum C# Programming
    Replies: 2
    Last Post: 06-16-2003, 08:39 AM
  5. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM