Rev. C
Utilities 4-75
IR-320 Technical Reference Manual
Reference
The following events occur when the front switches using the environment provided by this
driver are operated (Front Switch Operation) and the AC power error is detected (AC Fail):
1. Occurrence of AC Fail (AC Offline) event or Front Switch Operation
2. Notification of AC Offline Status caused by the APM BIOS
3. Acceptance of AC Offline Status Notify by the driver
4. Notification of WM_POWERBROADCAST from the driver to the application
5. Termination processing by the application itself
6. Execution of WinNT Shutdown by using the ExitWindowsEx function
7. Execution of Auto Power of the system by the APM BIOS after WinNT Shutdown
By using the WM_POWERBROADCAST notification from the driver, the processing can be
performed from the normal shutdown of Windows NT to the power off.
The following shows easy sample codes. In practical operation, the shutdown should be
performed after terminating all applications.
LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam,
LPARAM lParam)
{
HWND hTmpWnd;
HBRUSH hTmpBrush;
HANDLE htkProcess;
OKEN_PRIVILEGES tkPriv;
UINT uFlags = EWX_SHUTDOWN;
switch(Message)
{
case WM_POWERBROADCAST:
OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES, &htkProcess);
tkPriv.PrivilegeCount = 1;
LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tkPriv.Privileges[0].Luid);
tkPriv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(htkProcess, FALSE, &tkPriv, 0, NULL, NULL);
ExitWindowsEx(EWX_POWEROFF, 0);
break;
default:
return DefWindowProc(hWnd, Message, wParam, lParam);
}
return 0L;
Summary of Contents for IR-320
Page 1: ...Technical Reference Manual IR 320 Issued Date Issued by EPSON English 404368102 ...
Page 2: ......
Page 38: ...1 22 IR 320 System Overview Rev C ...
Page 260: ...4 80 Utilities Rev C ...
Page 294: ...5 34 BIOS Functions Rev C ...
Page 308: ...6 14 Device Diagnostics Utility Rev C Confidential ...
Page 324: ...A 4 Wake On LAN Rev C Confidential ...
Page 332: ...B 8 The IR 310 Compared to the IR 320 Rev C ...
Page 339: ......
Page 340: ...EPSON SEIKO EPSON CORPORATION ...