summaryrefslogtreecommitdiff
path: root/common_windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'common_windows.c')
-rw-r--r--common_windows.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/common_windows.c b/common_windows.c
index a8a2444..ca42eab 100644
--- a/common_windows.c
+++ b/common_windows.c
@@ -98,8 +98,7 @@ void paintControlBackground(HWND hwnd, HDC dc)
{
HWND parent;
RECT r;
- POINT p;
- int saved;
+ POINT p, pOrig;
WCHAR classname[128] = L""; // more than enough to avoid collisions
parent = hwnd;
@@ -123,12 +122,9 @@ void paintControlBackground(HWND hwnd, HDC dc)
p.y = r.top;
if (ScreenToClient(parent, &p) == 0)
xpanic("error getting client origin of control in paintControlBackground()", GetLastError());
- saved = SaveDC(dc);
- if (saved == 0)
- xpanic("error saving DC info in paintControlBackground()", GetLastError());
- if (SetWindowOrgEx(dc, p.x, p.y, NULL) == 0)
+ if (SetWindowOrgEx(dc, p.x, p.y, &pOrig) == 0)
xpanic("error moving window origin in paintControlBackground()", GetLastError());
SendMessageW(parent, WM_PRINTCLIENT, (WPARAM) dc, PRF_CLIENT);
- if (RestoreDC(dc, saved) == 0)
- xpanic("error restoring DC info in paintControlBackground()", GetLastError());
+ if (SetWindowOrgEx(dc, pOrig.x, pOrig.y, NULL) == 0)
+ xpanic("error resetting window origin in paintControlBackground()", GetLastError());
}