handles?

This is a discussion on handles? within the C++ Programming forums, part of the General Programming Boards category; how can i "command" the DOS window to go full screen?? (i know the easy way is to tell the ...

  1. #1
    mik
    mik is offline
    Registered User mik's Avatar
    Join Date
    Oct 2001
    Posts
    15

    Question handles?

    how can i "command" the DOS window to go full screen??
    (i know the easy way is to tell the user to press alt+enter)

    i have seen it done years ago when someone went through the API and also changed the window color.
    C:\
    C:\dos
    C:\dos run
    RUN dos RUN!

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    I'm not sure if there is a way to make the console run in full screen mode (without spawining your program from another process), but this should run the console in a maximised window -

    Code:
    #include <windows.h>
    
    int main()
    {
      
    	HANDLE hConsole;
    	COORD size;
    	HWND hWnd;
    		
    	hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    	size = GetLargestConsoleWindowSize(hConsole);
    	SetConsoleScreenBufferSize(hConsole,size);
    	SetConsoleTitle("test");
    	hWnd = FindWindow(NULL,"test");
    	
    	ShowWindow(hWnd,SW_MAXIMIZE);
    
    	return 0;
    	
    }
    zen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with DB handles
    By pokks in forum C Programming
    Replies: 4
    Last Post: 01-04-2006, 11:06 AM
  2. organizing window handles
    By FOOTOO in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:53 PM
  3. PThread Handles Not Closing?
    By DeepBlackMagic in forum C++ Programming
    Replies: 7
    Last Post: 04-21-2005, 03:41 AM
  4. Handles to visible programs
    By Snip in forum Windows Programming
    Replies: 3
    Last Post: 03-26-2005, 07:52 PM
  5. one window, two handles
    By Devil Panther in forum Windows Programming
    Replies: 10
    Last Post: 01-15-2005, 08:45 AM

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