Author: gadamopoulos
Date: Mon Feb 13 22:09:14 2017
New Revision: 73794
URL:
http://svn.reactos.org/svn/reactos?rev=73794&view=rev
Log:
[SHELL32] -Call CPlApplet export of control panel applets with the correct activation
context.
Modified:
trunk/reactos/dll/win32/shell32/wine/control.c
trunk/reactos/dll/win32/shell32/wine/cpanel.h
Modified: trunk/reactos/dll/win32/shell32/wine/control.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/wine/con…
==============================================================================
--- trunk/reactos/dll/win32/shell32/wine/control.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/wine/control.c [iso-8859-1] Mon Feb 13 22:09:14 2017
@@ -53,6 +53,11 @@
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;
DWORD len;
unsigned i;
@@ -79,6 +84,13 @@
}
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))) {
WARN("Cannot load control panel applet %s\n",
debugstr_w(applet->cmd));
@@ -171,6 +183,11 @@
}
}
+#ifdef __REACTOS__
+ if (bActivated)
+ DeactivateActCtx(0, cookie);
+#endif
+
#ifndef __REACTOS__
list_add_head( &panel->applets, &applet->entry );
#endif
@@ -805,6 +822,10 @@
applet = Control_LoadApplet(hWnd, buffer, panel);
if (applet)
{
+#ifdef __REACTOS__
+ ULONG_PTR cookie;
+ BOOL bActivated;
+#endif
/* we've been given a textual parameter (or none at all) */
if (sp == -1) {
while ((++sp) != applet->count) {
@@ -820,10 +841,20 @@
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))
applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].data);
Control_UnloadApplet(applet);
+
+#ifdef __REACTOS__
+ if (bActivated)
+ DeactivateActCtx(0, cookie);
+#endif
+
}
HeapFree(GetProcessHeap(), 0, buffer);
Modified: trunk/reactos/dll/win32/shell32/wine/cpanel.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/wine/cpa…
==============================================================================
--- trunk/reactos/dll/win32/shell32/wine/cpanel.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/wine/cpanel.h [iso-8859-1] Mon Feb 13 22:09:14 2017
@@ -41,6 +41,8 @@
typedef struct CPlApplet {
#ifndef __REACTOS__
struct list entry;
+#else
+ HANDLE hActCtx;
#endif
HWND hWnd;
LPWSTR cmd; /* path to applet */