我用以下程序已经可以打开exe文件receiver.exe(我自己写的)
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\receiver.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
然后我用
HWND hWnd = ::FindWindow(NULL,"Receiver");
怎么找不到窗口啊?
注:我已经设置m_pMainWnd->SetWindowText("Receiver");
我试过sleep(10000)了,不行,不是时间的问题。
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\receiver.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
然后我用
HWND hWnd = ::FindWindow(NULL,"Receiver");
怎么找不到窗口啊?
注:我已经设置m_pMainWnd->SetWindowText("Receiver");
我试过sleep(10000)了,不行,不是时间的问题。
解决方案 »
- 请问怎么在窗口输出变量
- MFC对话框实现随时间移动的网格问题!急~
- Combo Box不支持中文?
- 使用ADO调用Oracle存储过程如何传递参数?谢谢
- 请问软件crash的主要原因是什么,怎么预防,crash和异常有什么区别?
- 请教不用stl,mfc里面有可以计算平均值,最值的类或者方法吗?
- 自绘窗口时的问题
- 请问各位高手!如何取得Windows中的用户数量(98,ME,2K,XP),急!!!
- 我刚刚学完了钱能的C++现在准备找一本VC的书来看请问那本书入门好?
- 想实现windows画图软件那样显示像素坐标的功能
- 头都大了!!请教用ShellExecute怎么传递字符串给另一程序啊?
- 请教大家:我想实现两台服务器之间的文件下载,要求不但能够一方主动从另一方下载,还可以一方主动向另一方传送文件
第一个参数,"类名“也填上。(用spy++可以找到)
ShellExecute(hWnd,"open","C:\\Documents and Settings\\Administrator\\桌面\\86days\\receiver1\\receiver1\\Debug\\receiver1.exe",0,0,2);
怎么传参啊?