From 5e8cbb029ccd2865f93e2b4d25f94d2d35a9af36 Mon Sep 17 00:00:00 2001 From: Piotr Piastucki Date: Mon, 18 May 2015 12:58:17 +0000 Subject: After selecting an object into a DC, it has to be set back to the original value again before releasing the DC git-svn-id: http://svn.miranda-ng.org/main/trunk@13679 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/cluiservices.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp index a16d5b83b6..b9bf086843 100644 --- a/src/modules/clist/cluiservices.cpp +++ b/src/modules/clist/cluiservices.cpp @@ -165,11 +165,12 @@ void fnCluiProtocolStatusChanged(int, const char*) } else { HDC hdc; + HFONT hFont; SIZE textSize; BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1); hdc = GetDC(NULL); - SelectObject(hdc, (HFONT) SendMessage(cli.hwndStatus, WM_GETFONT, 0, 0)); + hFont = (HFONT)SelectObject(hdc, (HFONT) SendMessage(cli.hwndStatus, WM_GETFONT, 0, 0)); for (i=0; i < cli.menuProtoCount; i++) { //count down since built in ones tend to go at the end int x = 2; if (showOpts & 1) @@ -196,6 +197,7 @@ void fnCluiProtocolStatusChanged(int, const char*) } partWidths[ i ] = (i ? partWidths[ i-1] : 0) + x + 2; } + SelectObject(hdc, hFont); ReleaseDC(NULL, hdc); } -- cgit v1.2.3