ReactOS  0.4.15-dev-506-ga3ec01c
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 #ifdef __REACTOS__
81  // NOTE: This callback is needed to set large icon correctly.
82  HICON hIcon;
83 #endif
84  TRACE("(%p, 0x%08x/%d, 0x%lx)\n", hwnd, msg, msg, lparam);
85  switch (msg)
86  {
87  case PSCB_INITIALIZED:
88 #ifdef __REACTOS__
89  {
91  SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
92  break;
93  }
94 #else
96  break;
97 #endif
98  }
99  return 0;
100 }
101 
102 /******************************************************************************
103  * display_cpl_sheets [internal]
104  *
105  * Build and display the dialog with all control panel propertysheets
106  *
107  */
109 {
112  PROPSHEETHEADERW psh;
113  DWORD id = 0;
114 
116  /* Initialize common controls */
117  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
119  InitCommonControlsEx(&icex);
120 
121  ZeroMemory(&psh, sizeof(psh));
122  ZeroMemory(psp, sizeof(psp));
123 
124  /* Fill out all PROPSHEETPAGE */
125  psp[id].dwSize = sizeof (PROPSHEETPAGEW);
126  psp[id].hInstance = hcpl;
129  id++;
130 
131  psp[id].dwSize = sizeof (PROPSHEETPAGEW);
132  psp[id].hInstance = hcpl;
135  id++;
136 
137  psp[id].dwSize = sizeof (PROPSHEETPAGEW);
138  psp[id].hInstance = hcpl;
141  id++;
142 
143  psp[id].dwSize = sizeof (PROPSHEETPAGEW);
144  psp[id].hInstance = hcpl;
147  id++;
148 
149  /* Fill out the PROPSHEETHEADER */
150  psh.dwSize = sizeof (PROPSHEETHEADERW);
152  psh.hwndParent = parent;
153  psh.hInstance = hcpl;
156  psh.nPages = id;
157  psh.u3.ppsp = psp;
159 
160  /* display the dialog */
161  PropertySheetW(&psh);
162 
163  OleUninitialize();
164 }
165 
166 /*********************************************************************
167  * CPlApplet (inetcpl.@)
168  *
169  * Control Panel entry point
170  *
171  * PARAMS
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
176  *
177  * RETURNS
178  * Depends on the command
179  *
180  */
182 {
183  TRACE("(%p, %u, 0x%lx, 0x%lx)\n", hWnd, command, lParam1, lParam2);
184 
185  switch (command)
186  {
187  case CPL_INIT:
188  return TRUE;
189 
190  case CPL_GETCOUNT:
191  return 1;
192 
193  case CPL_INQUIRE:
194  {
195  CPLINFO *appletInfo = (CPLINFO *) lParam2;
196 
197  appletInfo->idIcon = ICO_MAIN;
198  appletInfo->idName = IDS_CPL_NAME;
199  appletInfo->idInfo = IDS_CPL_INFO;
200  appletInfo->lData = 0;
201  return TRUE;
202  }
203 
204  case CPL_DBLCLK:
206  break;
207  }
208 
209  return FALSE;
210 }
211 
212 /*********************************************************************
213  * LaunchInternetControlPanel (inetcpl.@)
214  *
215  * Launch the Internet Control Panel dialog
216  *
217  * PARAMS
218  * parent [I] Handle for the parent window
219  *
220  * RETURNS
221  * Success: TRUE
222  *
223  * NOTES
224  * rundll32 callable function: rundll32 inetcpl.cpl,LaunchInternetControlPanel
225  *
226  */
228 {
230  return TRUE;
231 }
232 
233 /*********************************************************************
234  * LaunchConnectionDialog (inetcpl.@)
235  *
236  */
238 {
239  FIXME("(%p): stub\n", hParent);
240  return FALSE;
241 }
242 
243 /*********************************************************************
244  * LaunchInternetControlPanel (inetcpl.@)
245  *
246  */
248 {
249  FIXME("(%p): stub\n", hParent);
250  return FALSE;
251 }
LONG CALLBACK CPlApplet(HWND hWnd, UINT command, LPARAM lParam1, LPARAM lParam2)
Definition: inetcpl.c:181
HWND hwndParent
Definition: prsht.h:295
BOOL WINAPI LaunchPrivacyDialog(HWND hParent)
Definition: inetcpl.c:247
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:308
Definition: cpl.h:24
LPCWSTR pszTemplate
Definition: prsht.h:218
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 DECLSPEC_HIDDEN
Definition: precomp.h:8
#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:1648
#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:237
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:214
#define PSH_USEICONID
Definition: prsht.h:42
#define ICO_MAIN
Definition: inetcpl.h:38
LPCWSTR pszCaption
Definition: prsht.h:301
unsigned int BOOL
Definition: ntddk_ex.h:94
DLGPROC pfnDlgProc
Definition: prsht.h:226
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:111
r reserved
Definition: btrfs.c:2940
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
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:2905
#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:2944
LONG HRESULT
Definition: typedefs.h:78
HINSTANCE hInstance
Definition: prsht.h:296
#define IDS_CPL_NAME
Definition: inetcpl.h:49
#define WINAPI
Definition: msvc.h:6
LPCWSTR pszIcon
Definition: prsht.h:299
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
#define CPL_INIT
Definition: cpl.h:12
BOOL WINAPI LaunchInternetControlPanel(HWND parent)
Definition: inetcpl.c:227
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:216
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:169
#define S_OK
Definition: intsafe.h:59
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
#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:108
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:230
#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