Firdosh
Firdosh

Reputation: 23

Working with credential provider using vc++

I am developing custom credential provider windows login. I am using webcam for Face Recognition and I want to display preview of webcam in TILEIMAGE of window login screen.

I got a frame from webcam using callback function but I'm not able to display each frame in TILEIMAGE. Image is only changed when the user clicks on any component.

{   
void CSampleCredential::OnFrameRecieve(BYTE * pBuffer, long BufferSize)
{
    HWND hwndOwner = NULL;

    HDC hMem = CreateCompatibleDC ( GetDC ( NULL ) ) ;
    HBITMAP bbmp=CreateBitmapFromPixels(hMem,320,240,24,pBuffer);

    BufferSize=BufferSize;

    if (_pCredProvCredentialEvents)
    {
        _pCredProvCredentialEvents->OnCreatingWindow(&hwndOwner);

        HRESULT res =_pCredProvCredentialEvents->SetFieldBitmap(this,SFI_TILEIMAGE,bbmp);

        BufferSize=BufferSize;
        res=res;

        ::MessageBox(hwndOwner, L"OnFrameRecieve", L"True", 0);
    }
}
    }

How could I update the TILEIMAGE in realtime?

Upvotes: 2

Views: 828

Answers (1)

madduci
madduci

Reputation: 2893

In order to show continuously any update in your GUI, you can force the Provider to enumerate your credential again by using

A good starting point would be the V1 samplehardwareeventcredentialprovider

Upvotes: 1

Related Questions