Add the same bitmap to the settings page too.

Needs the background masking out though ...

svn path=/trunk/; revision=21678
This commit is contained in:
Ged Murphy 2006-04-20 22:25:53 +00:00
parent fbf34c7981
commit 6f15819ed2
2 changed files with 35 additions and 2 deletions

View file

@ -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()

View file

@ -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;