Hi eric,
Please just
'
//////////////////////////////////////////////////////////////////////////////////////////////////' /
' */
' dwSize size of this struct*/
' hwndParent parent of this dialog
(OPTIONAL)*/
' dwFlags flags: */
' CRYPTUI_SELECTCERT_MULTISELECT -*/
' if this flag is set then
CryptUIDlgSelectCertificate*/
' will return NULL, and the
hSelectedCertStore */
' parameter must contain a valid store
handle that */
' will be populated with all the
selected certificates.*/
' dwDontUseColumn This can be used to disable the display
of certain (OPTIONAL)*/
' columns. It can be set with any
comibnation of the*/
' column flags below*/
' szTitle title of the dialog
(OPTIONAL)*/
' szDisplayString a string that will be displayed in the
dialog that may (OPTIONAL)*/
' be used to inform the user what they are
selecting a*/
' a certificate for. if it is not set a
default string*/
' will be displayed. the defualt strings
resourece is*/
' IDS_SELECT_CERT_DEFAULT*/
' pFilterCallback a pointer to a PFNCMFILTERPROC which is
used to filter (OPTIONAL)*/
' the certificates which are displayed for
selection*/
' pDisplayCallback a pointer to a PFNCCERTDISPLAYPROC which
is used to*/
' handle displaying certificates*/
' pvCallbackData if either or both pFilterCallback or
pDisplayCallback (OPTIONAL)*/
' are being used this value is passed back
to the caller*/
' when the callbacks are made*/
' cDisplayStores count of stores that contain the certs to
display*/
' for selection*/
' rghDisplayStores array of stores that contain the certs to
display*/
' for selection*/
' cStores count of other stores to search when
building chain and (OPTIONAL)*/
' validating trust of the certs which are
displayed, if*/
' the user choosing a cert would like to
view a particular*/
' cert which is displayed for selection,
these stores*/
' are passed to the CertViewCert dialog*/
' rghStores array of other stores to search when
building chain and (OPTIONAL)*/
' validating trust of the certs which are
displayed, if*/
' the user choosing a cert would like to
view a particular*/
' cert which is displayed for selection,
these stores*/
' are passed to the CertViewCert dialog*/
' cPropSheetPages PASS THROUGH - number of pages in
rgPropSheetPages array (OPTIONAL)*/
' rgPropSheetPages PASS THROUGH - extra pages that are
passed through (OPTIONAL)*/
' to the certificate viewing dialog when it
is invoked from*/
' the selection dialog*/
' hSelectedCertStore This certificate store is passed in by
the caller if the (OPTIONAL)*/
' CRYPTUI_SELECTCERT_MULTISELECT flag is
set. The store */
' will contain all the selected
certificates on return.*/
' */
'
//////////////////////////////////////////////////////////////////////////////////////////////////' /
' flags for dwDontUseColumn*/
Private Const CRYPTUI_SELECT_ISSUEDTO_COLUMN As Long = &H1
Private Const CRYPTUI_SELECT_ISSUEDBY_COLUMN As Long = &H2
Private Const CRYPTUI_SELECT_INTENDEDUSE_COLUMN As Long = &H4
Private Const CRYPTUI_SELECT_FRIENDLYNAME_COLUMN As Long = &H8
Private Const CRYPTUI_SELECT_LOCATION_COLUMN As Long = &H10
Private Const CRYPTUI_SELECT_EXPIRATION_COLUMN As Long = &H20
' dwFlags*/
Private Const CRYPTUI_SELECTCERT_MULTISELECT As Long = &H1
Private Type CRYPTUI_SELECTCERTIFICATE_STRUCTA
dwSize As Long
hwndParent As Long ' OPTIONAL*/
dwFlags As Long ' OPTIONAL*/
szTitle As String ' OPTIONAL*/
dwDontUseColumn As Long ' OPTIONAL*/
szDisplayString As String ' OPTIONAL*/
pFilterCallback As Long ' OPTIONAL*/
pDisplayCallback As Long ' OPTIONAL*/
pvCallbackData As Long ' OPTIONAL*/
cDisplayStores As Long
rghDisplayStores As Long
cStores As Long ' OPTIONAL*/
rghStores As Long ' OPTIONAL*/
cPropSheetPages As Long ' OPTIONAL*/
rgPropSheetPages As Long ' OPTIONAL*/
hSelectedCertStore As Long ' OPTIONAL*/
End Type
' TODO: check name of "cryptui.dll" is correct
Private Declare Function CryptUIDlgSelectCertificate Lib "cryptui.dll" Alias
"CryptUIDlgSelectCertificateA" (ByVal pcsc As
CRYPTUI_SELECTCERTIFICATE_STRUCTA) As Long
Public Sub test_example()
Dim csc As CRYPTUI_SELECTCERTIFICATE_STRUCTA
Dim Cert_Context As Long
Dim h
csc.dwSize = Len(csc)
csc.szDisplayString = "Hello there!"
csc.szTitle = "My Title Here"
Stop
Cert_Context = CryptUIDlgSelectCertificate(csc)
End Sub