The ParentWindow property specifies and retrieves the ID of the window used by key-related user interface dialogs.
This property is read/write.
HRESULT put_ParentWindow( [in] LONG Value ); HRESULT get_ParentWindow( [out] LONG *pValue );
A LONG variable that contains the window ID. The ID is a window handle.
If the function succeeds, the function returns S_OK.
If the function fails, it returns an HRESULT value that indicates the error. Possible values include, but are not limited to, those in the following table. For a list of common error codes, see Common HRESULT Values.
The property value could not be found.
This property value is used by key-related Certificate Enrollment Control modal dialogs that:
- Direct a user to insert a smart card
- Request a smart card pin number
- Request the protection level for a new key
- Request a user password before accessing a key
If your application uses key-related modal dialogs, we recommend that you use this property to ensure that your window displays in front of other windows and that the requested action is performed before the thread can be unblocked.
You can set this property before calling any initialization method or the Encode method. If the certificate request contains nested requests and you set the ParentWindow property on the top level request, it is automatically propagated to all of the inner requests. You can, however, set the property manually on each of the inner objects.
For a PKCS #10 request, the property value is retrieved from and specified on the associated IX509PrivateKey object if the key exists. For a PKCS #7 or CMC request the window ID is updated on the inner request and all signing certificates.
Minimum supported client
|Windows Vista [desktop apps only]|
Minimum supported server
|Windows Server 2008 [desktop apps only]|