content.c 2.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/*
 * Internet control panel applet: content propsheet
 *
 * Copyright 2010 Detlef Riekenberg
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 *
 */

#define NONAMELESSUNION

#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <cryptuiapi.h>

30
#include "inetcpl.h"
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(inetcpl);

/*********************************************************************
 * display_cert_manager (internal)
 *
 * call cryptui to display a specific certificate manager dialog
 *
 */
static BOOL display_cert_manager(HWND parent, DWORD flags)
{
    CRYPTUI_CERT_MGR_STRUCT dlg;

    TRACE("(%p, 0x%x)\n", parent, flags);

    ZeroMemory(&dlg, sizeof(CRYPTUI_CERT_MGR_STRUCT));
    dlg.dwSize = sizeof(CRYPTUI_CERT_MGR_STRUCT);
    dlg.hwndParent = parent;
    dlg.dwFlags = flags;

    return CryptUIDlgCertMgr(&dlg);
}

/*********************************************************************
 * LaunchSiteCertDialog (inetcpl.@)
 *
 * Launch a dialog to manage personal certificates
 *
 * PARAMS
61
 *  parent  [I] Handle for the parent window
62 63 64 65 66 67 68 69 70 71 72 73 74
 *
 * RETURNS
 *  Failure: FALSE
 *  Success: TRUE
 *
 * NOTES
 *  rundll32 callable function: rundll32 inetcpl.cpl,LaunchSiteCertDialog
 *
 */
BOOL WINAPI LaunchSiteCertDialog(HWND parent)
{
    return display_cert_manager(parent, 0);
}
75 76 77 78 79 80 81

/*********************************************************************
 * content_dlgproc [internal]
 *
 */
INT_PTR CALLBACK content_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
82 83
    if ((msg != WM_SETCURSOR) && (msg != WM_NCHITTEST) && (msg != WM_MOUSEMOVE))
        TRACE("(%p, 0x%08x/%d, 0x%lx, 0x%lx)\n", hwnd, msg, msg, wparam, lparam);
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

    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;
}