4 message in the case of a mains failure, 5 example for an object program, Message in the case of a mains failure – Lenze CPC 5100 Benutzerhandbuch

Seite 63: Example for an object program

Advertising
background image

Appendix

UPS software Lenze Digitec UPS

Message in the case of a mains failure

7

l

63

LDCDS−CPC5100 DE/EN 1.1

7.1.4

Message in the case of a mains failure

If a mains failure occurs during operation, the UPS takes over the supply of the computer
and a dialog appears:

When the Wait until battery−low signal checkbox is

deactivated:

activated:

If the supply voltage has been reapplied in the meantime, a corresponding message
appears and the system is not shut down. The program that was last active is reactivated
automatically.

)

Note!

All messages are stored in the "usv.log" log file (standard path c:/usv/usv.log).
This file can be displayed using the "Viewer" program (standard path
c:/usv/viewer.exe) or any text editor.
To ensure that the log file does not get too big, the data is deleted if the file
size exceeds 64 KB. If you delete the log file using the Windows Explorer®, a
new log file will be created as soon as a new log entry is available.

7.1.5

Example for an object program

The following C−program closes a running Windows application (as an example here the
calculator from the Windows accessories):

#include <stdio.h>
#include <windows.h>

void main()
{
HANDLE hWnd;
hWnd=::FindWindow(NULL,"calculator");
if (hWnd!=NULL)
{
::PostMessage(hWnd,WM_CLOSE,NULL,NULL);
}
}

With the "FindWindow" function you receive a handle to the corresponding window. As
parameter the class name of the application has to be transferred. You obtain this name
by pressing [Ctrl]+[Alt]+[Del] and searching for the application in the task manager. Via
"PostMessage" you send a message to this application.

Advertising