c# Windows Mobile 6.0关机代码?

来源:百度知道 编辑:UC知道 时间:2024/05/21 11:04:49
通过c#程序如何使Windows Mobile 6.0关机?我在网上找了找,网上说的那些都没用,都不是真正的关机,人家都说不能,但我确定可以,因为我用的Dopod的机子里是有这个关机功能的,而且是真正的关机!还有程序运行时保持屏幕背光不关,程序退出后屏幕背光闲置一段时间会关闭?还请高人指点!

public struct TokPriv1Luid
{
public int Count;
public long Luid;
public int Attr;
}

[DllImport("kernel32.dll",ExactSpelling=true)]
public static extern IntPtr GetCurrentProcess();

[DllImport("advapi32.dll",ExactSpelling=true,SetLastError=true)]

public static extern bool OpenProcessToken(IntPtr h,int acc,ref IntPtr phtok );
[DllImport("advapi32.dll",SetLastError=true)]

public static extern bool LookupPrivilegeValue(string host,string name,ref long pluid );
[DllImport("advapi32.dll",ExactSpelling=true, SetLastError=true) ]

public static extern bool AdjustTokenPrivileges(IntPtr htok,bool disall,
ref TokPriv1Luid newst,int len,IntPtr prev, IntPtr relen);

[DllImport("user32.dll",ExactSpelling=true,SetLastError=true) ]

public static extern bool ExitWindowsEx(int flg,int rea);
public const int SE_PR