mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:35:47 +00:00
[SHELL32] -Call CPlApplet export of control panel applets with the correct activation context.
svn path=/trunk/; revision=73794
This commit is contained in:
parent
78544a017e
commit
6f4d361e2f
2 changed files with 33 additions and 0 deletions
|
@ -53,6 +53,11 @@ void Control_UnloadApplet(CPlApplet* applet)
|
||||||
|
|
||||||
CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
|
CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
|
||||||
{
|
{
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
ACTCTXW ActCtx = {sizeof(ACTCTX), ACTCTX_FLAG_RESOURCE_NAME_VALID};
|
||||||
|
ULONG_PTR cookie;
|
||||||
|
BOOL bActivated;
|
||||||
|
#endif
|
||||||
CPlApplet* applet;
|
CPlApplet* applet;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
@ -80,6 +85,13 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
|
||||||
|
|
||||||
applet->hWnd = hWnd;
|
applet->hWnd = hWnd;
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
ActCtx.lpSource = applet->cmd;
|
||||||
|
ActCtx.lpResourceName = (LPCWSTR)123;
|
||||||
|
applet->hActCtx = CreateActCtx(&ActCtx);
|
||||||
|
bActivated = (applet->hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(applet->hActCtx, &cookie) : FALSE);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!(applet->hModule = LoadLibraryW(applet->cmd))) {
|
if (!(applet->hModule = LoadLibraryW(applet->cmd))) {
|
||||||
WARN("Cannot load control panel applet %s\n", debugstr_w(applet->cmd));
|
WARN("Cannot load control panel applet %s\n", debugstr_w(applet->cmd));
|
||||||
goto theError;
|
goto theError;
|
||||||
|
@ -171,6 +183,11 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
if (bActivated)
|
||||||
|
DeactivateActCtx(0, cookie);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
list_add_head( &panel->applets, &applet->entry );
|
list_add_head( &panel->applets, &applet->entry );
|
||||||
#endif
|
#endif
|
||||||
|
@ -805,6 +822,10 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
||||||
applet = Control_LoadApplet(hWnd, buffer, panel);
|
applet = Control_LoadApplet(hWnd, buffer, panel);
|
||||||
if (applet)
|
if (applet)
|
||||||
{
|
{
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
ULONG_PTR cookie;
|
||||||
|
BOOL bActivated;
|
||||||
|
#endif
|
||||||
/* we've been given a textual parameter (or none at all) */
|
/* we've been given a textual parameter (or none at all) */
|
||||||
if (sp == -1) {
|
if (sp == -1) {
|
||||||
while ((++sp) != applet->count) {
|
while ((++sp) != applet->count) {
|
||||||
|
@ -820,10 +841,20 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
||||||
sp = 0;
|
sp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
bActivated = (applet->hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(applet->hActCtx, &cookie) : FALSE);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!applet->proc(applet->hWnd, CPL_STARTWPARMSW, sp, (LPARAM)extraPmts))
|
if (!applet->proc(applet->hWnd, CPL_STARTWPARMSW, sp, (LPARAM)extraPmts))
|
||||||
applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].data);
|
applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].data);
|
||||||
|
|
||||||
Control_UnloadApplet(applet);
|
Control_UnloadApplet(applet);
|
||||||
|
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
if (bActivated)
|
||||||
|
DeactivateActCtx(0, cookie);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, buffer);
|
HeapFree(GetProcessHeap(), 0, buffer);
|
||||||
|
|
|
@ -41,6 +41,8 @@ struct applet_info
|
||||||
typedef struct CPlApplet {
|
typedef struct CPlApplet {
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
struct list entry;
|
struct list entry;
|
||||||
|
#else
|
||||||
|
HANDLE hActCtx;
|
||||||
#endif
|
#endif
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
LPWSTR cmd; /* path to applet */
|
LPWSTR cmd; /* path to applet */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue