Thread: Run Window

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    56

    Run Window

    I am new to C++, the question I have right now is how do I get the run window to go into full screen. We are useing Visual C++ 6.0

    Thank You
    WackoWolf

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Search and ye shall find.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    56

    Left to Right

    It will only streach up and down, will not streach from left to righ. I would like it to streach from left to right I don't care about top to bottom

  4. #4
    Registered User
    Join Date
    Oct 2004
    Posts
    56
    I want to streach from left to right

  5. #5
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227
    alt + enter
    Keyboard Not Found! Press any key to continue. . .

  6. #6
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Do you mean have a program change the screen size? If so, try this to set size:
    Code:
    	system("mode con:lines=50");  // or whatever numbers you want
    	system("mode con:cols=75");
    or try this for full screen:
    Code:
    	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);
    And if you just mean do it manually, right click on the title, go to properties then layout.
    Last edited by PJYelton; 10-17-2004 at 07:05 PM.

  7. #7
    Registered User Elhaz's Avatar
    Join Date
    Sep 2004
    Posts
    32
    Quote Originally Posted by PJYelton
    Do you mean have a program change the screen size? If so, try this to set size:
    Code:
    	system("mode con:lines=50");  // or whatever numbers you want
    	system("mode con:cols=75");
    Hi PJYelton,

    That was very useful, thanks. Is there a similar code to position the console on the screen? I find that my extended console opens down off the screen a little the first time the program is run and I'd like to centre it if I can. I ran a search of google and this forum for "console positioning" but could find nothing relevant.

    Thanks.

  8. #8
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    I believe this may be useful. Take a look at the last bit in the code example given.
    http://cboard.cprogramming.com/showt...ighlight=COORD

    There also may be something about this particular method in the FAQ, although I'm not totally sure.

    **EDIT**
    Here it is:
    http://faq.cprogramming.com/cgi-bin/...&id=1043284385

    The last line in the "Windows Option" is what you want.
    Last edited by Hunter2; 10-21-2004 at 09:33 PM.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  9. #9
    Registered User Elhaz's Avatar
    Join Date
    Sep 2004
    Posts
    32
    Thanks Hunter2,

    Code:
    SetConsoleCursorPosition(hConsole, coordScreen);
    Does this actually position the console on the screen? Or just the cursor in the console?

    And do I need to include some of the other lines of the code together with the above line?

    Like:
    Code:
    COORD   coordScreen = { 0, 0 };
    for example?

    I have to admit that the syntax (all caps) is new to me so I'm not sure what goes with what. I guess they're tied into things in the windows header?

    Thanks for your help.

  10. #10
    Arggggh DeepFyre's Avatar
    Join Date
    Sep 2004
    Posts
    227
    Code:
            system("mode con:lines=50");  // or whatever numbers you want
    	system("mode con:cols=75");
    Is there another way of doing this because I have a program that would work much better if it were a certain size, but for some reason it prevents mouse input (which I need as part of the program) if I use that method.
    Thanks
    Keyboard Not Found! Press any key to continue. . .

  11. #11
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    >>I guess they're tied into things in the windows header?

    Yup. The console is really a console "window". Console windows are just specialized windows--they have many, but not the same, attributes of routine windows. You can manipulate the console, the cursor, etc. with WinAPI code found in windows.h.

  12. #12
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    >>And do I need to include some of the other lines of the code together with the above line?
    Yes, you need to do the GetStdHandle line and the COORD line (but fill the COORD with the coordinates you want, not 0,0). Look those functions up on MSDN, if you still want more info after:

    >>Does this actually position the console on the screen? Or just the cursor in the console?
    Oops sorry, I thought you were asking about the cursor

    In that case, I don't know how you'd centre the console on the screen Maybe there's a function called SetWindowPos() or something?
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  13. #13
    Registered User Elhaz's Avatar
    Join Date
    Sep 2004
    Posts
    32
    Thanks Hunter2 and elad. I'll check out the windows.h header and see what I can find.

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. creating a child window
    By rakan in forum Windows Programming
    Replies: 2
    Last Post: 01-23-2007, 03:22 PM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM