diff --git a/reactos/subsys/system/explorer/desktop/desktop.cpp b/reactos/subsys/system/explorer/desktop/desktop.cpp index 6f472e7b384..fa7cf78c0ad 100644 --- a/reactos/subsys/system/explorer/desktop/desktop.cpp +++ b/reactos/subsys/system/explorer/desktop/desktop.cpp @@ -257,56 +257,37 @@ BOOL IsAnyDesktopRunning() } -static void draw_desktop_background(HWND hwnd, HDC hdc) -{ - ClientRect rect(hwnd); - - PaintDesktop(hdc); -/* - HBRUSH bkgndBrush = CreateSolidBrush(RGB(0,32,160)); // dark blue - FillRect(hdc, &rect, bkgndBrush); - DeleteBrush(bkgndBrush); -*/ - - rect.left = rect.right - 280; - rect.top = rect.bottom - 56 - DESKTOPBARBAR_HEIGHT; - rect.right = rect.left + 250; - rect.bottom = rect.top + 40; - -#include "../buildno.h" - static const LPCTSTR BkgndText = TEXT("ReactOS ")TEXT(KERNEL_VERSION_STR)TEXT(" Explorer\nby Martin Fuchs"); - - BkMode bkMode(hdc, TRANSPARENT); - - TextColor textColor(hdc, RGB(128,128,192)); - DrawText(hdc, BkgndText, -1, &rect, DT_RIGHT); - - SetTextColor(hdc, RGB(255,255,255)); - --rect.right; - ++rect.top; - DrawText(hdc, BkgndText, -1, &rect, DT_RIGHT); -} - - BackgroundWindow::BackgroundWindow(HWND hwnd) : super(hwnd) { // set background brush for the short moment of displaying the // background color while moving foreground windows SetClassLong(hwnd, GCL_HBRBACKGROUND, COLOR_BACKGROUND+1); + + _display_version = RegGetDWORDValue(HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop"), TEXT("PaintDesktopVersion"), 1); } LRESULT BackgroundWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) { switch(nmsg) { case WM_ERASEBKGND: - PaintDesktop((HDC)wparam); + DrawDesktopBkgnd((HDC)wparam); return TRUE; case WM_MBUTTONDBLCLK: explorer_show_frame(SW_SHOWNORMAL); break; + case PM_DISPLAY_VERSION: + if (lparam || wparam) { + DWORD or_mask = wparam; + DWORD reset_mask = LOWORD(lparam); + DWORD xor_mask = HIWORD(lparam); + _display_version = ((_display_version&~reset_mask) | or_mask) ^ xor_mask; + InvalidateRect(_hwnd, NULL, TRUE); + } + return _display_version; + default: return super::WndProc(nmsg, wparam, lparam); } @@ -314,6 +295,38 @@ LRESULT BackgroundWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) return 0; } +void BackgroundWindow::DrawDesktopBkgnd(HDC hdc) +{ + PaintDesktop(hdc); + +/* special solid background + HBRUSH bkgndBrush = CreateSolidBrush(RGB(0,32,160)); // dark blue + FillRect(hdc, &rect, bkgndBrush); + DeleteBrush(bkgndBrush); +*/ + if (_display_version) { + ClientRect rect(_hwnd); + + rect.left = rect.right - 280; + rect.top = rect.bottom - 56 - DESKTOPBARBAR_HEIGHT; + rect.right = rect.left + 250; + rect.bottom = rect.top + 40; + + #include "../buildno.h" + static const LPCTSTR BkgndText = TEXT("ReactOS ")TEXT(KERNEL_VERSION_STR)TEXT(" Explorer\nby Martin Fuchs"); + + BkMode bkMode(hdc, TRANSPARENT); + + TextColor textColor(hdc, RGB(128,128,192)); + DrawText(hdc, BkgndText, -1, &rect, DT_RIGHT); + + SetTextColor(hdc, RGB(255,255,255)); + --rect.right; + ++rect.top; + DrawText(hdc, BkgndText, -1, &rect, DT_RIGHT); + } +} + DesktopWindow::DesktopWindow(HWND hwnd) : super(hwnd) @@ -436,10 +449,6 @@ LRESULT DesktopWindow::Init(LPCREATESTRUCT pcs) LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) { switch(nmsg) { - case WM_PAINT: - draw_desktop_background(_hwnd, PaintCanvas(_hwnd)); - break; - case WM_LBUTTONDBLCLK: case WM_RBUTTONDBLCLK: case WM_MBUTTONDBLCLK: @@ -554,6 +563,9 @@ LRESULT DesktopShellView::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) case PM_GET_ICON_ALGORITHM: return _icon_algo; + case PM_DISPLAY_VERSION: + return SendMessage(_hwndListView, nmsg, wparam, lparam); + default: return super::WndProc(nmsg, wparam, lparam); } diff --git a/reactos/subsys/system/explorer/desktop/desktop.h b/reactos/subsys/system/explorer/desktop/desktop.h index 25380afb55f..752a3de266f 100644 --- a/reactos/subsys/system/explorer/desktop/desktop.h +++ b/reactos/subsys/system/explorer/desktop/desktop.h @@ -28,6 +28,7 @@ #define PM_SET_ICON_ALGORITHM (WM_APP+0x19) #define PM_GET_ICON_ALGORITHM (WM_APP+0x1A) +#define PM_DISPLAY_VERSION (WM_APP+0x24) /// subclassed Background window behind the visible desktop window @@ -39,6 +40,10 @@ struct BackgroundWindow : public SubclassedWindow protected: LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + + void DrawDesktopBkgnd(HDC hdc); + + int _display_version; }; diff --git a/reactos/subsys/system/explorer/explorer_intres.h b/reactos/subsys/system/explorer/explorer_intres.h index 29fee0ad3a4..2c880508071 100644 --- a/reactos/subsys/system/explorer/explorer_intres.h +++ b/reactos/subsys/system/explorer/explorer_intres.h @@ -142,6 +142,7 @@ #define IDC_LABEL4 1023 #define ID_HIDE_INACTIVE_ICONS 1025 #define ID_SHOW_CLOCK 1026 +#define ID_DESKTOP_VERSION 1027 #define ID_REFRESH 1704 #define ID_ABOUT_WINEFILE 1705 #define IDC_FILETREE 10001 @@ -193,7 +194,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 166 #define _APS_NEXT_COMMAND_VALUE 40019 -#define _APS_NEXT_CONTROL_VALUE 1026 +#define _APS_NEXT_CONTROL_VALUE 1028 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/reactos/subsys/system/explorer/explorer_intres.rc b/reactos/subsys/system/explorer/explorer_intres.rc index a3f3eb07ba7..c8f6f558139 100644 --- a/reactos/subsys/system/explorer/explorer_intres.rc +++ b/reactos/subsys/system/explorer/explorer_intres.rc @@ -768,7 +768,7 @@ BEGIN WS_TABSTOP,7,25,130,33 END -IDD_DESKBAR_DESKTOP DIALOG DISCARDABLE 0, 0, 212, 172 +IDD_DESKBAR_DESKTOP DIALOG DISCARDABLE 0, 0, 212, 194 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Desktop Properties" FONT 8, "MS Sans Serif" @@ -799,22 +799,24 @@ BEGIN BS_BOTTOM | WS_TABSTOP,110,121,46,44 CONTROL "",IDC_ICON_ALIGN_11,"Button",BS_OWNERDRAW | BS_BOTTOM | WS_TABSTOP,159,121,46,44 + CONTROL "Display &Version Number",ID_DESKTOP_VERSION,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,177,91,10 END -IDD_DESKBAR_TASKBAR DIALOG DISCARDABLE 0, 0, 210, 154 +IDD_DESKBAR_TASKBAR DIALOG DISCARDABLE 0, 0, 210, 194 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Taskbar Properties" FONT 8, "MS Sans Serif" BEGIN CONTROL "show &clock",ID_SHOW_CLOCK,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,113,52,10 + WS_TABSTOP,7,152,52,10 CONTROL "&hide inactive notification icons", ID_HIDE_INACTIVE_ICONS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,7,135,111,10 - PUSHBUTTON "&Notifications...",ID_CONFIG_NOTIFYAREA,153,133,50,14 + WS_TABSTOP,7,174,111,10 + PUSHBUTTON "&Notifications...",ID_CONFIG_NOTIFYAREA,153,173,50,14 END -IDD_DESKBAR_STARTMENU DIALOG DISCARDABLE 0, 0, 210, 154 +IDD_DESKBAR_STARTMENU DIALOG DISCARDABLE 0, 0, 210, 194 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Startmenu Properties" FONT 8, "MS Sans Serif" @@ -826,7 +828,7 @@ STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW CAPTION "Configure Notification Icons" -FONT 8, "MS Sans Serif" +FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN CONTROL "Tree1",IDC_NOTIFY_ICONS,"SysTreeView32",TVS_HASLINES | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,193,31 @@ -872,7 +874,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 205 TOPMARGIN, 7 - BOTTOMMARGIN, 165 + BOTTOMMARGIN, 187 END IDD_DESKBAR_TASKBAR, DIALOG @@ -880,7 +882,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 203 TOPMARGIN, 7 - BOTTOMMARGIN, 147 + BOTTOMMARGIN, 187 END IDD_DESKBAR_STARTMENU, DIALOG @@ -888,7 +890,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 203 TOPMARGIN, 7 - BOTTOMMARGIN, 147 + BOTTOMMARGIN, 187 END IDD_NOTIFYAREA, DIALOG