システムを終了、再起動、ログオフする
Shutdown, Code
| 引数名 | 説明 |
|---|---|
| Code | 以下のものの和
|
OnExitサブルーチンを設定しておき、「A_ExitReason」変数を調べれば、ユーザーがシャットダウンやログオフを行おうとしたことを知ることができる。
; Force a reboot (reboot + force = 2 + 4 = 6): Shutdown, 6
; サスペンドやハイバネートを行いたい場合は、下記のようにWindowsのAPIを呼び出す。
; Windows 95/NT4: Since this function does not exist, the following call would have no effect.
; Parameter #1: Pass 1 instead of 0 to hibernate rather than suspend.
; Parameter #2: Pass 1 instead of 0 to request permission from each application prior to suspending.
; Parameter #3: Pass 1 instead of 0 to disable all wake events.
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)