From 6f15819ed26503fa8373ff16d162c6a225295efe Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Thu, 20 Apr 2006 22:25:53 +0000 Subject: [PATCH] Add the same bitmap to the settings page too. Needs the background masking out though ... svn path=/trunk/; revision=21678 --- reactos/dll/cpl/desk/background.c | 4 ++-- reactos/dll/cpl/desk/settings.c | 33 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/reactos/dll/cpl/desk/background.c b/reactos/dll/cpl/desk/background.c index c388e71365c..898bf6e67d5 100644 --- a/reactos/dll/cpl/desk/background.c +++ b/reactos/dll/cpl/desk/background.c @@ -43,8 +43,8 @@ HWND g_hColorButton = NULL; HIMAGELIST g_hShellImageList = NULL; -HBITMAP hBitmap = NULL; -int cxSource, cySource; +static HBITMAP hBitmap = NULL; +static int cxSource, cySource; /* Add the images in the C:\ReactOS directory and the current wallpaper if any */ void AddListViewItems() diff --git a/reactos/dll/cpl/desk/settings.c b/reactos/dll/cpl/desk/settings.c index 3f0925e9f74..15847b2f7a1 100644 --- a/reactos/dll/cpl/desk/settings.c +++ b/reactos/dll/cpl/desk/settings.c @@ -45,6 +45,9 @@ typedef struct _DISPLAY_DEVICE_ENTRY static PDISPLAY_DEVICE_ENTRY DisplayDeviceList = NULL; static PDISPLAY_DEVICE_ENTRY CurrentDisplayDevice = NULL; +HBITMAP hBitmap = NULL; +int cxSource, cySource; + static VOID UpdateDisplay(IN HWND hwndDlg) { @@ -261,6 +264,7 @@ OnInitDialog(IN HWND hwndDlg) DWORD Result = 0; DWORD iDevNum = 0; DISPLAY_DEVICE displayDevice; + BITMAP bitmap; /* Get video cards list */ displayDevice.cb = (DWORD)sizeof(DISPLAY_DEVICE); @@ -292,6 +296,15 @@ OnInitDialog(IN HWND hwndDlg) /* FIXME: multi video adapter */ /* FIXME: choose selected adapter being the primary one */ } + + hBitmap = LoadImage(hApplet, MAKEINTRESOURCE(IDC_MONITOR), IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT); + if (hBitmap != NULL) + { + GetObject(hBitmap, sizeof(BITMAP), &bitmap); + + cxSource = bitmap.bmWidth; + cySource = bitmap.bmHeight; + } } static VOID @@ -555,6 +568,24 @@ SettingsPageProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lPar } break; } + + case WM_PAINT: + { + PAINTSTRUCT ps; + HDC hdc, hdcMem; + + hdc = BeginPaint(hwndDlg, &ps); + + hdcMem = CreateCompatibleDC(hdc); + SelectObject(hdcMem, hBitmap); + + BitBlt(hdc, 98, 0, cxSource, cySource, hdcMem, 0, 0, SRCCOPY); + + DeleteDC(hdcMem); + EndPaint(hwndDlg, &ps); + + } break; + case WM_DESTROY: { PDISPLAY_DEVICE_ENTRY Current = DisplayDeviceList; @@ -571,6 +602,8 @@ SettingsPageProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lPar HeapFree(GetProcessHeap(), 0, Current); Current = Next; } + + DeleteObject(hBitmap); } } return FALSE;