Thread: handles?

  1. #1
    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
    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, 12:06 PM
  2. organizing window handles
    By FOOTOO in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 11:53 PM
  3. PThread Handles Not Closing?
    By Geolingo 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, 08:52 PM
  5. one window, two handles
    By Devil Panther in forum Windows Programming
    Replies: 10
    Last Post: 01-15-2005, 09:45 AM