Detlef Riekenberg : inetcpl: Add content property sheet.
Alexandre Julliard
julliard at winehq.org
Mon Sep 27 11:29:43 CDT 2010
Module: wine
Branch: master
Commit: afe36a89faf740e83426277a974ff03e43abbf4b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=afe36a89faf740e83426277a974ff03e43abbf4b
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Mon Sep 27 13:08:38 2010 +0200
inetcpl: Add content property sheet.
---
dlls/inetcpl.cpl/Makefile.in | 1 +
dlls/inetcpl.cpl/content.c | 28 ++++++++++++++++++-
dlls/inetcpl.cpl/cpl_En.rc | 17 ++++++++++-
dlls/inetcpl.cpl/inetcpl.c | 63 +++++++++++++++++++++++++++++++++++++++++-
dlls/inetcpl.cpl/inetcpl.h | 13 ++++++++
5 files changed, 119 insertions(+), 3 deletions(-)
diff --git a/dlls/inetcpl.cpl/Makefile.in b/dlls/inetcpl.cpl/Makefile.in
index c8a7543..12eb694 100644
--- a/dlls/inetcpl.cpl/Makefile.in
+++ b/dlls/inetcpl.cpl/Makefile.in
@@ -1,4 +1,5 @@
MODULE = inetcpl.cpl
+IMPORTS = comctl32 user32
DELAYIMPORTS = cryptui
C_SRCS = \
diff --git a/dlls/inetcpl.cpl/content.c b/dlls/inetcpl.cpl/content.c
index 4cc0d75..10f2201 100644
--- a/dlls/inetcpl.cpl/content.c
+++ b/dlls/inetcpl.cpl/content.c
@@ -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;
+}
diff --git a/dlls/inetcpl.cpl/cpl_En.rc b/dlls/inetcpl.cpl/cpl_En.rc
index 9b2161f..651755d 100644
--- a/dlls/inetcpl.cpl/cpl_En.rc
+++ b/dlls/inetcpl.cpl/cpl_En.rc
@@ -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
diff --git a/dlls/inetcpl.cpl/inetcpl.c b/dlls/inetcpl.cpl/inetcpl.c
index 5f14464..80decfb 100644
--- a/dlls/inetcpl.cpl/inetcpl.c
+++ b/dlls/inetcpl.cpl/inetcpl.c
@@ -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;
}
diff --git a/dlls/inetcpl.cpl/inetcpl.h b/dlls/inetcpl.cpl/inetcpl.h
index 4fe97f4..e1477ff 100644
--- a/dlls/inetcpl.cpl/inetcpl.h
+++ b/dlls/inetcpl.cpl/inetcpl.h
@@ -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
More information about the wine-cvs
mailing list