TCHAR szFile[128];
wsprintf(szFile, "Tencent://Message/?Menu=Yes&Exe=QQ&Uin=%s", "123456"); SHELLEXECUTEINFO ShExecInfo;
ZeroMemory(&ShExecInfo, sizeof(SHELLEXECUTEINFO));
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = szFile;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOWNORMAL;
ShExecInfo.hInstApp = NULL;
if(ShellExecuteEx(&ShExecInfo))
{
TCHAR s[256];
wsprintf(s, "%d", ShExecInfo.hProcess);
MessageBox(0, s, "a", 0);
}
================================
运行可以打开QQ临时对话框,但进程句柄却显示为0,而打开其他应用程序(例如:ShExecInfo.lpFile="C:\\Program Files\\Tencent\\QQ\\QQ.exe"),却可以取得进程句柄?不知为什么,请大家帮助。
wsprintf(szFile, "Tencent://Message/?Menu=Yes&Exe=QQ&Uin=%s", "123456"); SHELLEXECUTEINFO ShExecInfo;
ZeroMemory(&ShExecInfo, sizeof(SHELLEXECUTEINFO));
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = szFile;
ShExecInfo.lpParameters = NULL;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOWNORMAL;
ShExecInfo.hInstApp = NULL;
if(ShellExecuteEx(&ShExecInfo))
{
TCHAR s[256];
wsprintf(s, "%d", ShExecInfo.hProcess);
MessageBox(0, s, "a", 0);
}
================================
运行可以打开QQ临时对话框,但进程句柄却显示为0,而打开其他应用程序(例如:ShExecInfo.lpFile="C:\\Program Files\\Tencent\\QQ\\QQ.exe"),却可以取得进程句柄?不知为什么,请大家帮助。
不知道是否和这个原因类似