Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.89/5 (4 votes)
See more:
Hi,

I want to open an exe from the c++ code with with specific width and height.

Can anyone help in this.

with regards,
DD
Posted
Comments
[no name] 18-Sep-13 6:45am    
"help in this", help with what? Does the exe support command line arguments? Do those arguments include the ability to set the window size?

You can use the following command :

1) ShellExecute() example will run program myprog.exe from the root directory of my main program

HINSTANCE hinst = ShellExecute(m_hWnd,"open","myprog.exe","",myprog,SW_SHOW);

For more information, please look here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx

2) CreateProcess
LPTSTR szCmdline = _tcsdup(TEXT("C:\\Program Files\\....\\myprog.exe"));
CreateProcess(NULL, szCmdline, /* ... */);

For more information, please look here: http://msdn.microsoft.com/en-us/library/ms682425%28v=vs.85%29.aspx

For resize a bunch of Windows , you can to use Sizer is a freeware utility that allows you to resize any window to an exact, predefined size. This is extremely useful when designing web pages, as it allows you to see how the page will look when viewed at a smaller size. The utility is also handy when compiling screen-shots for documentation, using Sizer allows you to easily maintain the same window size across screen grabs.
For more information, please look here: http://www.brianapps.net/sizer/

Regards,
Alex.
 
Share this answer
 
Comments
[no name] 18-Sep-13 21:19pm    
Very good.
Volynsky Alex 19-Sep-13 2:11am    
Thanks :)
You can use CreateProcess[^] for your requirement.
CreateProcess takes a STARTUPINFO[^] parameter.
In this parameter you can specify the coordinates and size of the window in the dwX, dwY, dwXSize and dwYSize members.
 
Share this answer
 
Check this link[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900