Mercurial > dwindows
comparison win/dw.c @ 2145:821f7d3a2e90
Win: Fix compilation problems on XP with Visual C 2010.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 17 Jul 2020 02:28:59 +0000 |
parents | e7a68eea2fa0 |
children | d38c3aa33c3f |
comparison
equal
deleted
inserted
replaced
2144:e7a68eea2fa0 | 2145:821f7d3a2e90 |
---|---|
934 | 934 |
935 if(hdcPaint) | 935 if(hdcPaint) |
936 { | 936 { |
937 int cx = RECTWIDTH(rcClient); | 937 int cx = RECTWIDTH(rcClient); |
938 int cy = RECTHEIGHT(rcClient); | 938 int cy = RECTHEIGHT(rcClient); |
939 HBITMAP hbm; | |
939 | 940 |
940 /* Define the BITMAPINFO structure used to draw text. | 941 /* Define the BITMAPINFO structure used to draw text. |
941 * Note that biHeight is negative. This is done because | 942 * Note that biHeight is negative. This is done because |
942 * DrawThemeTextEx() needs the bitmap to be in top-to-bottom | 943 * DrawThemeTextEx() needs the bitmap to be in top-to-bottom |
943 * order. | 944 * order. |
948 dib.bmiHeader.biHeight = -cy; | 949 dib.bmiHeader.biHeight = -cy; |
949 dib.bmiHeader.biPlanes = 1; | 950 dib.bmiHeader.biPlanes = 1; |
950 dib.bmiHeader.biBitCount = 32; | 951 dib.bmiHeader.biBitCount = 32; |
951 dib.bmiHeader.biCompression = BI_RGB; | 952 dib.bmiHeader.biCompression = BI_RGB; |
952 | 953 |
953 HBITMAP hbm = CreateDIBSection(hdc, &dib, DIB_RGB_COLORS, NULL, NULL, 0); | 954 if((hbm = CreateDIBSection(hdc, &dib, DIB_RGB_COLORS, NULL, NULL, 0))) |
954 if (hbm) | |
955 { | 955 { |
956 HBITMAP hbmOld = (HBITMAP)SelectObject(hdcPaint, hbm); | 956 HBITMAP hbmOld = (HBITMAP)SelectObject(hdcPaint, hbm); |
957 LOGFONT lgFont; | 957 LOGFONT lgFont; |
958 HFONT hFontOld = NULL; | 958 HFONT hFontOld = NULL; |
959 RECT rcPaint = rcClient; | 959 RECT rcPaint = rcClient; |