2 * Internet control panel applet
4 * Copyright 2010 Detlef Riekenberg
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #define NONAMELESSUNION
35 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(inetcpl
);
42 DECLSPEC_HIDDEN HMODULE hcpl
;
44 /*********************************************************************
47 BOOL WINAPI
DllMain(HINSTANCE hdll
, DWORD reason
, LPVOID reserved
)
49 TRACE("(%p, %d, %p)\n", hdll
, reason
, reserved
);
54 case DLL_WINE_PREATTACH
:
55 return FALSE
; /* prefer native version */
58 case DLL_PROCESS_ATTACH
:
59 DisableThreadLibraryCalls(hdll
);
65 /***********************************************************************
66 * DllInstall (inetcpl.@)
68 HRESULT WINAPI
DllInstall(BOOL bInstall
, LPCWSTR cmdline
)
70 FIXME("(%s, %s): stub\n", bInstall
? "TRUE" : "FALSE", debugstr_w(cmdline
));
74 /******************************************************************************
75 * propsheet_callback [internal]
78 static int CALLBACK
propsheet_callback(HWND hwnd
, UINT msg
, LPARAM lparam
)
81 // NOTE: This callback is needed to set large icon correctly.
84 TRACE("(%p, 0x%08x/%d, 0x%lx)\n", hwnd
, msg
, msg
, lparam
);
87 case PSCB_INITIALIZED
:
90 hIcon
= LoadIconW(hcpl
, MAKEINTRESOURCEW(ICO_MAIN
));
91 SendMessageW(hwnd
, WM_SETICON
, ICON_BIG
, (LPARAM
)hIcon
);
95 SendMessageW(hwnd
, WM_SETICON
, ICON_BIG
, (LPARAM
) LoadIconW(hcpl
, MAKEINTRESOURCEW(ICO_MAIN
)));
102 /******************************************************************************
103 * display_cpl_sheets [internal]
105 * Build and display the dialog with all control panel propertysheets
108 static void display_cpl_sheets(HWND parent
)
110 INITCOMMONCONTROLSEX icex
;
111 PROPSHEETPAGEW psp
[NUM_PROPERTY_PAGES
];
112 PROPSHEETHEADERW psh
;
116 /* Initialize common controls */
117 icex
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
118 icex
.dwICC
= ICC_LISTVIEW_CLASSES
| ICC_BAR_CLASSES
;
119 InitCommonControlsEx(&icex
);
121 ZeroMemory(&psh
, sizeof(psh
));
122 ZeroMemory(psp
, sizeof(psp
));
124 /* Fill out all PROPSHEETPAGE */
125 psp
[id
].dwSize
= sizeof (PROPSHEETPAGEW
);
126 psp
[id
].hInstance
= hcpl
;
127 psp
[id
].u
.pszTemplate
= MAKEINTRESOURCEW(IDD_GENERAL
);
128 psp
[id
].pfnDlgProc
= general_dlgproc
;
131 psp
[id
].dwSize
= sizeof (PROPSHEETPAGEW
);
132 psp
[id
].hInstance
= hcpl
;
133 psp
[id
].u
.pszTemplate
= MAKEINTRESOURCEW(IDD_SECURITY
);
134 psp
[id
].pfnDlgProc
= security_dlgproc
;
137 psp
[id
].dwSize
= sizeof (PROPSHEETPAGEW
);
138 psp
[id
].hInstance
= hcpl
;
139 psp
[id
].u
.pszTemplate
= MAKEINTRESOURCEW(IDD_CONTENT
);
140 psp
[id
].pfnDlgProc
= content_dlgproc
;
143 psp
[id
].dwSize
= sizeof (PROPSHEETPAGEW
);
144 psp
[id
].hInstance
= hcpl
;
145 psp
[id
].u
.pszTemplate
= MAKEINTRESOURCEW(IDD_CONNECTIONS
);
146 psp
[id
].pfnDlgProc
= connections_dlgproc
;
149 /* Fill out the PROPSHEETHEADER */
150 psh
.dwSize
= sizeof (PROPSHEETHEADERW
);
151 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_USEICONID
| PSH_USECALLBACK
;
152 psh
.hwndParent
= parent
;
153 psh
.hInstance
= hcpl
;
154 psh
.u
.pszIcon
= MAKEINTRESOURCEW(ICO_MAIN
);
155 psh
.pszCaption
= MAKEINTRESOURCEW(IDS_CPL_NAME
);
158 psh
.pfnCallback
= propsheet_callback
;
160 /* display the dialog */
161 PropertySheetW(&psh
);
166 /*********************************************************************
167 * CPlApplet (inetcpl.@)
169 * Control Panel entry point
172 * hWnd [I] Handle for the Control Panel Window
173 * command [I] CPL_* Command
174 * lParam1 [I] first extra Parameter
175 * lParam2 [I] second extra Parameter
178 * Depends on the command
181 LONG CALLBACK
CPlApplet(HWND hWnd
, UINT command
, LPARAM lParam1
, LPARAM lParam2
)
183 TRACE("(%p, %u, 0x%lx, 0x%lx)\n", hWnd
, command
, lParam1
, lParam2
);
195 CPLINFO
*appletInfo
= (CPLINFO
*) lParam2
;
197 appletInfo
->idIcon
= ICO_MAIN
;
198 appletInfo
->idName
= IDS_CPL_NAME
;
199 appletInfo
->idInfo
= IDS_CPL_INFO
;
200 appletInfo
->lData
= 0;
205 display_cpl_sheets(hWnd
);
212 /*********************************************************************
213 * LaunchInternetControlPanel (inetcpl.@)
215 * Launch the Internet Control Panel dialog
218 * parent [I] Handle for the parent window
224 * rundll32 callable function: rundll32 inetcpl.cpl,LaunchInternetControlPanel
227 BOOL WINAPI
LaunchInternetControlPanel(HWND parent
)
229 display_cpl_sheets(parent
);
233 /*********************************************************************
234 * LaunchConnectionDialog (inetcpl.@)
237 BOOL WINAPI
LaunchConnectionDialog(HWND hParent
)
239 FIXME("(%p): stub\n", hParent
);
243 /*********************************************************************
244 * LaunchInternetControlPanel (inetcpl.@)
247 BOOL WINAPI
LaunchPrivacyDialog(HWND hParent
)
249 FIXME("(%p): stub\n", hParent
);