#ifndef _BROWSER_UTIL_WIN_H_ #define _BROWSER_UTIL_WIN_H_ #pragma once #include #include #include "include/internal/cef_types_wrappers.h" // Helper macros for splitting and combining the int64 frame ID value. #define MAKE_INT64(int_low, int_high) \ ((int64) (((int) (int_low)) | ((int64) ((int) (int_high))) << 32)) #define LOW_INT(int64_val) ((int) (int64_val)) #define HIGH_INT(int64_val) ((int) (((int64) (int64_val) >> 32) & 0xFFFFFFFFL)) namespace browser { // Set the window's user data pointer. void SetUserDataPtr(HWND hWnd, void* ptr); // Return the window's user data pointer. template T GetUserDataPtr(HWND hWnd) { return reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_USERDATA)); } // Set the window's window procedure pointer and return the old value. WNDPROC SetWndProcPtr(HWND hWnd, WNDPROC wndProc); // Return the resource string with the specified id. std::wstring GetResourceString(UINT id); int GetCefMouseModifiers(WPARAM wparam); int GetCefKeyboardModifiers(WPARAM wparam, LPARAM lparam); bool IsKeyDown(WPARAM wparam); // Returns the device scale factor. For example, 200% display scaling will // return 2.0. float GetDeviceScaleFactor(); CefKeyEvent ToCefKeyEvent(UINT message, WPARAM wParam, LPARAM lParam); } // namespace browser #endif // _BROWSER_UTIL_WIN_H_