mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 21:13:01 +00:00
[EXPLORER] -implement showing the start menu preview
svn path=/trunk/; revision=74243
This commit is contained in:
parent
73dff0f128
commit
b295df005d
2 changed files with 75 additions and 10 deletions
|
@ -51,6 +51,7 @@ IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL BITMAP "res/bmp/153.bmp"
|
||||||
IDB_SYSTRAYPROP_SHOW_SECONDS BITMAP "res/bmp/154.bmp"
|
IDB_SYSTRAYPROP_SHOW_SECONDS BITMAP "res/bmp/154.bmp"
|
||||||
IDB_SYSTRAYPROP_HIDE_SECONDS BITMAP "res/bmp/155.bmp"
|
IDB_SYSTRAYPROP_HIDE_SECONDS BITMAP "res/bmp/155.bmp"
|
||||||
IDB_STARTMENU BITMAP "res/bmp/158.bmp"
|
IDB_STARTMENU BITMAP "res/bmp/158.bmp"
|
||||||
|
IDB_STARTPREVIEW BITMAP "res/bmp/171.bmp" // We don't have a proper preview image for the modern start menu yet. Use the classic one so far.
|
||||||
IDB_STARTPREVIEW_CLASSIC BITMAP "res/bmp/171.bmp"
|
IDB_STARTPREVIEW_CLASSIC BITMAP "res/bmp/171.bmp"
|
||||||
IDB_SYSTRAYPROP_HIDE_CLOCK BITMAP "res/bmp/180.bmp"
|
IDB_SYSTRAYPROP_HIDE_CLOCK BITMAP "res/bmp/180.bmp"
|
||||||
IDB_SYSTRAYPROP_HIDE_NOCLOCK BITMAP "res/bmp/181.bmp"
|
IDB_SYSTRAYPROP_HIDE_NOCLOCK BITMAP "res/bmp/181.bmp"
|
||||||
|
|
|
@ -28,17 +28,18 @@ typedef struct _PROPSHEET_INFO
|
||||||
|
|
||||||
HBITMAP hTaskbarBitmap;
|
HBITMAP hTaskbarBitmap;
|
||||||
HBITMAP hTrayBitmap;
|
HBITMAP hTrayBitmap;
|
||||||
|
HBITMAP hStartBitmap;
|
||||||
} PROPSHEET_INFO, *PPROPSHEET_INFO;
|
} PROPSHEET_INFO, *PPROPSHEET_INFO;
|
||||||
|
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
UpdateTaskbarBitmap(PPROPSHEET_INFO pPropInfo)
|
UpdateBitmaps(PPROPSHEET_INFO pPropInfo)
|
||||||
{
|
{
|
||||||
HWND hwndLock, hwndHide, hwndGroup, hwndShowQL, hwndClock, hwndSeconds, hwndHideInactive;
|
HWND hwndLock, hwndHide, hwndGroup, hwndShowQL, hwndClock, hwndSeconds, hwndHideInactive, hwndModernStart, hwndClassicStart;
|
||||||
HWND hwndTaskbarBitmap, hwndTrayBitmap;
|
HWND hwndTaskbarBitmap, hwndTrayBitmap, hwndStartBitmap;
|
||||||
HWND hwndAdvancedButton;
|
HWND hwndCustomizeNotifyButton, hwndCustomizeClassicStartButton, hwndCustomizeModernStartButton;
|
||||||
BOOL bLock, bHide, bGroup, bShowQL, bShowClock, bShowSeconds, bHideInactive;
|
BOOL bLock, bHide, bGroup, bShowQL, bShowClock, bShowSeconds, bHideInactive;
|
||||||
LPTSTR lpTaskBarImageName = NULL, lpTrayImageName = NULL;
|
LPTSTR lpTaskBarImageName = NULL, lpTrayImageName = NULL, lpStartImageName = NULL;
|
||||||
BOOL bRet = FALSE;
|
BOOL bRet = FALSE;
|
||||||
|
|
||||||
hwndLock = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_LOCK);
|
hwndLock = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_LOCK);
|
||||||
|
@ -50,7 +51,15 @@ UpdateTaskbarBitmap(PPROPSHEET_INFO pPropInfo)
|
||||||
hwndSeconds = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_SECONDS);
|
hwndSeconds = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_SECONDS);
|
||||||
hwndHideInactive = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_HIDEICONS);
|
hwndHideInactive = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_HIDEICONS);
|
||||||
|
|
||||||
hwndAdvancedButton = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_ICONCUST);
|
hwndCustomizeNotifyButton = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_ICONCUST);
|
||||||
|
|
||||||
|
hwndModernStart = GetDlgItem(pPropInfo->hStartWnd, IDC_TASKBARPROP_STARTMENU);
|
||||||
|
hwndClassicStart = GetDlgItem(pPropInfo->hStartWnd, IDC_TASKBARPROP_STARTMENUCLASSIC);
|
||||||
|
|
||||||
|
hwndCustomizeClassicStartButton = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_STARTMENUCLASSICCUST);
|
||||||
|
hwndCustomizeModernStartButton = GetDlgItem(pPropInfo->hTaskbarWnd, IDC_TASKBARPROP_STARTMENUCUST);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (hwndLock && hwndHide && hwndGroup && hwndShowQL && hwndClock && hwndSeconds && hwndHideInactive)
|
if (hwndLock && hwndHide && hwndGroup && hwndShowQL && hwndClock && hwndSeconds && hwndHideInactive)
|
||||||
{
|
{
|
||||||
|
@ -112,7 +121,7 @@ UpdateTaskbarBitmap(PPROPSHEET_INFO pPropInfo)
|
||||||
|
|
||||||
if (bHideInactive)
|
if (bHideInactive)
|
||||||
{
|
{
|
||||||
EnableWindow(hwndAdvancedButton, TRUE);
|
EnableWindow(hwndCustomizeNotifyButton, TRUE);
|
||||||
if (bShowClock)
|
if (bShowClock)
|
||||||
{
|
{
|
||||||
EnableWindow(hwndSeconds, TRUE);
|
EnableWindow(hwndSeconds, TRUE);
|
||||||
|
@ -130,7 +139,7 @@ UpdateTaskbarBitmap(PPROPSHEET_INFO pPropInfo)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EnableWindow(hwndAdvancedButton, FALSE);
|
EnableWindow(hwndCustomizeNotifyButton, FALSE);
|
||||||
if (bShowClock)
|
if (bShowClock)
|
||||||
{
|
{
|
||||||
EnableWindow(hwndSeconds, TRUE);
|
EnableWindow(hwndSeconds, TRUE);
|
||||||
|
@ -175,6 +184,49 @@ UpdateTaskbarBitmap(PPROPSHEET_INFO pPropInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(hwndClassicStart && hwndModernStart)
|
||||||
|
{
|
||||||
|
if(SendMessage(hwndModernStart, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||||
|
{
|
||||||
|
EnableWindow(hwndCustomizeModernStartButton, TRUE);
|
||||||
|
EnableWindow(hwndCustomizeClassicStartButton, FALSE);
|
||||||
|
lpStartImageName = MAKEINTRESOURCEW(IDB_STARTPREVIEW);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EnableWindow(hwndCustomizeModernStartButton, FALSE);
|
||||||
|
EnableWindow(hwndCustomizeClassicStartButton, TRUE);
|
||||||
|
lpStartImageName = MAKEINTRESOURCEW(IDB_STARTPREVIEW_CLASSIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lpStartImageName)
|
||||||
|
{
|
||||||
|
if (pPropInfo->hStartBitmap)
|
||||||
|
{
|
||||||
|
DeleteObject(pPropInfo->hStartBitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
pPropInfo->hStartBitmap = (HBITMAP)LoadImageW(hExplorerInstance,
|
||||||
|
lpStartImageName,
|
||||||
|
IMAGE_BITMAP,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
LR_DEFAULTCOLOR);
|
||||||
|
if (pPropInfo->hStartBitmap)
|
||||||
|
{
|
||||||
|
hwndStartBitmap = GetDlgItem(pPropInfo->hStartWnd,
|
||||||
|
IDC_TASKBARPROP_STARTMENU_BITMAP);
|
||||||
|
if (hwndStartBitmap)
|
||||||
|
{
|
||||||
|
SendMessage(hwndStartBitmap,
|
||||||
|
STM_SETIMAGE,
|
||||||
|
IMAGE_BITMAP,
|
||||||
|
(LPARAM)pPropInfo->hStartBitmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +243,18 @@ OnCreateTaskbarPage(HWND hwnd,
|
||||||
// FIXME: check buttons
|
// FIXME: check buttons
|
||||||
CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, AdvancedSettings.bShowSeconds ? BST_CHECKED : BST_UNCHECKED);
|
CheckDlgButton(hwnd, IDC_TASKBARPROP_SECONDS, AdvancedSettings.bShowSeconds ? BST_CHECKED : BST_UNCHECKED);
|
||||||
|
|
||||||
UpdateTaskbarBitmap(pPropInfo);
|
UpdateBitmaps(pPropInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
OnCreateStartPage(HWND hwnd,
|
||||||
|
PPROPSHEET_INFO pPropInfo)
|
||||||
|
{
|
||||||
|
pPropInfo->hStartWnd = hwnd;
|
||||||
|
|
||||||
|
CheckDlgButton(hwnd, IDC_TASKBARPROP_STARTMENUCLASSIC, 1); // HACK: This has to be read from registry!
|
||||||
|
|
||||||
|
UpdateBitmaps(pPropInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
INT_PTR CALLBACK
|
INT_PTR CALLBACK
|
||||||
|
@ -228,7 +291,7 @@ TaskbarPageProc(HWND hwndDlg,
|
||||||
case IDC_TASKBARPROP_SECONDS:
|
case IDC_TASKBARPROP_SECONDS:
|
||||||
if (HIWORD(wParam) == BN_CLICKED)
|
if (HIWORD(wParam) == BN_CLICKED)
|
||||||
{
|
{
|
||||||
UpdateTaskbarBitmap(pPropInfo);
|
UpdateBitmaps(pPropInfo);
|
||||||
|
|
||||||
/* Enable the 'Apply' button */
|
/* Enable the 'Apply' button */
|
||||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||||
|
@ -286,6 +349,7 @@ StartMenuPageProc(HWND hwndDlg,
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
|
OnCreateStartPage(hwndDlg, (PPROPSHEET_INFO)((LPPROPSHEETPAGE)lParam)->lParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue