110,534
社区成员
发帖
与我相关
我的任务
分享
System.Diagnostics.Process p = ...;
p.PriorityClass = System.Diagnostics.ProcessPriorityClass.BelowNormal; //<-----
[StructLayout(LayoutKind.Sequential)]
public struct ProcessEntry32
{
public uint dwSize;
public uint cntUsage;
public uint th32ProcessID;
public IntPtr th32DefaultHeapID;
public uint th32ModuleID;
public uint cntThreads;
public uint th32ParentProcessID;
public int pcPriClassBase;
public uint dwFlags
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=256)]
public string szExeFile;
};
//返回0的原因是因为dwSize值。
//你在调用Process32First之前给他设置值 1024试试
//另外这3个方法在wince中的toolhelp.dll中。
[DllImport( "toolhelp.dll ")]
public static extern IntPtr CreateToolhelp32Snapshot(uint dwFlags, uint th32ProcessID);
[DllImport( "toolhelp.dll ")]
public static extern int Process32First(int snaph, ref PROCESSENTRY32 lppe);
[DllImport( "toolhelp.dll ")]
public static extern int Process32Next(IntPtr snaph, ref PROCESSENTRY32 lppe);