Skip to content

How to use Windows Hello / UserConsentVerifier from a Win32 application #1265

Answered by suzukieng
suzukieng asked this question in Q&A
Discussion options

You must be logged in to vote

Using some information from the blog post from Raymond (https://devblogs.microsoft.com/oldnewthing/20210805-00/?p=105520) which shows how to call a similar interop API, and some digging in C++/WinRT documentation and sample code I managed to successfully call the interop API (see sample below).

HRESULT user_consent_verifier_request_verification(const char* msg, HWND hWND, IntCallbackType callback)
{
    winrt::hstring msg_h(utf8_decode(std::string(msg)));

    auto activation_factory = winrt::get_activation_factory<UserConsentVerifier>();
    winrt::com_ptr<IUserConsentVerifierInterop> interop{ activation_factory.as<IUserConsentVerifierInterop>() };
    winrt::guid iid_async_op_result{ wi…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@suzukieng
Comment options

Answer selected by btueffers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants