HighTechTalks DotNet Forums  

How to bring the 'CredUIPromptForCredentials dialog' to the foreground

Dotnet Security microsoft.public.dotnet.security


Discuss How to bring the 'CredUIPromptForCredentials dialog' to the foreground in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Declercq Dirk
 
Posts: n/a

Default How to bring the 'CredUIPromptForCredentials dialog' to the foreground - 02-24-2005 , 04:27 PM






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 )



Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: How to bring the 'CredUIPromptForCredentials dialog' to the foreground - 02-25-2005 , 08:47 PM






This isn't my area of expertese, but you shouldn't be using the Desktop as
the parent window for a dialog. Raymond expands upon that here:
http://blogs.msdn.com/oldnewthing/ar.../24/79212.aspx

-Shawn
http://blogs.msdn.com/shawnfa
--
This posting is provided "AS IS" with no warranties, and confers no rights.


Note:
For the benefit of the community-at-large, all responses to this message
are best directed to the newsgroup/thread from which they originated.
--------------------
Quote:
From: "Declercq Dirk" <dirk.declercq.ddc (AT) telenet (DOT) be
Subject: How to bring the 'CredUIPromptForCredentials dialog' to the
foreground
Date: Thu, 24 Feb 2005 22:27:40 +0100
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
Message-ID: <uX1MterGFHA.3472 (AT) TK2MSFTNGP09 (DOT) phx.gbl
Newsgroups:
microsoft.public.dotnet.framework.sdk,microsoft.pu blic.dotnet.framework.wind
owsforms,microsoft.public.dotnet.security
Quote:
NNTP-Posting-Host: d54c2d224.access.telenet.be 84.194.210.36
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP0
9.phx.gbl
Quote:
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.windowsforms:812 05
microsoft.public.dotnet.security:9230
microsoft.public.dotnet.framework.sdk:10294
Quote:
X-Tomcat-NG: microsoft.public.dotnet.security

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 )





Reply With Quote
  #3  
Old   
Declercq Dirk
 
Posts: n/a

Default Re: How to bring the 'CredUIPromptForCredentials dialog' to the foreground - 02-27-2005 , 09:31 AM



Thanks for the information.

""Shawn Farkas [MS]"" <shawnfa (AT) online (DOT) microsoft.com> wrote

Quote:
This isn't my area of expertese, but you shouldn't be using the Desktop as
the parent window for a dialog. Raymond expands upon that here:
http://blogs.msdn.com/oldnewthing/ar.../24/79212.aspx

-Shawn
http://blogs.msdn.com/shawnfa
--
This posting is provided "AS IS" with no warranties, and confers no
rights.


Note:
For the benefit of the community-at-large, all responses to this message
are best directed to the newsgroup/thread from which they originated.
--------------------
From: "Declercq Dirk" <dirk.declercq.ddc (AT) telenet (DOT) be
Subject: How to bring the 'CredUIPromptForCredentials dialog' to the
foreground
Date: Thu, 24 Feb 2005 22:27:40 +0100
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
Message-ID: <uX1MterGFHA.3472 (AT) TK2MSFTNGP09 (DOT) phx.gbl
Newsgroups:
microsoft.public.dotnet.framework.sdk,microsoft.pu blic.dotnet.framework.wind
owsforms,microsoft.public.dotnet.security
NNTP-Posting-Host: d54c2d224.access.telenet.be 84.194.210.36
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP0
9.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.windowsforms:812 05
microsoft.public.dotnet.security:9230
microsoft.public.dotnet.framework.sdk:10294
X-Tomcat-NG: microsoft.public.dotnet.security

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 )







Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.