7,655
社区成员
发帖
与我相关
我的任务
分享
#region PInvoke defintions
class SHELLEXECUTEEX
{
public UInt32 cbSize;
public UInt32 fMask;
public IntPtr hwnd;
public IntPtr lpVerb;
public IntPtr lpFile;
public IntPtr lpParameters;
public IntPtr lpDirectory;
public int nShow;
public IntPtr hInstApp;
// Optional members
public IntPtr lpIDList;
public IntPtr lpClass;
public IntPtr hkeyClass;
public UInt32 dwHotKey;
public IntPtr hIcon;
public IntPtr hProcess;
}
[DllImport("coredll")]
extern static int ShellExecuteEx( SHELLEXECUTEEX ex );
[DllImport("coredll")]
extern static IntPtr LocalAlloc( int flags, int size );
[DllImport("coredll")]
extern static void LocalFree( IntPtr ptr );
[DllImport("coredll")]
public static extern IntPtr GetCapture();
[DllImport("coredll")]
public static extern IntPtr MoveWindow(IntPtr hWnd, int X, int Y, int Width, int Height, bool Repaint);
[DllImport("coredll")]
public static extern int GetWindowLong(IntPtr hWnd, int nItem);
[DllImport("coredll")]
public static extern void SetWindowLong(IntPtr hWnd, int nItem, int nValue);
public const int GWL_STYLE = (-16);
public const int GWL_EXSTYLE = (-20);
public const int GWL_USERDATA = (-21);
public const int GWL_ID = (-12);
public const int WS_BORDER = 0x00800000;
public const int WS_CAPTION = 0x00C00000;
#endregion
[DllImport("coredll.Dll")]
private static extern int CreateProcess(string strImageName, string strCmdLine, IntPtr pProcessAttributes, IntPtr pThreadAttributes, int bInheritsHandle, int dwCreationFlags, IntPtr pEnvironment, IntPtr pCurrentDir, Byte[] bArray, ProcessInfo oProc);