diff options
author | Goraf <goraf@miranda-ng.org> | 2016-01-30 21:56:49 +0000 |
---|---|---|
committer | Goraf <goraf@miranda-ng.org> | 2016-01-30 21:56:49 +0000 |
commit | c820fb6a8648b63e6d7d40b165ac047533dadfa3 (patch) | |
tree | e8bdc10a76a64b659ddae930561aa556faa687da /src | |
parent | 66d36547ef14644965d9a5afa46e4056716664b2 (diff) |
BITMAPINFO initialization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16199 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/headerbar.cpp | 8 | ||||
-rw-r--r-- | src/mir_app/src/iconheader.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/imgconv.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/options.cpp | 3 |
4 files changed, 6 insertions, 9 deletions
diff --git a/src/mir_app/src/headerbar.cpp b/src/mir_app/src/headerbar.cpp index 84ca93ef75..f372781bf6 100644 --- a/src/mir_app/src/headerbar.cpp +++ b/src/mir_app/src/headerbar.cpp @@ -130,7 +130,6 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit) {
int iTopSpace = IsAeroMode() ? 0 : 3;
PAINTSTRUCT ps;
- HBITMAP hBmp, hOldBmp;
int titleLength = GetWindowTextLength(hwndDlg) + 1;
TCHAR *szTitle = (TCHAR *)mir_alloc(sizeof(TCHAR) * titleLength);
@@ -143,17 +142,16 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit) HDC hdc = BeginPaint(hwndDlg, &ps);
HDC tempDC = CreateCompatibleDC(hdc);
- BITMAPINFO bmi;
+ BITMAPINFO bmi = { 0 };
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = mit->width;
bmi.bmiHeader.biHeight = -mit->height; // we need this for DrawThemeTextEx
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
- bmi.bmiColors[0].rgbRed = bmi.bmiColors[0].rgbGreen = bmi.bmiColors[0].rgbBlue = bmi.bmiColors[0].rgbReserved = 0;
- hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
+ HBITMAP hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
- hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);
+ HBITMAP hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);
if (IsAeroMode()) {
RECT temprc = { 0, 0, mit->width, mit->width };
diff --git a/src/mir_app/src/iconheader.cpp b/src/mir_app/src/iconheader.cpp index a6fcf2518e..be9b55a6b8 100644 --- a/src/mir_app/src/iconheader.cpp +++ b/src/mir_app/src/iconheader.cpp @@ -262,7 +262,7 @@ static LRESULT MIcoTab_OnPaint(HWND hwndDlg, MIcoTabCtrl *mit) HDC hdc = BeginPaint(hwndDlg, &ps);
HDC tempDC = CreateCompatibleDC(hdc);
- BITMAPINFO bmi;
+ BITMAPINFO bmi = { 0 };
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = mit->width;
bmi.bmiHeader.biHeight = -mit->height; // we need this for DrawThemeTextEx
diff --git a/src/mir_app/src/imgconv.cpp b/src/mir_app/src/imgconv.cpp index 3a5b130fdb..bf8344f9fe 100644 --- a/src/mir_app/src/imgconv.cpp +++ b/src/mir_app/src/imgconv.cpp @@ -28,7 +28,7 @@ typedef DWORD ARGB; HBITMAP ConvertIconToBitmap(HIMAGELIST hIml, int iconId)
{
- BITMAPINFO bmi = {};
+ BITMAPINFO bmi = { 0 };
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biCompression = BI_RGB;
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 3c8623c15c..86d9846aac 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -386,14 +386,13 @@ static void AeroPaintControl(HWND hwnd, HDC hdc, UINT msg, LPARAM lpFlags) HDC tempDC = CreateCompatibleDC(hdc);
- BITMAPINFO bmi;
+ BITMAPINFO bmi = { 0 };
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = rc.right;
bmi.bmiHeader.biHeight = -rc.bottom;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
- bmi.bmiColors[0].rgbRed = bmi.bmiColors[0].rgbGreen = bmi.bmiColors[0].rgbBlue = bmi.bmiColors[0].rgbReserved = 0;
BYTE *pBits;
HBITMAP hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, (void **)&pBits, NULL, 0);
|