Thread: console app in full screen

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    58

    console app in full screen

    alright i know about the alt+enter stuff and the code that one guy posted:

    Code:
    bool GoFullScreen(void){
    
    
    	hwnd = FindWindow(NULL, "Menu");
    	if(hwnd != NULL){
    	int nVer = HIBYTE(LOWORD(GetVersion()));//Win 98 or 2K?
    	if(nVer != 0)//If 98
    	SendMessage(hwnd,WM_COMMAND,57359,0);//Send maximise command
    	else
    	SendMessage(hwnd,WM_SYSKEYDOWN,
    		VK_RETURN,536870912);//Send alt-enter (Win2k)
    	}
    	return true;
    }
    which dosnt work because that hwnd isnt defined. Im running windows xp, and compiling with borland 5.01. Please help. If you know how to fix this problem please do tell.
    --== www.NuclearWasteSite.com==--

  2. #2
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Code:
    hwnd = FindWindow(NULL, "Menu");
    	if(hwnd != NULL){
    	int nVer = HIBYTE(LOWORD(GetVersion()));//Win 98 or 2K?
    	if(nVer != 0)//If 98
    	SendMessage(hwnd,WM_COMMAND,57359,0);//Send maximise command
    	else
    	SendMessage(hwnd,WM_SYSKEYDOWN,
    		VK_RETURN,536870912);//Send alt-enter (Win2k)
    	}
    	return true;
    }
    The kernal 98 uses is different than 2k/NT/XP. So the int nVer - HIBYTE(LOWORD(GetVersion())); probably won't work with XP. Since it probably uses the 98 kernal.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    58
    still hwnd is an undefined variable.
    --== www.NuclearWasteSite.com==--

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    This looks like the code I wrote.......

    2 things about it....

    1. I never quite got it right for the Win98 version...and as both of my PCs are now Win2k...I am not going to bother any more to try fix it....

    2. You missed out an important bit of the code...



    Code:
    bool GoFullScreen(void){
    
    SetConsoleTitle("Menu");
    hwnd = FindWindow(NULL, "Menu");
    if(hwnd != NULL){
    int nVer = HIBYTE(LOWORD(GetVersion()));//Win 98 or 2K?
    if(nVer != 0)//If 98
    SendMessage(hwnd,WM_COMMAND,57359,0);//Send maximise command
    else
    SendMessage(hwnd,WM_SYSKEYDOWN,
    VK_RETURN,536870912);//Send alt-enter (Win2k)
    }
    return true;
    }

  5. #5
    Seņor Member
    Join Date
    Jan 2002
    Posts
    560
    This works on xp and 98
    Code:
       //FULL SCREEN
        keybd_event(VK_MENU,0x38,0,0);
        keybd_event(VK_RETURN,0x1c,0,0);
        keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
        keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Full screen console
    By eletron in forum C Programming
    Replies: 1
    Last Post: 02-25-2005, 04:04 PM
  2. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  3. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  4. Console Screen Buffer
    By GaPe in forum Windows Programming
    Replies: 0
    Last Post: 02-06-2003, 05:15 AM
  5. runninf in full screen my console programs
    By asim0s in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2002, 08:08 AM