WEB开发网
开发学院软件开发VC 在VC中为应用程序添加图形超链接功能 阅读

在VC中为应用程序添加图形超链接功能

 2008-11-14 19:35:28 来源:WEB开发网   
核心提示: (5)用系统打印机打印文档ShellExecute(this->m_hWnd,"print", "c:abc.txt","","", SW_HIDE);(6)用系统查找功能来查找指定文件ShellExec

(5)用系统打印机打印文档

ShellExecute(this->m_hWnd,"print", "c:abc.txt","","", SW_HIDE);

(6)用系统查找功能来查找指定文件

ShellExecute(m_hWnd,"find","d:
ish", NULL,NULL,SW_SHOW);

(7)启动一个程序,直到它运行结束

SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:MyProgram.exe";
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
或:
PROCESS_INFORMATION ProcessInfo;
STARTUPINFO StartupInfo; //This is an [in] parameter
ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof StartupInfo ; //Only compulsory field
if(CreateProcess("c:winnt
otepad.exe", NULL,
NULL,NULL,FALSE,0,NULL,
NULL,&StartupInfo,&ProcessInfo))
{
 WaitForSingleObject(ProcessInfo.hProcess,INFINITE);
 CloseHandle(ProcessInfo.hThread);
 CloseHandle(ProcessInfo.hProcess);
}
else
{
 MessageBox("The process could not be started...");
}

上一页  1 2 3 4 5 6  下一页

Tags:VC 应用程序 添加

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接