从C ++代码打开一个exe [英] Opening a exe from C++ code

查看:131
本文介绍了从C ++代码打开一个exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想从具有特定宽度和高度的c ++代码中打开一个exe。



任何人都可以帮忙。



问候,

DD

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

推荐答案

你可以使用以下命令:



1) ShellExecute()示例将从root运行程序myprog.exe我的主程序



HINSTANCE HINST的目录=的ShellExecute(m_hWnd, 开放, MYPROG.EXE, ,MYPROG,SW_SHOW);



有关详细信息,请查看此处: 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,/ * ... * /);



有关详细信息,请查看此处: http://msdn.microsoft .com / zh-CN / library / ms682425%28v = vs.85%29.aspx



要调整大量Windows,你可以使用Sizer是一个免费软件实用程序,允许您将任何窗口调整为精确的预定义大小。这在设计网页时非常有用,因为它允许您查看以较小尺寸查看时页面的外观。在为文档编辑屏幕截图时,该实用程序也很方便,使用Sizer可以轻松地在屏幕抓取时保持相同的窗口大小。

有关详细信息,请查看此处: http://www.brianapps.net/sizer/



问候,

Alex。
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.


您可以使用 CreateProcess [ ^ ]符合您的要求。

CreateProcess 需要STARTUPINFO [ ^ ]参数。

在此参数中你可以在中指定窗口的坐标和大小 dwX dwY dwXSize dwYSize members。
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.


查看此链接 [ ^ ]


这篇关于从C ++代码打开一个exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆