SOL9 2.0 Class: CertContextDialog

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * CertContextDialog.h 
 * Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#pragma once

#include <sol/crypt/CertDialog.h>


namespace SOL {

class CertContextDialog :public CertDialog {

private:

    DWORD dwContextType;

public:
    /**
     * Constructor
     *
     * @param hwnd Handle of the window for the display. If NULL, it's the desktop window.
     
     * @param contextType;
        CERT_STORE_CERTIFICATE_CONTEXT 
        CERT_STORE_CRL_CONTEXT PCCRL_CONTEXT
        CERT_STORE_CTL_CONTEXT PCCTL_CONTEXT
    
     */
    CertContextDialog(HWND hParent=NULL, 
        DWORD contextType=CERT_STORE_CERTIFICATE_CONTEXT)
    :CertDialog(hParent),
     dwContextType(contextType) 
    {


    }

public:
    /**
     * @param  pvContext For example, this takes a pointer(PCCERT_CONTEXT) to CERT_CONTEXT 
     */
    int show(__in const void* pvContext, 
             __in const wchar_t* title=NULL, 
             __in DWORD dwFlags=0) 
    {
        int rc = NO_ERROR;
        HWND hParent = getParent();
        if (!CryptUIDlgViewContext(
             this->dwContextType,
             pvContext,
            hParent,
            title,
            dwFlags,
            NULL)) {
            //Error
            rc = GetLastError();
        }
        return rc;    
    }
    
};

}

Last modified: 1 Feb 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.