Wisnu Widiarta
Wisnu Widiarta

Reputation: 176

Cannot launch an application in WS_MAXIMIZE using ShellExecute from Delphi Rio in Windows 10

I tried to run an App using ShellExecute. It ran, but not shown (I can see the instance in TaskManager).

    ShellExecute(0, PChar('open'), PChar(ExtractFileName(edExePath.Text)),
    PChar(theParameter), PChar(theFolder), WS_MAXIMIZE);

What should I do so the app will be launched in max windows size?

Upvotes: 2

Views: 396

Answers (1)

Andreas Rejbrand
Andreas Rejbrand

Reputation: 109002

You are using WS_MAXIMIZE. That constant is a window style.

You should be using SW_MAXIMIZE. That's a flag for the ShowWindow function.

Upvotes: 6

Related Questions