Windows Mobile/Windows CE开发技巧 —— 创建一个新进程
2016-12-11 20:04
716 查看
使用API的CreateProcess方法,可以在代码中动态地创建一个新程序的进程。
以下为创建一个任务管理器进程的例子:
以下为创建一个任务管理器进程的例子:
[DllImport("coredll.Dll", EntryPoint = "CreateProcess", SetLastError = true)] extern static int CreateProcess(string strImageName, string strCmdLine, IntPtr pProcessAttributes, IntPtr pThreadAttributes, int bInheritsHandle, int dwCreationFlags, IntPtr pEnvironment, IntPtr pCurrentDir, IntPtr bArray, ProcessInfo oProc); public class ProcessInfo { public Int32 hProcess; public Int32 hThread; public Int32 ProcessID; public Int32 ThreadID; } ProcessInfo pi = new ProcessInfo(); CreateProcess("\\windows\\TaskMgr.exe", "", IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, pi);
相关文章推荐
- Windows Mobile/Windows CE开发技巧 —— 控制软键盘开启和关闭
- Windows Mobile/Windows CE开发技巧 —— 使用钩子实现自定义系统功能键
- 提供一个Windows mobile Native UI 程序,循序渐进开发,并附有代码!
- 【译】Android平台上的Flex开发(1)---- 创建一个新的Mobile工程
- 提供一个Windows mobile Native UI 程序,循序渐进开发,并附有代码!
- 在Windows Embedded CE开发Native C++时一个继承的误用
- 【深入Java开发】JVM源码分析之一个Java进程究竟能创建多少线程
- Windows Phone实用开发技巧(37):创建一个全局播放器
- c# windowsmobile开发技巧
- 在Windows Mobile和Wince(Windows Embedded CE)下如何使用.NET Compact Framework开发进程管理程序
- 在Windows Mobile和Wince(Windows Embedded CE)下如何使用.NET Compact Framework开发进程管理程序
- windows 下在一个进程中使用createprocess创建一个窗口进程,并获取这个窗口的HWND句柄
- 用Flex开发移动应用(1)---- 创建一个新的Mobile工程
- 提供一个Windows mobile Native UI 程序,循序渐进开发,并附有代码!
- 在Windows Mobile和Wince(Windows Embedded CE)下进行Win32开发,取出当前所有运行中进程信息的方法
- windows创建一个执行可执行文件的进程!
- Windows CE.net 应用开发(教程)----基础篇
- Windows CE .NET 应用程序开发:我有哪些选择?
- Windows自带的一个关闭进程的命令
- 跟我一起学Windows Workflow Foundation(5)-----使用activity设计器创建一个整合的定制activity