Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1eca313f
Commit
1eca313f
authored
Jul 20, 2009
by
Owen Rudge
Committed by
Alexandre Julliard
Jul 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Execute control panel applets in separate process.
parent
bd926bde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
14 deletions
+25
-14
control.c
dlls/shell32/control.c
+24
-14
cpanel.h
dlls/shell32/cpanel.h
+1
-0
No files found.
dlls/shell32/control.c
View file @
1eca313f
...
...
@@ -59,6 +59,7 @@ CPlApplet* Control_UnloadApplet(CPlApplet* applet)
if
(
applet
->
proc
)
applet
->
proc
(
applet
->
hWnd
,
CPL_EXIT
,
0L
,
0L
);
FreeLibrary
(
applet
->
hModule
);
next
=
applet
->
next
;
HeapFree
(
GetProcessHeap
(),
0
,
applet
->
cmd
);
HeapFree
(
GetProcessHeap
(),
0
,
applet
);
return
next
;
}
...
...
@@ -95,6 +96,13 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
applet
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
applet
,
sizeof
(
*
applet
)
+
(
applet
->
count
-
1
)
*
sizeof
(
NEWCPLINFOW
));
if
(
!
(
applet
->
cmd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
cmd
)
+
1
)
*
sizeof
(
WCHAR
))))
{
WARN
(
"Cannot allocate memory for applet path"
);
goto
theError
;
}
lstrcpyW
(
applet
->
cmd
,
cmd
);
for
(
i
=
0
;
i
<
applet
->
count
;
i
++
)
{
ZeroMemory
(
&
newinfo
,
sizeof
(
newinfo
));
newinfo
.
dwSize
=
sizeof
(
NEWCPLINFOA
);
...
...
@@ -426,6 +434,20 @@ static CPlItem* Control_GetCPlItem_From_ListView(CPanel *panel)
return
NULL
;
}
static
void
Control_StartApplet
(
HWND
hWnd
,
CPlItem
*
item
)
{
WCHAR
verbOpen
[]
=
{
'c'
,
'p'
,
'l'
,
'o'
,
'p'
,
'e'
,
'n'
,
0
};
WCHAR
format
[]
=
{
'@'
,
'%'
,
'd'
,
0
};
WCHAR
param
[
MAX_PATH
];
/* execute the applet if item is valid */
if
(
item
)
{
wsprintfW
(
param
,
format
,
item
->
id
);
ShellExecuteW
(
hWnd
,
verbOpen
,
item
->
applet
->
cmd
,
param
,
NULL
,
SW_SHOW
);
}
}
static
LRESULT
WINAPI
Control_WndProc
(
HWND
hWnd
,
UINT
wMsg
,
WPARAM
lParam1
,
LPARAM
lParam2
)
{
...
...
@@ -484,13 +506,7 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
if
((
LOWORD
(
lParam1
)
>=
IDM_CPANEL_APPLET_BASE
)
&&
(
LOWORD
(
lParam1
)
<=
IDM_CPANEL_APPLET_BASE
+
panel
->
total_subprogs
))
{
CPlItem
*
item
=
Control_GetCPlItem_From_MenuID
(
hWnd
,
LOWORD
(
lParam1
));
/* execute the applet if item is valid */
if
(
item
)
item
->
applet
->
proc
(
item
->
applet
->
hWnd
,
CPL_DBLCLK
,
item
->
id
,
item
->
applet
->
info
[
item
->
id
].
lData
);
Control_StartApplet
(
hWnd
,
Control_GetCPlItem_From_MenuID
(
hWnd
,
LOWORD
(
lParam1
)));
return
0
;
}
...
...
@@ -511,13 +527,7 @@ static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg,
case
NM_RETURN
:
case
NM_DBLCLK
:
{
CPlItem
*
item
=
Control_GetCPlItem_From_ListView
(
panel
);
/* execute the applet if item is valid */
if
(
item
)
item
->
applet
->
proc
(
item
->
applet
->
hWnd
,
CPL_DBLCLK
,
item
->
id
,
item
->
applet
->
info
[
item
->
id
].
lData
);
Control_StartApplet
(
hWnd
,
Control_GetCPlItem_From_ListView
(
panel
));
return
0
;
}
case
LVN_ITEMCHANGED
:
...
...
dlls/shell32/cpanel.h
View file @
1eca313f
...
...
@@ -26,6 +26,7 @@
typedef
struct
CPlApplet
{
struct
CPlApplet
*
next
;
/* linked list */
HWND
hWnd
;
LPWSTR
cmd
;
/* path to applet */
unsigned
count
;
/* number of subprograms */
HMODULE
hModule
;
/* module of loaded applet */
APPLET_PROC
proc
;
/* entry point address */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment