| 16 | #define GET_PROC(dll, name) name = base::get_dll_proc<name##_Func>(dll, #name) |
| 17 | |
| 18 | WinAPI::WinAPI() |
| 19 | { |
| 20 | m_user32 = base::load_dll("user32.dll"); |
| 21 | m_ninput = base::load_dll("ninput.dll"); |
| 22 | if (m_user32) { |
| 23 | GET_PROC(m_user32, EnableMouseInPointer); |
| 24 | GET_PROC(m_user32, IsMouseInPointerEnabled); |
| 25 | GET_PROC(m_user32, GetPointerInfo); |
| 26 | GET_PROC(m_user32, GetPointerPenInfo); |
| 27 | GET_PROC(m_user32, SetProcessDpiAwarenessContext); |
| 28 | } |
| 29 | if (m_ninput) { |
| 30 | GET_PROC(m_ninput, CreateInteractionContext); |
| 31 | GET_PROC(m_ninput, DestroyInteractionContext); |
| 32 | GET_PROC(m_ninput, StopInteractionContext); |
| 33 | GET_PROC(m_ninput, RegisterOutputCallbackInteractionContext); |
| 34 | GET_PROC(m_ninput, AddPointerInteractionContext); |
| 35 | GET_PROC(m_ninput, RemovePointerInteractionContext); |
| 36 | GET_PROC(m_ninput, SetInteractionConfigurationInteractionContext); |
| 37 | GET_PROC(m_ninput, SetPropertyInteractionContext); |
| 38 | GET_PROC(m_ninput, ProcessPointerFramesInteractionContext); |
| 39 | } |
| 40 | |
| 41 | // Set this process as DPI aware (in this way we can position |
| 42 | // windows using real pixel units) |
| 43 | if (SetProcessDpiAwarenessContext) { |
| 44 | if (!SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2)) |
| 45 | SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | WinAPI::~WinAPI() |
| 50 | { |
nothing calls this directly
no test coverage detected