mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:16:07 +00:00
[SHELL32] Show system control applet in taskbar (#4437)
Display the control panel applet in the taskbar to allow better navigation between programs. CORE-18137 This is proceeded by manipulating the window of the current instance of 'rundll32.exe': - Set title text - Set icon - Show window (minimal) - Engaging the corresponding button in the Taskbar.
This commit is contained in:
parent
b57be0a746
commit
1461ca403f
1 changed files with 40 additions and 0 deletions
|
@ -29,6 +29,8 @@
|
||||||
#define NO_SHLWAPI_REG
|
#define NO_SHLWAPI_REG
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
|
#define COBJMACROS
|
||||||
|
#include <shobjidl.h>
|
||||||
#include <wine/debug.h>
|
#include <wine/debug.h>
|
||||||
|
|
||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
|
@ -804,6 +806,43 @@ Control_EnumWinProc(
|
||||||
}
|
}
|
||||||
return TRUE; // continue enumeration
|
return TRUE; // continue enumeration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function makes the system control applet accessible via the taskbar.
|
||||||
|
*
|
||||||
|
* @param applet
|
||||||
|
* Pointer of system control applet.
|
||||||
|
*
|
||||||
|
* @param index
|
||||||
|
* Number of applet in a system control library.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
Control_ShowAppletInTaskbar(CPlApplet* applet, UINT index)
|
||||||
|
{
|
||||||
|
ITaskbarList* pTaskbar = NULL;
|
||||||
|
|
||||||
|
SetWindowTextW(applet->hWnd, applet->info[index].name);
|
||||||
|
SendMessageW(applet->hWnd, WM_SETICON, ICON_SMALL, (LPARAM)applet->info[index].icon);
|
||||||
|
|
||||||
|
/* Add button to the taskbar */
|
||||||
|
ShowWindow(applet->hWnd, SW_SHOWMINNOACTIVE);
|
||||||
|
|
||||||
|
/* Activate the corresponding button in the taskbar */
|
||||||
|
CoInitialize(NULL);
|
||||||
|
if (CoCreateInstance(&CLSID_TaskbarList,
|
||||||
|
NULL, CLSCTX_INPROC_SERVER,
|
||||||
|
&IID_ITaskbarList,
|
||||||
|
(LPVOID*)&pTaskbar) == S_OK)
|
||||||
|
{
|
||||||
|
if (ITaskbarList_HrInit(pTaskbar) == S_OK)
|
||||||
|
{
|
||||||
|
ITaskbarList_ActivateTab(pTaskbar, applet->hWnd);
|
||||||
|
}
|
||||||
|
ITaskbarList_Release(pTaskbar);
|
||||||
|
}
|
||||||
|
CoUninitialize();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __REACTOS__ */
|
#endif /* __REACTOS__ */
|
||||||
|
|
||||||
static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
||||||
|
@ -956,6 +995,7 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
||||||
{
|
{
|
||||||
SetPropW(applet->hWnd, (LPTSTR)MAKEINTATOM(aCPLName), (HANDLE)MAKEINTATOM(aCPLPath));
|
SetPropW(applet->hWnd, (LPTSTR)MAKEINTATOM(aCPLName), (HANDLE)MAKEINTATOM(aCPLPath));
|
||||||
SetPropW(applet->hWnd, (LPTSTR)MAKEINTATOM(aCPLFlags), UlongToHandle(sp + 1));
|
SetPropW(applet->hWnd, (LPTSTR)MAKEINTATOM(aCPLFlags), UlongToHandle(sp + 1));
|
||||||
|
Control_ShowAppletInTaskbar(applet, sp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!applet->proc(applet->hWnd, CPL_STARTWPARMSW, sp, (LPARAM)extraPmts))
|
if (!applet->proc(applet->hWnd, CPL_STARTWPARMSW, sp, (LPARAM)extraPmts))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue