Microsoft.NET SDK CompactFramework v2.0を使用してWindows CE 5.0タブレットをプログラムでシャットダウンする必要があります。私は私のビルドにとExitWindowsExを追加する方法はありソリューションhereを使用してみましたが、エラーメッセージC#Windows CE 5.0エラー:PInvoke DLL coredllでエントリポイントExitWindowsExを見つけることができない
Can't find entry point ExitWindowsEx in PInvoke DLL coredll
を得ましたか。 私は別のコアリングが必要ですか?
[Flags]
public enum ExitFlags
{
Reboot = 0x02,
PowerOff = 0x08
}
[DllImport("coredll")]
public static extern int ExitWindowsEx(ExitFlags flags, int reserved);
private static void buttonShutdown_Click(object sender, EventArgs e)
{
ExitWindowsEx(ExitFlags.PowerOff, 0);
}
private static void buttonRestart_Click(object sender, EventArgs e)
{
ExitWindowsEx(ExitFlags.Reboot, 0);
}