This source file includes following definitions.
- SaveInitialSettings
- InstallLayoutTestSettings
- RestoreInitialSettings
- SimpleSignalHandler
- main
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
static BOOL font_smoothing_enabled = FALSE;
static void SaveInitialSettings() {
::SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &font_smoothing_enabled, 0);
}
static void InstallLayoutTestSettings() {
::SystemParametersInfo(SPI_SETFONTSMOOTHING, FALSE, 0, 0);
}
static void RestoreInitialSettings() {
::SystemParametersInfo(
SPI_SETFONTSMOOTHING, static_cast<UINT>(font_smoothing_enabled), 0, 0);
}
static void SimpleSignalHandler(int signalNumber) {
RestoreInitialSettings();
exit(128 + signalNumber);
}
int main(int, char**) {
signal(SIGINT, SimpleSignalHandler);
signal(SIGTERM, SimpleSignalHandler);
SaveInitialSettings();
InstallLayoutTestSettings();
printf("ready\n");
fflush(stdout);
getchar();
RestoreInitialSettings();
return EXIT_SUCCESS;
}