mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Fixed menu bar highlighting when window is not in top-left corner of desktop
This commit is contained in:
parent
743d19bf25
commit
6f14ddf9ae
@ -82,6 +82,16 @@ namespace
|
|||||||
return hasDisplayDcArg(t) || hasDisplayDcArg(params...);
|
return hasDisplayDcArg(t) || hasDisplayDcArg(params...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool lpToScreen(HWND hwnd, HDC dc, POINT& p)
|
||||||
|
{
|
||||||
|
LPtoDP(dc, &p, 1);
|
||||||
|
RECT wr = {};
|
||||||
|
GetWindowRect(hwnd, &wr);
|
||||||
|
p.x += wr.left;
|
||||||
|
p.y += wr.top;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T replaceDc(T t)
|
T replaceDc(T t)
|
||||||
{
|
{
|
||||||
@ -129,7 +139,7 @@ namespace
|
|||||||
RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE);
|
RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE);
|
||||||
}
|
}
|
||||||
else if (GetCurrentThreadId() == GetWindowThreadProcessId(hwnd, nullptr) &&
|
else if (GetCurrentThreadId() == GetWindowThreadProcessId(hwnd, nullptr) &&
|
||||||
LPtoDP(hdc, &p, 1) &&
|
lpToScreen(hwnd, hdc, p) &&
|
||||||
HTMENU == SendMessage(hwnd, WM_NCHITTEST, 0, (p.y << 16) | (p.x & 0xFFFF)))
|
HTMENU == SendMessage(hwnd, WM_NCHITTEST, 0, (p.y << 16) | (p.x & 0xFFFF)))
|
||||||
{
|
{
|
||||||
WINDOWINFO wi = {};
|
WINDOWINFO wi = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user