Click here to Skip to main content
15,915,818 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questioncreate an RTF file with equation editor objects Pin
fuel2run26-Oct-05 20:53
fuel2run26-Oct-05 20:53 
Questionscript Pin
m_anya2126-Oct-05 20:49
m_anya2126-Oct-05 20:49 
AnswerRe: script Pin
enjoycrack27-Oct-05 7:04
enjoycrack27-Oct-05 7:04 
Question.NET & CR Pin
hung_ngole26-Oct-05 18:15
hung_ngole26-Oct-05 18:15 
QuestionOpenGL Pin
Guerven26-Oct-05 16:10
Guerven26-Oct-05 16:10 
AnswerRe: OpenGL Pin
Christian Graus26-Oct-05 16:14
protectorChristian Graus26-Oct-05 16:14 
GeneralRe: THANKS Pin
Guerven26-Oct-05 16:29
Guerven26-Oct-05 16:29 
QuestionHook selectCert listbox when adding a signature in Word Pin
herve Cadieu26-Oct-05 15:34
herve Cadieu26-Oct-05 15:34 
Confused | :confused: Hi dear all,
In an attempt to tweak Microsoft word, I would need to choose programmatically a certificate (with filters on the signer.name, Certificate.issuer and certificate.expiration.date) from the dialogbox selectcert which pops up when adding this code within a vba routine :

dim sig as signature
set sig = activedocument.signatures.add

I have seen some infos in selectcert structure at msdn but cannot figure out how to achieve the proper hook. (ideally as well I could bring the proper timestamp to digitally sign (which actually is the local time by default ) If any of you knows how to achieve it (Code snippet is a must) you are very welcome.

MSDN Home > MSDN Library > Win32 and COM Development > Security > Cryptography > Cryptography Reference > Cryptography Structures

Platform SDK: Cryptography

CERT_SELECT_STRUCT
The CERT_SELECT_STRUCT structure contains criteria upon which to select certificates that are presented in a certificate selection dialog box. This structure is used in the CertSelectCertificate function.

typedef struct tagCSS { DWORD dwSize; HWND hwndParent; HINSTANCE hInstance; LPCTSTR pTemplateName; DWORD dwFlags; LPCTSTR szTitle; DWORD cCertStore; HCERTSTORE* arrayCertStore; LPCSTR szPurposeOid; DWORD cCertContext; PCCERT_CONTEXT* arrayCertContext; DWORD lCustData; PFNCMHOOKPROC pfnHook; PFNCMFILTERPROC pfnFilter; LPCTSTR szHelpFileName; DWORD dwHelpId; HCRYPTPROV hprov;
} CERT_SELECT_STRUCT, *PCERT_SELECT_STRUCT;
Members
dwSize
The size of this structure in bytes.
hwndParent
The handle to the parent window of any dialog boxes that CertSelectCertificate generates.
hInstance
The handle to the module whose executable file contains the dialog box template.
pTemplateName
If the CSS_ENABLETEMPLATE flag is set in the dwFlags member, set pTemplateName to a pointer to a global memory object that contains the template that DialogBoxIndirectParam uses to create the dialog box. A dialog box template consists of a header that describes the dialog box. The header is followed by one or more additional blocks of data that describe each of the controls in the dialog box. The template can use either the standard format or the extended format.
If the CSS_ENABLETEMPLATEHANDLE flag is set in dwFlags, pTemplateName specifies the dialog box template. pTemplateName is either the pointer to a null-terminated character string that specifies the name of the dialog box template or an integer value that specifies the resource identifier of the dialog box template. If the specifies a resource identifier, its high-order word must be zero and its low-order word must contain the identifier. One way to create this integer value is to use the MAKEINTRESOURCE macro.

dwFlags
This member can be one or more of the following values.Value Meaning
CSS_HIDE_PROPERTIES Hide the Properties button.
CSS_ENABLEHOOK Pass a hook procedure in pfnHook.
CSS_ALLOWMULTISELECT Enable multi-selection of certificates.
CSS_SHOW_HELP Show the Help button.
CSS_ENABLETEMPLATE Cause CertSelectCertificate function to call the DialogBoxIndirectParam function to create a dialog box. For more information, see pTemplateName.
CSS_ENABLETEMPLATEHANDLE Cause the CertSelectCertificate function to call the DialogBoxParam function to create a dialog box. For more information, see pTemplateName.

szTitle
A pointer to a string that contains the text for the title of the dialog box.
cCertStore
The number of certificate store handles in arrayCertStore.
arrayCertStore
A pointer to the array of certificate stores that the dialog box enumerates and displays.
szPurposeOid
A pointer to a string representation of an object identifier (OID) for an enhanced key usage (EKU). If an OID is provided, only certificates that include this EKU will be displayed.
cCertContext
The number of certificates in the arrayCertContext member.
arrayCertContext
A pointer to an array of CERT_CONTEXT structures. The certificates represented by these structures are selected when the dialog box displayed by the CertSelectCertificate function initially appears.
lCustData
A pointer to an array of byte values that hold custom data that is passed through to the filter procedure referenced by pfnFilter. This custom data is not used by the CertSelectCertificate function.
pfnHook
A PFNCMHOOKPROC function pointer to the Hook callback function. This function is called before messages are processed by the dialog box. For more information, see Hooks.
pfnFilter
A PFNCMFILTERPROC function pointer to the filter callback function. This is called to determine which certificates will be displayed by the dialog box.
szHelpFileName
A pointer to a null-terminated string that contains the full path to the Help file.
dwHelpId
The context identifier for the topic. For more information, see WinHelp.
hprov
A handle to the Cryptographic Service Provider (CSP) to use for certificate verification.
Requirements
Client Requires Windows "Longhorn", Windows XP, or Windows 2000 Professional.
Server Requires Windows Server "Longhorn", Windows Server 2003, or Windows 2000 Server.
Header Declared in CryptDlg.h.

Unicode Implemented as CERT_SELECT_STRUCT_W (Unicode) and CERT_SELECT_STRUCT_A (ANSI).


Best regards

herve cadieu
QuestionSending Commands to cmd.exe Pin
gte999s26-Oct-05 13:53
gte999s26-Oct-05 13:53 
QuestionBrowsing remote files Pin
Member 227600326-Oct-05 12:42
Member 227600326-Oct-05 12:42 
AnswerRe: Browsing remote files Pin
enjoycrack26-Oct-05 13:23
enjoycrack26-Oct-05 13:23 
QuestionCountDown between dates Pin
im_hoser26-Oct-05 10:00
im_hoser26-Oct-05 10:00 
AnswerRe: CountDown between dates Pin
KaptinKrunch26-Oct-05 10:31
KaptinKrunch26-Oct-05 10:31 
GeneralRe: CountDown between dates Pin
im_hoser26-Oct-05 10:59
im_hoser26-Oct-05 10:59 
AnswerRe: CountDown between dates Pin
rwestgraham26-Oct-05 13:03
rwestgraham26-Oct-05 13:03 
AnswerRe: CountDown between dates Pin
George B Gilbert27-Oct-05 7:45
George B Gilbert27-Oct-05 7:45 
AnswerRe: CountDown between dates Pin
George B Gilbert27-Oct-05 8:25
George B Gilbert27-Oct-05 8:25 
GeneralRe: CountDown between dates Pin
im_hoser27-Oct-05 14:20
im_hoser27-Oct-05 14:20 
QuestionInstallation on a remote computer. Pin
Jim Wilcox26-Oct-05 8:07
Jim Wilcox26-Oct-05 8:07 
AnswerRe: Installation on a remote computer. Pin
rwestgraham26-Oct-05 14:48
rwestgraham26-Oct-05 14:48 
Questionsql problem Pin
microuser_200026-Oct-05 6:09
microuser_200026-Oct-05 6:09 
AnswerRe: sql problem Pin
Joshua Quick26-Oct-05 8:14
Joshua Quick26-Oct-05 8:14 
GeneralRe: sql problem Pin
microuser_200026-Oct-05 8:25
microuser_200026-Oct-05 8:25 
GeneralRe: sql problem Pin
Joshua Quick26-Oct-05 9:01
Joshua Quick26-Oct-05 9:01 
GeneralRe: sql problem Pin
microuser_200026-Oct-05 11:09
microuser_200026-Oct-05 11:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.