How to bring the 'CredUIPromptForCredentials dialog' to the foreground

D

Declercq Dirk

Hey,

From within my security-dll I am able to display the
'CredUIPromptForCredentials' dialog.
Because this dialog is popped up from code within my dll I have set the
parent window of this dialog to be the Desktop.

I am already able to bring this dialog visible (if there are other window's
occupying the desktop) by using
SetWindowPos( hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE ) in a
seperate thread
where the 'hWnd' parameter is the window I have found with the 'EnumWindows'
function.

What I am not able to do is set this window the active window of the system
because when I press a key to fill
in the UserName the input is going to another application although the
title-bar of the 'CredUIPromptForCredentials'-dialog
seems to be active (I suspect so because the color is the one of an active
window).

Some idea's ?

I have already tried using SetWindowPos( hWnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top