Skip to content

Instantly share code, notes, and snippets.

@mataha
Last active June 8, 2021 22:16
Show Gist options
  • Save mataha/c9d53cc01fed349c55b290d7e0f144f2 to your computer and use it in GitHub Desktop.
Save mataha/c9d53cc01fed349c55b290d7e0f144f2 to your computer and use it in GitHub Desktop.
Windows system metrics
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#define print_metric(metric) \
do \
{ \
printf("%s: %d\n", #metric, GetSystemMetrics(metric)); \
} while (0)
int main(void)
{
print_metric(SM_CMONITORS);
printf("\n");
print_metric(SM_CXBORDER);
print_metric(SM_CXCURSOR);
print_metric(SM_CXEDGE);
print_metric(SM_CXFIXEDFRAME);
print_metric(SM_CXFOCUSBORDER);
print_metric(SM_CXFULLSCREEN);
print_metric(SM_CXMAXIMIZED);
print_metric(SM_CXMAXTRACK);
print_metric(SM_CXMENUSIZE);
print_metric(SM_CXSCREEN);
print_metric(SM_CXSIZE);
print_metric(SM_CXSIZEFRAME);
print_metric(SM_CXVIRTUALSCREEN);
print_metric(SM_CXVSCROLL);
printf("\n");
print_metric(SM_CYBORDER);
print_metric(SM_CYCURSOR);
print_metric(SM_CYEDGE);
print_metric(SM_CYFIXEDFRAME);
print_metric(SM_CYFOCUSBORDER);
print_metric(SM_CYFULLSCREEN);
print_metric(SM_CYMAXIMIZED);
print_metric(SM_CYMAXTRACK);
print_metric(SM_CYMENUSIZE);
print_metric(SM_CYSCREEN);
print_metric(SM_CYSIZE);
print_metric(SM_CYSIZEFRAME);
print_metric(SM_CYVIRTUALSCREEN);
print_metric(SM_CYVSCROLL);
printf("\n");
print_metric(SM_XVIRTUALSCREEN);
print_metric(SM_YVIRTUALSCREEN);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment