Rewrite the crash reporter code
This commit is contained in:
parent
c08a47c920
commit
096b92f1b4
22 changed files with 1305 additions and 2475 deletions
|
|
@ -128,8 +128,6 @@ void Win32DisplayWindow::SetWindowFrame(const Rect& box)
|
|||
|
||||
void Win32DisplayWindow::SetClientFrame(const Rect& box)
|
||||
{
|
||||
// This function is currently unused but needs to be disabled because it contains Windows API calls that were only added in Windows 10.
|
||||
#if 0
|
||||
double dpiscale = GetDpiScale();
|
||||
|
||||
RECT rect = {};
|
||||
|
|
@ -143,7 +141,6 @@ void Win32DisplayWindow::SetClientFrame(const Rect& box)
|
|||
AdjustWindowRectExForDpi(&rect, style, FALSE, exstyle, GetDpiForWindow(WindowHandle));
|
||||
|
||||
SetWindowPos(WindowHandle, nullptr, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Win32DisplayWindow::Show()
|
||||
|
|
@ -271,22 +268,9 @@ int Win32DisplayWindow::GetPixelHeight() const
|
|||
return box.bottom;
|
||||
}
|
||||
|
||||
typedef UINT(WINAPI* GetDpiForWindow_t)(HWND);
|
||||
double Win32DisplayWindow::GetDpiScale() const
|
||||
{
|
||||
static GetDpiForWindow_t pGetDpiForWindow = nullptr;
|
||||
static bool done = false;
|
||||
if (!done)
|
||||
{
|
||||
HMODULE hMod = GetModuleHandleA("User32.dll");
|
||||
if (hMod != nullptr) pGetDpiForWindow = reinterpret_cast<GetDpiForWindow_t>(GetProcAddress(hMod, "GetDpiForWindow"));
|
||||
done = true;
|
||||
}
|
||||
|
||||
if (pGetDpiForWindow)
|
||||
return pGetDpiForWindow(WindowHandle) / 96.0;
|
||||
else
|
||||
return 1.0;
|
||||
return GetDpiForWindow(WindowHandle) / 96.0;
|
||||
}
|
||||
|
||||
std::string Win32DisplayWindow::GetClipboardText()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue