MCPcopy Create free account
hub / github.com/cztomczak/cefpython / IsProcessDpiAware

Function IsProcessDpiAware

src/client_handler/dpi_aware.cpp:17–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15const int DEFAULT_DPIX = 96;
16
17bool IsProcessDpiAware() {
18 typedef BOOL(WINAPI *IsProcessDPIAwarePtr)(VOID);
19 IsProcessDPIAwarePtr is_process_dpi_aware_func =
20 reinterpret_cast<IsProcessDPIAwarePtr>(
21 GetProcAddress(GetModuleHandleA("user32.dll"),
22 "IsProcessDPIAware"));
23 BOOL is_aware = FALSE;
24 if (is_process_dpi_aware_func) {
25 is_aware = is_process_dpi_aware_func();
26 if (is_aware == TRUE) {
27 return true;
28 }
29 }
30 // GetProcessDpiAwareness is available only on Win8. So it
31 // should be called only as a back-up plan after IsProcessDPIAware
32 // was called. Also if IsProcessDPIAware returned false,
33 // then GetProcessDpiAwareness is called as well.
34 if (GetProcessDpiAwareness() != PROCESS_DPI_UNAWARE) {
35 return true;
36 }
37 return false;
38}
39
40PROCESS_DPI_AWARENESS GetProcessDpiAwareness() {
41 // Win8.1 supports monitor-specific DPI scaling, so it is

Callers 1

Calls 1

GetProcessDpiAwarenessFunction · 0.85

Tested by

no test coverage detected