当通过ShellExecuteEx功能启动时,安装屏蔽窗口没有出现在顶部
Install-Shield window is not coming on top when launched through ShellExecuteEx function
我正在尝试通过使用下面的代码
启动通过install-shield制作的setup.exeDWORD ChildProcess(LPCSTR exePath, LPCSTR lpCmdLine ,BOOL showDialog, char* workingDir, BOOL bParentWait )
{
CWnd * handle = AfxGetMainWnd (); //handle to the main dialog box of mfc application
DWORD dwExitCode = -1;
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.lpVerb = "open";
ShExecInfo.lpFile = exePath; //setup.exe path, installer exe
if(bParentWait)
{
ShExecInfo.lpParameters = lpCmdLine;
ShExecInfo.nShow = SW_MINIMIZE;
}
else
{
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.lpParameters = NULL;
}
ShExecInfo.lpDirectory = workingDir;
ShExecInfo.hInstApp = NULL;
if (ShellExecuteEx(&ShExecInfo))
{
if(bParentWait)
{
handle->ShowWindow(SW_MINIMIZE);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
if(showDialog){
handle->ShowWindow(SW_RESTORE);
}
GetExitCodeProcess(ShExecInfo.hProcess, &dwExitCode);
}
else
{
CloseHandle(ShExecInfo.hProcess);
dwExitCode = 0;
}
}
return dwExitCode;
}
问题是启动的安装程序窗口没有出现在顶部。如有任何帮助,我将不胜感激。
谢谢
我相信你的问题是因为setup.exe
产生了另一个执行UI序列的进程(从而显示窗口)。
相关文章:
- 在Visual Studio中单实例Qt应用程序版本5.11.1中,在所有其他窗口的顶部打开Qt MainWindow
- Qt - 有没有办法检查窗口是否标记为始终在顶部(linux)?
- 如何将窗口始终放在SFML的顶部
- 基于CDialog的应用程序启动时,如何将我的辅助对话框窗口带到顶部
- 为什么窗口不登上顶部,使用setWindowpos的起源
- Win32 窗口通过顶部窗口重绘
- 在第三方应用程序的窗口顶部绘制
- SDL2:如何提高窗口(在主叫终端的顶部)
- 使用固定的顶部坐标创建可调整大小的窗口
- 另一个窗口顶部的窗口
- Qt:即使子窗口失去焦点,也要保持子窗口位于父窗口的顶部
- 如何使“工具”窗口始终位于 2 个或更多主窗口的顶部
- 如何在MFC上设置窗口位置以将其定位到屏幕顶部
- 在顶部mac窗口上显示应用程序菜单
- 沉浸式全屏模式顶部的透明窗口
- 将Windows 7窗口标记为始终位于顶部,包括Win7任务栏(自定义错误)
- JavaFX设置窗口总是在顶部与JNA库,windows操作系统
- 在另一个子窗口的顶部绘制一个子窗口
- 强制窗口位于最顶部的窗口(如任务管理器)之上
- OpenCV 3.0.0:如何在Ubuntu 14.04的窗口顶部显示跟踪栏