Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:52:54+00:00 2026-06-02T13:52:54+00:00

Issues of robustness, stability and you shouldn’t do this aside, has anyone ever filled

  • 0

Issues of robustness, stability and you shouldn’t do this aside, has anyone ever filled in a windows credential prompt via code (so that’s one that looks like this:)

windows security prompt

Is it possible to interact with these dialog boxes through Win32 APIs, or using SendKeys/send mouse / UI Automation? Any ideas / tips anyone has would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:53:11+00:00Added an answer on June 2, 2026 at 1:53 pm

    I ended up using the UI Automation framework, which allowed me to grab a reference to the credential prompt and then fill it out and complete it that way.

    Code snippet:

    AutomationElement desktop = AutomationElement.RootElement;
    //get all windows on the desktop
    AutomationElementCollection windows = desktop.FindAll(TreeScope.Descendants, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Window));
             foreach (AutomationElement window in windows)
            {
                if (window.Current.ClassName.Equals("#32770"))   //security dialog
                {
    
                    // access the appropriate AutomationElements to enter credentials here
    
                }
            }
    

    To interact with an element, you grab the appropriate Pattern object and call its methods (eg Textboxes have a ValuePattern which has a .SetValue() method.

    I also used UISpy to find all the values for things like ClassNames, AutomationIds, etc to help find the correct item through .FindAll() and PropertyConditions objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having issues with Twitter Bootstrap responsive navigation. The best way to explain this is
Having issues referencing $(this) from within a the nested ajax 'success' function... I know
This issues comes up when executing a particular workflow - User is logged in
Having issues displaying some websites within iframes. Live example of code This one works.
Having issues getting jQuery to work in this scenario: Visual Studio 2010 .Net 4.0
My issues here is that this does not compile. I get A control with
I'm having issues transitioning between views and need some help. This is somewhat conviluted
I would like to implement some geometrical algorithms with numerical robustness. For this, a
Some issues with the Flash Bone Tool are described very well in this YouTube
I am having issues with the data submitted to my controller action via a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.