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
34 #include "wine/debug.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(inetcpl
);
43 /*********************************************************************
46 BOOL WINAPI
DllMain(HINSTANCE hdll
, DWORD reason
, LPVOID reserved
)
48 TRACE("(%p, %ld, %p)\n", hdll
, reason
, reserved
);
52 case DLL_PROCESS_ATTACH
:
53 DisableThreadLibraryCalls(hdll
);
59 /***********************************************************************
60 * DllInstall (inetcpl.@)
62 HRESULT WINAPI
DllInstall(BOOL bInstall
, LPCWSTR cmdline
)
64 FIXME("(%s, %s): stub\n", bInstall
? "TRUE" : "FALSE", debugstr_w(cmdline
));
68 /******************************************************************************
69 * propsheet_callback [internal]
72 static int CALLBACK
propsheet_callback(HWND hwnd
, UINT msg
, LPARAM lparam
)
75 TRACE("(%p, 0x%08x/%d, 0x%Ix)\n", hwnd
, msg
, msg
, lparam
);
78 case PSCB_INITIALIZED
:
79 SendMessageW(hwnd
, WM_SETICON
, ICON_BIG
, (LPARAM
) LoadIconW(hcpl
, MAKEINTRESOURCEW(ICO_MAIN
)));
85 /******************************************************************************
86 * display_cpl_sheets [internal]
88 * Build and display the dialog with all control panel propertysheets
91 static void display_cpl_sheets(HWND parent
)
93 INITCOMMONCONTROLSEX icex
;
94 PROPSHEETPAGEW psp
[NUM_PROPERTY_PAGES
];
99 /* Initialize common controls */
100 icex
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
101 icex
.dwICC
= ICC_LISTVIEW_CLASSES
| ICC_BAR_CLASSES
;
102 InitCommonControlsEx(&icex
);
104 ZeroMemory(&psh
, sizeof(psh
));
105 ZeroMemory(psp
, sizeof(psp
));
107 /* Fill out all PROPSHEETPAGE */
108 psp
[id
].dwSize
= sizeof (PROPSHEETPAGEW
);
109 psp
[id
].hInstance
= hcpl
;
110 psp
[id
].pszTemplate
= MAKEINTRESOURCEW(IDD_GENERAL
);
111 psp
[id
].pfnDlgProc
= general_dlgproc
;
114 psp
[id
].dwSize
= sizeof (PROPSHEETPAGEW
);
115 psp
[id
].hInstance
= hcpl
;
116 psp
[id
].pszTemplate
= MAKEINTRESOURCEW(IDD_SECURITY
);
117 psp
[id
].pfnDlgProc
= security_dlgproc
;
120 psp
[id
].dwSize
= sizeof (PROPSHEETPAGEW
);
121 psp
[id
].hInstance
= hcpl
;
122 psp
[id
].pszTemplate
= MAKEINTRESOURCEW(IDD_CONTENT
);
123 psp
[id
].pfnDlgProc
= content_dlgproc
;
126 psp
[id
].dwSize
= sizeof (PROPSHEETPAGEW
);
127 psp
[id
].hInstance
= hcpl
;
128 psp
[id
].pszTemplate
= MAKEINTRESOURCEW(IDD_CONNECTIONS
);
129 psp
[id
].pfnDlgProc
= connections_dlgproc
;
132 /* Fill out the PROPSHEETHEADER */
133 psh
.dwSize
= sizeof (PROPSHEETHEADERW
);
134 psh
.dwFlags
= PSH_PROPSHEETPAGE
| PSH_USEICONID
| PSH_USECALLBACK
;
135 psh
.hwndParent
= parent
;
136 psh
.hInstance
= hcpl
;
137 psh
.pszIcon
= MAKEINTRESOURCEW(ICO_MAIN
);
138 psh
.pszCaption
= MAKEINTRESOURCEW(IDS_CPL_NAME
);
141 psh
.pfnCallback
= propsheet_callback
;
143 /* display the dialog */
144 PropertySheetW(&psh
);
149 /*********************************************************************
150 * CPlApplet (inetcpl.@)
152 * Control Panel entry point
155 * hWnd [I] Handle for the Control Panel Window
156 * command [I] CPL_* Command
157 * lParam1 [I] first extra Parameter
158 * lParam2 [I] second extra Parameter
161 * Depends on the command
164 LONG CALLBACK
CPlApplet(HWND hWnd
, UINT command
, LPARAM lParam1
, LPARAM lParam2
)
166 TRACE("(%p, %u, 0x%Ix, 0x%Ix)\n", hWnd
, command
, lParam1
, lParam2
);
178 CPLINFO
*appletInfo
= (CPLINFO
*) lParam2
;
180 appletInfo
->idIcon
= ICO_MAIN
;
181 appletInfo
->idName
= IDS_CPL_NAME
;
182 appletInfo
->idInfo
= IDS_CPL_INFO
;
183 appletInfo
->lData
= 0;
188 display_cpl_sheets(hWnd
);
195 /*********************************************************************
196 * LaunchInternetControlPanel (inetcpl.@)
198 * Launch the Internet Control Panel dialog
201 * parent [I] Handle for the parent window
207 * rundll32 callable function: rundll32 inetcpl.cpl,LaunchInternetControlPanel
210 BOOL WINAPI
LaunchInternetControlPanel(HWND parent
)
212 display_cpl_sheets(parent
);
216 /*********************************************************************
217 * LaunchConnectionDialog (inetcpl.@)
220 BOOL WINAPI
LaunchConnectionDialog(HWND hParent
)
222 FIXME("(%p): stub\n", hParent
);
226 /*********************************************************************
227 * LaunchInternetControlPanel (inetcpl.@)
230 BOOL WINAPI
LaunchPrivacyDialog(HWND hParent
)
232 FIXME("(%p): stub\n", hParent
);