In my Win32 VCL application I am using ShellExecute to launch a number of smaller Delphi console applications. Is there a way to control the position of those console windows? I would like to launch them centered on screen.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you have control over the console application, You could set the console window position from inside the console application itself:
If you can’t recompile the console application, you could use
FindWindow('ConsoleWindowClass', '<path to the executable>')to obtain the console window handle (the Title parameter could vary if it was set viaSetConsoleTitle).The downside with this approach, is that the console window is seen “jumping” from it’s default position to it’s new position (tested with Windows XP).