ReactOS 0.4.15-dev-5666-gc548b97
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
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.
83#endif
84 TRACE("(%p, 0x%08x/%d, 0x%lx)\n", hwnd, msg, msg, lparam);
85 switch (msg)
86 {
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{
113 DWORD id = 0;
114
116 /* Initialize common controls */
117 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
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
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}
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define IDD_GENERAL
Definition: resource.h:12
#define FIXME(fmt,...)
Definition: debug.h:111
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
INT_PTR CALLBACK connections_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: connections.c:349
INT_PTR CALLBACK content_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: content.c:78
#define CPL_INQUIRE
Definition: cpl.h:14
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_INIT
Definition: cpl.h:12
#define CPL_GETCOUNT
Definition: cpl.h:13
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
INT_PTR CALLBACK general_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: general.c:298
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2905
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
r parent
Definition: btrfs.c:3010
r reserved
Definition: btrfs.c:3006
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint id
Definition: glext.h:5910
DECLSPEC_HIDDEN HMODULE hcpl
Definition: inetcpl.c:42
BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
Definition: inetcpl.c:47
BOOL WINAPI LaunchInternetControlPanel(HWND parent)
Definition: inetcpl.c:227
BOOL WINAPI LaunchConnectionDialog(HWND hParent)
Definition: inetcpl.c:237
static int CALLBACK propsheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
Definition: inetcpl.c:78
static void display_cpl_sheets(HWND parent)
Definition: inetcpl.c:108
BOOL WINAPI LaunchPrivacyDialog(HWND hParent)
Definition: inetcpl.c:247
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
Definition: inetcpl.c:68
#define IDD_SECURITY
Definition: inetcpl.h:83
#define IDS_CPL_INFO
Definition: inetcpl.h:50
#define IDD_CONNECTIONS
Definition: inetcpl.h:95
#define NUM_PROPERTY_PAGES
Definition: inetcpl.h:35
INT_PTR CALLBACK security_dlgproc(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN
Definition: security.c:410
#define IDS_CPL_NAME
Definition: inetcpl.h:49
#define IDD_CONTENT
Definition: inetcpl.h:91
#define ICO_MAIN
Definition: inetcpl.h:38
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
unsigned int UINT
Definition: ndis.h:50
long LONG
Definition: pedump.c:60
#define PSH_USECALLBACK
Definition: prsht.h:48
struct _PROPSHEETPAGEW PROPSHEETPAGEW
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
#define PSCB_INITIALIZED
Definition: prsht.h:75
struct _PROPSHEETHEADERW PROPSHEETHEADERW
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
static PVOID hdll
Definition: shimdbg.c:126
#define TRACE(s)
Definition: solgame.cpp:4
TCHAR * cmdline
Definition: stretchblt.cpp:32
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
LPCWSTR pszCaption
Definition: prsht.h:301
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
LPCWSTR pszTemplate
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:216
Definition: cpl.h:24
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
#define ICON_BIG
Definition: tnclass.cpp:51
#define ZeroMemory
Definition: winbase.h:1670
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
#define WINAPI
Definition: msvc.h:6
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185