-
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
-
可编辑的 Listview 控件
ListView控件是一个在Windows应用程序中使用频率比较高的一个,通常使用它来显示数据报表。很多情况下,我们不仅仅使用ListView来显示数据,还要求编辑其中的数据。但是.NET提供的ListView控件的编辑功能十分有限,只能编辑首列,编辑格式只能为文本框,等等,使用起来甚为不便。本类扩充了其功能,客户程序员可以设置任何列的格式(只读,编辑状态下文本框,编辑状态下组合框),可编辑的,听说很好用,像Excel单元格一样。
- 2022-02-05 11:09:00下载
- 积分:1
-
一个用VB做的,可以实现鼠标滞留的程序源程序,说不清楚,一看就知道,...
一个用VB做的,可以实现鼠标滞留的程序源程序,说不清楚,一看就知道,-a VB do, can achieve a mouse stranded procedures source that is not clear, a person would know, thank you
- 2022-01-26 00:39:42下载
- 积分:1
-
一个示例程序,可以用C在DOS下编写图形化菜单,源代码测试可用...
一个示例程序,可以用C在DOS下编写图形化菜单,源代码测试可用-a sample program that can be used in DOS C prepare graphical menu, testing source code available!
- 2022-08-13 17:03:23下载
- 积分:1
-
RichText Tool
RichText Tool-tip control
是我在网上找的,版权归原作者所有。
- 2022-02-01 00:48:56下载
- 积分:1
-
这是一个简单的单文档框架程序,对于出学者是很好的例子,能帮助你很快理解SDI编程原理....
这是一个简单的单文档框架程序,对于出学者是很好的例子,能帮助你很快理解SDI编程原理.-This is a simple framework of a single document procedures for scholars out is a good example. to help you quickly understand SDI program principle.
- 2022-03-17 13:39:21下载
- 积分:1
-
This routine demonstrates how to split the window, the programming interface ref...
这个例程演示了如何切分窗口,对界面编程初学者一定参考!-This routine demonstrates how to split the window, the programming interface reference for beginners!
- 2022-02-13 00:08:01下载
- 积分:1
-
VC++ MFC 做的软件程序
这个是用VC++ MFC编写的界面开开程序,很实用的啊,欢迎下载使用,不懂的请联系我 ,很好的资源,值得下载,
- 2023-02-01 21:00:04下载
- 积分:1
-
Windows XP interface effect
Windows XP界面效果-Windows XP interface effect
- 2022-04-30 12:16:28下载
- 积分:1
-
演示了一个通用的程序不规则界面的实现方法.
演示了一个通用的程序不规则界面的实现方法.-Demonstration of a common procedure for irregular interface methods realize.
- 2022-03-25 00:06:10下载
- 积分:1