Windows CE下类似Process.Start功能的解决方法
来源:互联网 发布:淘宝购物车无法结算 编辑:程序博客网 时间:2024/06/07 01:19
public class ProcessInfo
{
public IntPtr hProcess;
public IntPtr hThread;
public Int32 ProcessId;
public Int32 ThreadId;
}
[DllImport("CoreDll.DLL", SetLastError=true)]
private extern static int CreateProcess( String imageName,
String cmdLine,
IntPtr lpProcessAttributes,
IntPtr lpThreadAttributes,
Int32 boolInheritHandles,
Int32 dwCreationFlags,
IntPtr lpEnvironment,
IntPtr lpszCurrentDir,
byte [] si,
ProcessInfo pi );
[DllImport("CoreDll.dll")]
private extern static Int32 GetLastError();
[DllImport("CoreDll.dll")]
private extern static Int32 WaitForSingleObject( IntPtr Handle,Int32 Wait);
public static bool CreateProcess( String ExeName, String CmdLine, ProcessInfo pi )
{
Int32 INFINITE;
unchecked {INFINITE = (int)0xFFFFFFFF;}
if ( pi == null )
pi = new ProcessInfo();
byte [] si = new byte[128];
CreateProcess(ExeName, CmdLine, IntPtr.Zero, IntPtr.Zero,
0, 0, IntPtr.Zero, IntPtr.Zero, si, pi);
WaitForSingleObject(pi.hProcess,INFINITE);
return true;
}
private void btnExecute_Click(object sender, System.EventArgs e)
{
String progPath = "iexplore.exe";//这里就是你要执行的程式路径名称
ProcessInfo pi = new ProcessInfo();
if (CreateProcess(progPath, "", pi) )
{
MessageBox.Show("Success! PID = " + pi.ProcessId.ToString());
}
else
{
MessageBox.Show("Failed! System Error = " + GetLastError().ToString());
}
}
- Windows CE下类似Process.Start功能的解决方法
- Windows CE下PlaySound的解决方法
- windows 下 Process.Start没有界面(Windows service ui显示的问题)
- Windows CE下的iostream
- Windows CE下的字符串
- Start menu for Android是一款类似windows下的开始菜单
- Windows ce的体系结构和功能
- Windows ce的体系结构和功能
- windows ce的体系结构和功能
- Windows ce的体系结构和功能
- Windows CE的体系结构和功能
- Windows ce的体系结构和功能
- Windows ce的体系结构和功能
- Start Windows Process / DOS Command
- Windows CE.NET在X86下我们可以实现的功能
- win7下 Windows Process Activation Service 服务导致的 iis无法启动的解决方法
- Windows CE下的串口通讯实例
- Windows CE下串行通信的实现
- 五招教你坦然对待批评
- 2006/1/13
- 使用ASP.NET开发邮件发送系统
- 35岁之前成功的12条黄金法则
- 放假啦!!!!!!!!
- Windows CE下类似Process.Start功能的解决方法
- 绝对经典的入侵例子
- Nokia手机的S40系列对j2me等的支持
- Using Web Services for Remoting over the Internet.
- Dime Buffered Upload
- IC库存,低价清仓!!Over 100000 units in stock !!!
- 管理工作中的“七种浪费”
- WebService Probe
- 申请MSN邮箱