Windows State


How can I control the windows state of another application, that get launched from within my app.  What I want to do is have the application come up in a "Maximized" state when it is launched. Please provide example.

Thanks,
TJ
aj85Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

edeyCommented:
If you are using shellExecute(ex) to start the app:

HINSTANCE ShellExecute(

    HWND  hwnd,      // handle to parent window
    LPCTSTR  lpOperation,      // pointer to string that specifies operation to perform
    LPCTSTR  lpFile,      // pointer to filename string
    LPTSTR  lpParameters,      // pointer to string that specifies executable-file parameters
    LPCTSTR  lpDirectory,      // pointer to string that specifies default directory
    INT  nShowCmd       // whether file is shown when opened
   );

use SW_MAXIMIZE for nShowCmd.




GL
Mike
0
aj85Author Commented:


This is very close to what I need, however I am using WinExec. What do I use for that?
0
edeyCommented:
Given the following:


UINT WinExec(

    LPCSTR  lpszCmdLine,      // address of command line
    UINT  fuCmdShow       // window style for new application
   );

fuCmdShow

Specifies how a Windows-based application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of the acceptable values, see the description of the nCmdShow parameter of the ShowWindow function.


use SW_MAXIMIZE for fuCmdShow



GL
Mike
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aj85Author Commented:

Thank you, the points are yours.  Very clear answer.

TJ
0
edeyCommented:
Glad to be of service :)


GL
Mike
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.