Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Maximise Window.  (Read 3305 times)

0 Members and 1 Guest are viewing this topic.

SimonA

    Topic Starter


    Rookie

    Maximise Window.
    « on: August 26, 2008, 04:46:18 AM »
    I am writing a C program and I want that when I run the code, the window maximises itself automatically. Is there any function or command which I can use?

    Thanks :)

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Maximise Window.
    « Reply #1 on: August 26, 2008, 03:02:36 PM »
    Learn something new every day. Always thought the C++ had the windows not C.

    Code: [Select]
    ShowWindow(hWnd,SW_SHOWMAXIMIZED)

    hWnd would be the window handle

    Good luck.  8)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    SimonA

      Topic Starter


      Rookie

      Re: Maximise Window.
      « Reply #2 on: August 27, 2008, 01:44:23 AM »
      Thanks a lot Sidewinder. It should work.

      But how should I set the window handle ?

      SimonA

        Topic Starter


        Rookie

        Re: Maximise Window.
        « Reply #3 on: August 27, 2008, 05:38:42 AM »
        Wait a minute Sidewinder.
        I think you misunderstood my question. Let me explain myself a bit better.

        I wrote a C program which runs in a DOS prompt window. But the window is set by default to be 25 characters in height, i.e. it is not completely maximised. I would like a command which can maximise the command prompt window automatically.

        Hope this is a better explanation.

        Thanks again for your interest.  :)

        Sidewinder



          Guru

          Thanked: 139
        • Experience: Familiar
        • OS: Windows 10
        Re: Maximise Window.
        « Reply #4 on: August 27, 2008, 05:47:23 AM »
        OK, this has nothing to do with C and everything to do with the command prompt.

        Try starting your program and use the /max switch to control the window size:

        Code: [Select]
        start /max C-program

        Good luck.  8)
        The true sign of intelligence is not knowledge but imagination.

        -- Albert Einstein

        priya1



          Starter

          Re: Maximise Window.
          « Reply #5 on: August 29, 2008, 01:12:01 AM »
          As, I said C  and C++ programming language.  While writing a program
          and I want that when I run the code, the window maximizes itself automatically. Is there any function or any short cut to Maximize.

          _______________________________________ ____

          priya1

          [link Removed - please do not advertise other websites]
          « Last Edit: August 29, 2008, 02:38:56 AM by Carbon Dudeoxide »

          Sidewinder



            Guru

            Thanked: 139
          • Experience: Familiar
          • OS: Windows 10
          Re: Maximise Window.
          « Reply #6 on: August 29, 2008, 07:30:22 AM »
          As, I said C  and C++ programming language.  While writing a program
          and I want that when I run the code, the window maximizes itself automatically. Is there any function or any short cut to Maximize.

          The question is ambiguous. What window? The program window or the command window. Either way the question has been asked and answered.

          If it's the program window, see reply #1 above.
          If it's the command window, see reply #4 above

           8)
          The true sign of intelligence is not knowledge but imagination.

          -- Albert Einstein