mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-01 16:53:01 +05:00
4cccda9da6
This avoids compile warnings on MinGW GCC (because standard C++ headers eventually import the Windows stuff)
24 lines
557 B
C++
24 lines
557 B
C++
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#define WINVER 0x0501
|
|
#define _WIN32_WINNT 0x0501
|
|
#define NOMINMAX
|
|
|
|
#include "Desktop.h"
|
|
|
|
#include <windows.h>
|
|
|
|
std::pair<uint32_t, uint32_t> GetDesktopResolution()
|
|
{
|
|
std::pair<uint32_t, uint32_t> result {};
|
|
|
|
DEVMODEW displaySettings;
|
|
displaySettings.dmSize = sizeof(displaySettings);
|
|
displaySettings.dmDriverExtra = 0;
|
|
if (EnumDisplaySettingsW(nullptr, ENUM_CURRENT_SETTINGS, &displaySettings) != FALSE)
|
|
{
|
|
result.first = displaySettings.dmPelsWidth;
|
|
result.second = displaySettings.dmPelsHeight;
|
|
}
|
|
return result;
|
|
}
|