Thread: Console Text Stuff

  1. #1
    Señor Member
    Join Date
    Jan 2002
    Posts
    560

    Console Text Stuff

    I'm in the process of making a casino and I'd like to have a feature where you can walk around. I'd do this using characters and printing them in full screen mode. First of all, how do I make the console go into full screen (not alt+enter), and secondly, how do I color the text. I looked at the FAQ and there's a dead link there and I can't find anything on that MSDN site. Thanks in advance.

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    25

    the matrix

    check out the matrix sample zMan posted earlier this week...
    it has some console functions including the GoToXY and changing the text color...
    inZane
    --true programmer's don't comment--
    --programmer wannabes complain about it--

  3. #3
    Señor Member
    Join Date
    Jan 2002
    Posts
    560
    Ok I got that stuff but how do I make the console go to full screen mode without making the user press alt+enter?

  4. #4

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    I just dont understand why people want to use windows consoles for this type of stuff....

    Sure you can change cursor position, colour the console, colour the test, make it full screen, catch mouse and arrow key clicks....but why? If you need this type of functionality from WIN Consoles, you will need enough Windows knowledge to create proper windows apps......

    Anyway...enough ranting......here is a little trick I developed.....

    Code:
    #include <windows.h>
    #include <iostream>
    using std::cout;
    using std::endl;
    using std::cin;
    
    void GoFullScreen(void){
    	TCHAR strTitle[] = "Terrible Console";
    	SetConsoleTitle(strTitle);
    	HWND hwnd = FindWindow("ConsoleWindowClass",strTitle);
    	if(hwnd != NULL){
    	
    	SendMessage(hwnd,WM_SYSKEYDOWN,VK_RETURN,536870912);
    	}
    	else cout << "Error - Could not Maximise" << endl;
    }
    
    
    int main()
    {
    	GoFullScreen();
                //Do console type stuff
    
       return 0;
    }
    Oh...btw that is specific to Windows 2000......it will choke on Win 98 (another reason to do a proper windows app )
    Last edited by Fordy; 03-02-2002 at 04:53 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectX | Drawing text
    By gavra in forum Game Programming
    Replies: 4
    Last Post: 06-08-2009, 12:23 AM
  2. console text effects
    By algi in forum C++ Programming
    Replies: 4
    Last Post: 12-17-2004, 04:15 PM
  3. Underlining text in a Console Program.
    By Perica in forum C++ Programming
    Replies: 2
    Last Post: 09-28-2002, 09:46 AM
  4. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 10:19 AM
  5. Validating the contents of a char buffer
    By mattz in forum C Programming
    Replies: 3
    Last Post: 12-09-2001, 06:21 PM