ReactOS  0.4.14-dev-50-g13bb5e2
inetcpl.c
Go to the documentation of this file.
1 /*
2  * Internet control panel applet
3  *
4  * Copyright 2010 Detlef Riekenberg
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21 
22 #define NONAMELESSUNION
23 #define COBJMACROS
24 #define CONST_VTABLE
25 
26 #include <stdarg.h>
27 #include <windef.h>
28 #include <winbase.h>
29 #include <wingdi.h>
30 #include <winuser.h>
31 #include <commctrl.h>
32 #include <cpl.h>
33 #include "ole2.h"
34 
35 #include "wine/debug.h"
36 
37 #include "inetcpl.h"
38 
39 
41 
43 
44 /*********************************************************************
45  * DllMain (inetcpl.@)
46  */
48 {
49  TRACE("(%p, %d, %p)\n", hdll, reason, reserved);
50 
51  switch (reason)
52  {
53 #ifndef __REACTOS__
54  case DLL_WINE_PREATTACH:
55  return FALSE; /* prefer native version */
56 #endif
57 
58  case DLL_PROCESS_ATTACH:
60  hcpl = hdll;
61  }
62  return TRUE;
63 }
64 
65 /***********************************************************************
66  * DllInstall (inetcpl.@)
67  */
69 {
70  FIXME("(%s, %s): stub\n", bInstall ? "TRUE" : "FALSE", debugstr_w(cmdline));
71  return S_OK;
72 }
73 
74 /******************************************************************************
75  * propsheet_callback [internal]
76  *
77  */
79 {
80  // NOTE: This callback is needed to set large icon correctly.
81  HICON hIcon;
82  TRACE("(%p, 0x%08x/%d, 0x%lx)\n", hwnd, msg, msg, lparam);
83  switch (msg)
84  {
85  case PSCB_INITIALIZED:
86  {
88  SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
89  break;
90  }
91  }
92  return 0;
93 }
94 
95 /******************************************************************************
96  * display_cpl_sheets [internal]
97  *
98  * Build and display the dialog with all control panel propertysheets
99  *
100  */
102 {
105  PROPSHEETHEADERW psh;
106  DWORD id = 0;
107 
109  /* Initialize common controls */
110  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
112  InitCommonControlsEx(&icex);
113 
114  ZeroMemory(&psh, sizeof(psh));
115  ZeroMemory(psp, sizeof(psp));
116 
117  /* Fill out all PROPSHEETPAGE */
118  psp[id].dwSize = sizeof (PROPSHEETPAGEW);
119  psp[id].hInstance = hcpl;
122  id++;
123 
124  psp[id].dwSize = sizeof (PROPSHEETPAGEW);
125  psp[id].hInstance = hcpl;
128  id++;
129 
130  psp[id].dwSize = sizeof (PROPSHEETPAGEW);
131  psp[id].hInstance = hcpl;
134  id++;
135 
136  psp[id].dwSize = sizeof (PROPSHEETPAGEW);
137  psp[id].hInstance = hcpl;
140  id++;
141 
142  /* Fill out the PROPSHEETHEADER */
143  psh.dwSize = sizeof (PROPSHEETHEADERW);
145  psh.hwndParent = parent;
146  psh.hInstance = hcpl;
149  psh.nPages = id;
150  psh.u3.ppsp = psp;
152 
153  /* display the dialog */
154  PropertySheetW(&psh);
155 
156  OleUninitialize();
157 }
158 
159 /*********************************************************************
160  * CPlApplet (inetcpl.@)
161  *
162  * Control Panel entry point
163  *
164  * PARAMS
165  * hWnd [I] Handle for the Control Panel Window
166  * command [I] CPL_* Command
167  * lParam1 [I] first extra Parameter
168  * lParam2 [I] second extra Parameter
169  *
170  * RETURNS
171  * Depends on the command
172  *
173  */
175 {
176  TRACE("(%p, %u, 0x%lx, 0x%lx)\n", hWnd, command, lParam1, lParam2);
177 
178  switch (command)
179  {
180  case CPL_INIT:
181  return TRUE;
182 
183  case CPL_GETCOUNT:
184  return 1;
185 
186  case CPL_INQUIRE:
187  {
188  CPLINFO *appletInfo = (CPLINFO *) lParam2;
189 
190  appletInfo->idIcon = ICO_MAIN;
191  appletInfo->idName = IDS_CPL_NAME;
192  appletInfo->idInfo = IDS_CPL_INFO;
193  appletInfo->lData = 0;
194  return TRUE;
195  }
196 
197  case CPL_DBLCLK:
199  break;
200  }
201 
202  return FALSE;
203 }
204 
205 /*********************************************************************
206  * LaunchInternetControlPanel (inetcpl.@)
207  *
208  * Launch the Internet Control Panel dialog
209  *
210  * PARAMS
211  * parent [I] Handle for the parent window
212  *
213  * RETURNS
214  * Success: TRUE
215  *
216  * NOTES
217  * rundll32 callable function: rundll32 inetcpl.cpl,LaunchInternetControlPanel
218  *
219  */
221 {
223  return TRUE;
224 }
225 
226 /*********************************************************************
227  * LaunchConnectionDialog (inetcpl.@)
228  *
229  */
231 {
232  FIXME("(%p): stub\n", hParent);
233  return FALSE;
234 }
235 
236 /*********************************************************************
237  * LaunchInternetControlPanel (inetcpl.@)
238  *
239  */
241 {
242  FIXME("(%p): stub\n", hParent);
243  return FALSE;
244 }
LONG CALLBACK CPlApplet(HWND hWnd, UINT command, LPARAM lParam1, LPARAM lParam2)
Definition: inetcpl.c:174
HWND hwndParent
Definition: prsht.h:277
BOOL WINAPI LaunchPrivacyDialog(HWND hParent)
Definition: inetcpl.c:240
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:290
Definition: cpl.h:24
LPCWSTR pszTemplate
Definition: prsht.h:209
INT_PTR CALLBACK security_dlgproc(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN
Definition: security.c:410
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CALLBACK
Definition: compat.h:27
#define IDD_CONNECTIONS
Definition: inetcpl.h:95
HWND hWnd
Definition: settings.c:17
#define IDD_GENERAL
Definition: resource.h:12
int idInfo
Definition: cpl.h:27
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define ZeroMemory
Definition: winbase.h:1635
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
TCHAR * cmdline
Definition: stretchblt.cpp:32
struct _PROPSHEETHEADERW PROPSHEETHEADERW
#define PSH_USECALLBACK
Definition: prsht.h:48
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
Definition: inetcpl.c:68
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
BOOL WINAPI LaunchConnectionDialog(HWND hParent)
Definition: inetcpl.c:230
BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
Definition: inetcpl.c:47
int idIcon
Definition: cpl.h:25
#define CPL_DBLCLK
Definition: cpl.h:16
DWORD dwSize
Definition: prsht.h:205
#define PSH_USEICONID
Definition: prsht.h:42
#define ICO_MAIN
Definition: inetcpl.h:38
LPCWSTR pszCaption
Definition: prsht.h:283
unsigned int BOOL
Definition: ntddk_ex.h:94
DLGPROC pfnDlgProc
Definition: prsht.h:217
long LONG
Definition: pedump.c:60
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
r reserved
Definition: btrfs.c:2893
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:293
struct _PROPSHEETPAGEW PROPSHEETPAGEW
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2902
#define IDD_SECURITY
Definition: inetcpl.h:83
#define NUM_PROPERTY_PAGES
Definition: inetcpl.h:35
#define IDD_CONTENT
Definition: inetcpl.h:91
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define TRACE(s)
Definition: solgame.cpp:4
INT_PTR CALLBACK connections_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: connections.c:349
r parent
Definition: btrfs.c:2897
LONG HRESULT
Definition: typedefs.h:77
HINSTANCE hInstance
Definition: prsht.h:278
#define IDS_CPL_NAME
Definition: inetcpl.h:49
#define WINAPI
Definition: msvc.h:8
LPCWSTR pszIcon
Definition: prsht.h:281
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwSize
Definition: prsht.h:275
DWORD dwFlags
Definition: prsht.h:276
#define CPL_INIT
Definition: cpl.h:12
BOOL WINAPI LaunchInternetControlPanel(HWND parent)
Definition: inetcpl.c:220
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define CPL_INQUIRE
Definition: cpl.h:14
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
HINSTANCE hInstance
Definition: prsht.h:207
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
INT_PTR CALLBACK content_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: content.c:78
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:172
#define S_OK
Definition: intsafe.h:59
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
#define PSCB_INITIALIZED
Definition: prsht.h:75
static int CALLBACK propsheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
Definition: inetcpl.c:78
HICON hIcon
Definition: msconfig.c:44
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void display_cpl_sheets(HWND parent)
Definition: inetcpl.c:101
unsigned int UINT
Definition: ndis.h:50
static PVOID hdll
Definition: shimdbg.c:126
INT_PTR CALLBACK general_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: general.c:298
#define msg(x)
Definition: auth_time.c:54
GLenum GLuint id
Definition: glext.h:5579
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDS_CPL_INFO
Definition: inetcpl.h:50
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:233
#define CPL_GETCOUNT
Definition: cpl.h:13
#define ICON_BIG
Definition: tnclass.cpp:51
WINE_DEFAULT_DEBUG_CHANNEL(inetcpl)
DECLSPEC_HIDDEN HMODULE hcpl
Definition: inetcpl.c:42