-
MFC创建进程、打开进程、终止进程
资源描述
创建进程、打开进程、终止进程
*两个函数 CreateProcess、openProcess、TerminateProcess
*获得进程句柄
*获得进程号
*提升进程权限
*Microsoft Spy++
操作平台:win10+vs2013 pro
操作步骤:
1、创建进程
PROCESS_INFORMATION pi;//进程信息结构
STARTUPINFO si;//启动信息结构
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
si.wShowWindow = SW_SHOW;
si.dwFlags = STARTF_USESHOWWINDOW;
TCHAR szPath[] = TEXT("c:windowssystem32
otepad.exe E:c++MFCa.txt");
BOOL bRet = ::CreateProcess(NULL, szPath, NULL, FALSE, NULL, NULL, NULL, NULL, &si, &pi);
int error = GetLastError();
if (bRet)
{
::CloseHandle(pi.hThread);
::CloseHandle(pi.hProcess);
AfxMessageBox(TEXT("创建进程成功"));
}
else
{
AfxMessageBox(TEXT("创建进程失败"));
}
2、打开进程
DWORD pid;
//若有指定窗口类和窗口名称则表示成功返回一个窗口的句柄
HWND hCalc = ::FindWindow(TEXT("Note
- 2022-03-25 15:36:01下载
- 积分:1
-
Vc中关于Word的编程(表格)
Vc中关于Word的编程(表格)-Vc on the Word of programming (Forms)
- 2023-07-15 11:00:04下载
- 积分:1
-
MFC 实践
Learning MFC 可以學習 float 之使用这个文件(项目文件)包含在项目水平和信息用于建立一个项目或子项目。其他用户可以共享项目(.dsp)文件,但他们应该在本地出口makefile。
- 2022-06-30 02:47:00下载
- 积分:1
-
UserRight control, the control is to provide two main functions of safeguarding...
控件UserRight,本控件主要是提供两大功能维护系统的安全性,特别适合于管理多人使用系统的权限问题。-UserRight control, the control is to provide two main functions of safeguarding the security of the system is particularly suited to the use of system management over issues of authority.
- 2023-04-11 02:40:03下载
- 积分:1
-
xtra grid控件
xtra grid控件-xtra grid control
- 2022-01-27 22:38:46下载
- 积分:1
-
张学工的csvm,分类方法简单,用途广泛。
张学工的csvm,分类方法简单,用途广泛。-Zhang workers csvm, classification method is simple, a wide range of uses.
- 2023-04-29 05:25:03下载
- 积分:1
-
yards from the Primitive : thinking in java
本原码来自:thinking in java-yards from the Primitive : thinking in java
- 2023-07-15 14:10:03下载
- 积分:1
-
常用控件使用教程
常用控件使用教程-Control the use of commonly used Tutorial
- 2022-01-25 15:08:28下载
- 积分:1
-
RichText Tool
RichText Tool-tip control
是我在网上找的,版权归原作者所有。
- 2022-02-01 00:48:56下载
- 积分:1
-
the process creating a steady background of the window, color gradient to the di...
本程序创建一个有渐变背景的窗口,颜色渐变的方向为从左下到右上-the process creating a steady background of the window, color gradient to the direction from the lower left to upper right
- 2023-03-29 17:00:03下载
- 积分:1