inetcpl: Add content property sheet.

This commit is contained in:
Detlef Riekenberg 2010-09-27 13:08:38 +02:00 committed by Alexandre Julliard
parent 8f87459baa
commit afe36a89fa
5 changed files with 119 additions and 3 deletions

View file

@ -1,4 +1,5 @@
MODULE = inetcpl.cpl
IMPORTS = comctl32 user32
DELAYIMPORTS = cryptui
C_SRCS = \

View file

@ -27,6 +27,7 @@
#include <winuser.h>
#include <cryptuiapi.h>
#include "inetcpl.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(inetcpl);
@ -57,7 +58,7 @@ static BOOL display_cert_manager(HWND parent, DWORD flags)
* Launch a dialog to manage personal certificates
*
* PARAMS
* hWnd [I] Handle for the parrent window
* parent [I] Handle for the parent window
*
* RETURNS
* Failure: FALSE
@ -71,3 +72,28 @@ BOOL WINAPI LaunchSiteCertDialog(HWND parent)
{
return display_cert_manager(parent, 0);
}
/*********************************************************************
* content_dlgproc [internal]
*
*/
INT_PTR CALLBACK content_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
TRACE("(%p, 0x%08x/%d, 0x%lx, 0x%lx)\n", hwnd, msg, msg, wparam, lparam);
if (msg == WM_COMMAND)
{
switch (LOWORD(wparam))
{
case IDC_CERT:
display_cert_manager(hwnd, 0);
break;
case IDC_CERT_PUBLISHER:
display_cert_manager(hwnd, CRYPTUI_CERT_MGR_PUBLISHER_TAB);
break;
}
}
return FALSE;
}

View file

@ -1,5 +1,5 @@
/*
* Internet control panel applet
* English resources for the Internet control panel applet
*
* Copyright 2010 Detlef Riekenberg
*
@ -28,3 +28,18 @@ BEGIN
IDS_CPL_NAME "Internet Settings"
IDS_CPL_INFO "Configure Wine Internet Browser and related settings"
END
/* "Content" propsheet */
IDD_CONTENT DIALOG 0, 0, 320, 220
STYLE WS_CAPTION | WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
CAPTION "Content"
BEGIN
GROUPBOX " Certificates ", IDC_STATIC, 4, 4, 312, 50
LTEXT "Certificates are used for your personal identification and to identify certificate authorities and publishers.",
IDC_STATIC, 58, 14, 252, 18
PUSHBUTTON "Certificates...", IDC_CERT, 146, 34, 80, 14
PUSHBUTTON "Publishers... ", IDC_CERT_PUBLISHER, 230, 34, 80, 14
END

View file

@ -24,6 +24,10 @@
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#include <commctrl.h>
#include <commdlg.h>
#include <cpl.h>
#include "wine/debug.h"
@ -33,6 +37,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(inetcpl);
HMODULE hcpl;
/*********************************************************************
* DllMain (inetcpl.@)
*/
@ -47,10 +53,65 @@ BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hdll);
hcpl = hdll;
}
return TRUE;
}
/******************************************************************************
* propsheet_callback [internal]
*
*/
static int CALLBACK propsheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
{
TRACE("(%p, 0x%08x/%d, 0x%lx)\n", hwnd, msg, msg, lparam);
switch (msg)
{
case PSCB_INITIALIZED:
SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM) LoadIconW(hcpl, MAKEINTRESOURCEW(ICO_MAIN)));
break;
}
return 0;
}
/******************************************************************************
* display_cpl_sheets [internal]
*
* Build and display the dialog with all control panel propertysheets
*
*/
static void display_cpl_sheets(HWND parent)
{
PROPSHEETPAGEW psp[NUM_PROPERTY_PAGES];
PROPSHEETHEADERW psh;
DWORD id = 0;
ZeroMemory(&psh, sizeof(psh));
ZeroMemory(psp, sizeof(psp));
/* Fill out all PROPSHEETPAGE */
psp[id].dwSize = sizeof (PROPSHEETPAGEW);
psp[id].hInstance = hcpl;
psp[id].u.pszTemplate = MAKEINTRESOURCEW(IDD_CONTENT);
psp[id].pfnDlgProc = content_dlgproc;
id++;
/* Fill out the PROPSHEETHEADER */
psh.dwSize = sizeof (PROPSHEETHEADERW);
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
psh.hwndParent = parent;
psh.hInstance = hcpl;
psh.u.pszIcon = MAKEINTRESOURCEW(ICO_MAIN);
psh.pszCaption = MAKEINTRESOURCEW(IDS_CPL_NAME);
psh.nPages = id;
psh.u3.ppsp = psp;
psh.pfnCallback = propsheet_callback;
/* display the dialog */
PropertySheetW(&psh);
}
/*********************************************************************
* CPlApplet (inetcpl.@)
*
@ -90,7 +151,7 @@ LONG CALLBACK CPlApplet(HWND hWnd, UINT command, LPARAM lParam1, LPARAM lParam2)
}
case CPL_DBLCLK:
FIXME("not implemented yet\n");
display_cpl_sheets(hWnd);
break;
}

View file

@ -22,9 +22,22 @@
#include <windef.h>
#include <winuser.h>
extern HMODULE hcpl;
INT_PTR CALLBACK content_dlgproc(HWND, UINT, WPARAM, LPARAM) DECLSPEC_HIDDEN;
#define NUM_PROPERTY_PAGES 8
/* icons */
#define ICO_MAIN 100
/* strings */
#define IDS_CPL_NAME 1
#define IDS_CPL_INFO 2
/* dialogs */
#define IDC_STATIC -1
#define IDD_CONTENT 4000
#define IDC_CERT 4100
#define IDC_CERT_PUBLISHER 4101