引用
using System.Runtime.InteropServices; //引用 DllImport
宣告
[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("ceplayer.exe", "\\windows\\garfield.wmv", IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, pi);
備註
1.ceplayer.exe 不知道如何可以全螢幕撥放
2.Win32下可以用 System.Diagnostics.Process 取代CreateProcess()
using System.Runtime.InteropServices; //引用 DllImport
宣告
[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("ceplayer.exe", "\\windows\\garfield.wmv", IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, pi);
備註
1.ceplayer.exe 不知道如何可以全螢幕撥放
2.Win32下可以用 System.Diagnostics.Process 取代CreateProcess()
全站熱搜
留言列表