请教各位,如何在程序中远程启动和关闭一个程序?使其在程序本地处于运行状态或关闭状态。各位大虾帮帮忙,谢谢!
解决方案 »
- DirectSound 声卡录音问题。
- 请问怎么改变2k/xp/03下的非系统盘盘符(如:把e:\改成 g:)
- 请教,很菜的问题!
- 如何做到象网易POPO那样的主窗口?
- 初学C语言,哪一本书比较好?
- winsock编写的聊天程序,如何在服务器端控制连入的客户端的个数?
- 在CString 类型的变量中,怎么样在字串中加上' "这样的符号?
- 用socket在局域网内怎么样才可以侦听得到局域网外的连接请求?
- 在EXE文件运行时如何修改这个EXE文件本身,或者如何在该EXE文件运行时如何删除它自身这个文件?
- 使用MFC用POST方式提交表单,返回数据提示:页面已过期,请重新刷新查询页面。
- VC中,CString的值的查看
- 谁能解释一下M$的超线程技术?
CreateProcess
The CreateProcess function creates a new process and its primary thread. The new process runs the specified executable file. To create a process that runs in a different security context, use the CreateProcessAsUser or CreateProcessWithLogonW function. BOOL CreateProcess(
LPCTSTR lpApplicationName, // name of executable module
LPTSTR lpCommandLine, // command line string
LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
BOOL bInheritHandles, // handle inheritance option
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // new environment block
LPCTSTR lpCurrentDirectory, // current directory name
LPSTARTUPINFO lpStartupInfo, // startup information
LPPROCESS_INFORMATION lpProcessInformation // process information
);关闭程序:
...
SendMessage(hWnd,WM_CLOSE);
...
Process.Create( _
CommandLine As String, _
CurrentDirectory As String, _
ProcessStartupInformation As Win32_ProcessStartup, _
ByRef ProcessId As Integer _
) As Integer