Author: rnaumann
Date: Tue Nov 24 21:43:07 2015
New Revision: 70102
URL:
http://svn.reactos.org/svn/reactos?rev=70102&view=rev
Log:
[EXPLORER] -Fix a parameter of OnCreateTaskbarPage(). Fix by Mark Jansen
-Implement showing the notification area preview images. CORE-10560
Modified:
trunk/reactos/base/shell/explorer/trayprop.cpp
Modified: trunk/reactos/base/shell/explorer/trayprop.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/traypr…
==============================================================================
--- trunk/reactos/base/shell/explorer/trayprop.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/trayprop.cpp [iso-8859-1] Tue Nov 24 21:43:07 2015
@@ -2,6 +2,7 @@
* ReactOS Explorer
*
* Copyright 2006 - 2007 Thomas Weidenmueller <w3seek(a)reactos.org>
+ * 2015 Robert Naumann <gonzomdx(a)gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -24,54 +25,62 @@
{
HWND hTaskbarWnd;
HWND hStartWnd;
- HWND hNotiWnd;
- HWND hToolWnd;
HBITMAP hTaskbarBitmap;
+ HBITMAP hTrayBitmap;
} PROPSHEET_INFO, *PPROPSHEET_INFO;
static BOOL
UpdateTaskbarBitmap(PPROPSHEET_INFO pPropInfo)
{
- HWND hwndLock, hwndHide, hwndGroup, hwndShowQL;
- HWND hwndBitmap;
- BOOL bLock, bHide, bGroup, bShowQL;
- LPTSTR lpImageName = NULL;
+ HWND hwndLock, hwndHide, hwndGroup, hwndShowQL, hwndClock, hwndSeconds,
hwndHideInactive;
+ HWND hwndTaskbarBitmap, hwndTrayBitmap;
+ BOOL bLock, bHide, bGroup, bShowQL, bShowClock, bShowSeconds, bHideInactive;
+ LPTSTR lpTaskBarImageName = NULL, lpTrayImageName = NULL;
BOOL bRet = FALSE;
hwndLock = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_LOCK);
hwndHide = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_HIDE);
hwndGroup = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_GROUP);
hwndShowQL = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_SHOWQL);
-
- if (hwndLock && hwndHide && hwndGroup && hwndShowQL)
+
+ hwndClock = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_CLOCK);
+ hwndSeconds = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_SECONDS);
+ hwndHideInactive = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_HIDEICONS);
+
+ if (hwndLock && hwndHide && hwndGroup && hwndShowQL
&& hwndClock && hwndSeconds && hwndHideInactive)
{
bLock = (SendMessage(hwndLock, BM_GETCHECK, 0, 0) == BST_CHECKED);
bHide = (SendMessage(hwndHide, BM_GETCHECK, 0, 0) == BST_CHECKED);
bGroup = (SendMessage(hwndGroup, BM_GETCHECK, 0, 0) == BST_CHECKED);
bShowQL = (SendMessage(hwndShowQL, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+ bShowClock = (SendMessage(hwndClock, BM_GETCHECK, 0, 0) == BST_CHECKED);
+ bShowSeconds = (SendMessage(hwndSeconds, BM_GETCHECK, 0, 0) == BST_CHECKED);
+ bHideInactive = (SendMessage(hwndHideInactive, BM_GETCHECK, 0, 0) ==
BST_CHECKED);
if (bHide)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_AUTOHIDE);
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_AUTOHIDE);
else if (bLock && bGroup && bShowQL)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_GROUP_QL);
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_GROUP_QL);
else if (bLock && !bGroup && !bShowQL)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_NOGROUP_NOQL);
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_NOGROUP_NOQL);
else if (bLock && bGroup && !bShowQL)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_GROUP_NOQL);
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_GROUP_NOQL);
else if (bLock && !bGroup && bShowQL)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_NOGROUP_QL);
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_LOCK_NOGROUP_QL);
else if (!bLock && !bGroup && !bShowQL)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL);
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL);
else if (!bLock && bGroup && !bShowQL)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_GROUP_NOQL);
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_GROUP_NOQL);
else if (!bLock && !bGroup && bShowQL)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_NOGROUP_QL);
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_NOGROUP_QL);
else if (!bLock && bGroup && bShowQL)
- lpImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_GROUP_QL);
-
- if (lpImageName)
+ lpTaskBarImageName = MAKEINTRESOURCE(IDB_TASKBARPROP_NOLOCK_GROUP_QL);
+
+
+ if (lpTaskBarImageName)
{
if (pPropInfo->hTaskbarBitmap)
{
@@ -79,21 +88,83 @@
}
pPropInfo->hTaskbarBitmap = (HBITMAP)LoadImage(hExplorerInstance,
- lpImageName,
+ lpTaskBarImageName,
IMAGE_BITMAP,
0,
0,
LR_DEFAULTCOLOR);
if (pPropInfo->hTaskbarBitmap)
{
- hwndBitmap = GetDlgItem(pPropInfo->hTaskbarWnd,
+ hwndTaskbarBitmap = GetDlgItem(pPropInfo->hTaskbarWnd,
IDC_TASKBARPROP_TASKBARBITMAP);
- if (hwndBitmap)
+ if (hwndTaskbarBitmap)
{
- SendMessage(hwndBitmap,
+ SendMessage(hwndTaskbarBitmap,
STM_SETIMAGE,
IMAGE_BITMAP,
(LPARAM)pPropInfo->hTaskbarBitmap);
+ }
+ }
+ }
+
+ if (bHideInactive)
+ {
+ /* FIXME: when the customize button is disabled, enable it. */
+ if(bShowClock)
+ {
+ /* FIXME: when the seconds checkbox is disabled, enable it. */
+ if(bShowSeconds)
+ lpTrayImageName = MAKEINTRESOURCE(IDB_SYSTRAYPROP_HIDE_SECONDS);
+ else
+ lpTrayImageName = MAKEINTRESOURCE(IDB_SYSTRAYPROP_HIDE_CLOCK);
+ }
+ else
+ {
+ /* FIXME: when the seconds checkbox is enabled, disable it it. */
+ lpTrayImageName = MAKEINTRESOURCE(IDB_SYSTRAYPROP_HIDE_NOCLOCK);
+ }
+ }
+ else
+ {
+ /* FIXME: when the customize button is enabled, disable it. */
+ if(bShowClock)
+ {
+ /* FIXME: when the seconds checkbox is disabled, enable it. */
+ if(bShowSeconds)
+ lpTrayImageName = MAKEINTRESOURCE(IDB_SYSTRAYPROP_SHOW_SECONDS);
+ else
+ lpTrayImageName = MAKEINTRESOURCE(IDB_SYSTRAYPROP_SHOW_CLOCK);
+ }
+ else
+ {
+ /* FIXME: when the seconds checkbox is enabled, disable it it. */
+ lpTrayImageName = MAKEINTRESOURCE(IDB_SYSTRAYPROP_SHOW_NOCLOCK);
+ }
+ }
+
+ if(lpTrayImageName)
+ {
+ if (pPropInfo->hTrayBitmap)
+ {
+ DeleteObject(pPropInfo->hTrayBitmap);
+ }
+
+ pPropInfo->hTrayBitmap = (HBITMAP)LoadImage(hExplorerInstance,
+ lpTrayImageName,
+ IMAGE_BITMAP,
+ 0,
+ 0,
+ LR_DEFAULTCOLOR);
+ if (pPropInfo->hTrayBitmap)
+ {
+ hwndTrayBitmap = GetDlgItem(pPropInfo->hTaskbarWnd,
+ IDC_TASKBARPROP_NOTIFICATIONBITMAP);
+ if (hwndTrayBitmap)
+ {
+ SendMessage(hwndTrayBitmap,
+ STM_SETIMAGE,
+ IMAGE_BITMAP,
+ (LPARAM)pPropInfo->hTrayBitmap);
}
}
}
@@ -136,7 +207,7 @@
switch (uMsg)
{
case WM_INITDIALOG:
- OnCreateTaskbarPage(hwndDlg, (PPROPSHEET_INFO)lParam);
+ OnCreateTaskbarPage(hwndDlg,
(PPROPSHEET_INFO)((LPPROPSHEETPAGE)lParam)->lParam);
break;
case WM_COMMAND:
@@ -146,6 +217,9 @@
case IDC_TASKBARPROP_HIDE:
case IDC_TASKBARPROP_GROUP:
case IDC_TASKBARPROP_SHOWQL:
+ case IDC_TASKBARPROP_HIDEICONS:
+ case IDC_TASKBARPROP_CLOCK:
+ case IDC_TASKBARPROP_SECONDS:
if (HIWORD(wParam) == BN_CLICKED)
{
UpdateTaskbarBitmap(pPropInfo);
@@ -177,6 +251,10 @@
if (pPropInfo->hTaskbarBitmap)
{
DeleteObject(pPropInfo->hTaskbarBitmap);
+ }
+ if (pPropInfo->hTrayBitmap)
+ {
+ DeleteObject(pPropInfo->hTrayBitmap);
}
break;