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 641399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:03:31+00:00 2026-05-13T21:03:31+00:00

I am trying to get the handle of a window from a process. Now,

  • 0

I am trying to get the handle of a window from a process. Now, that process shows a splash screen, so, if i try ProcessInstance.MainWindowHandle all I get is the handle of that processes main window, that is the splash screen.

How can I find the window I want? Maybe if I could get a list of windows that process has I could pick the one I want.

Heres the code I am trying :

AutomationElement aeProcessInstance =
  AutomationElement.FromHandle(mProcess.MainWindowHandle);

AutomationElement aeButton = aeProcessInstance.FindFirst(
  TreeScope.Descendants,
  new PropertyCondition(AutomationElement.NameProperty, "Start"));

aeButton.SetFocus();
Thread.Sleep(1000);
SendKeys.SendWait("{ENTER}");
  • 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-05-13T21:03:31+00:00Added an answer on May 13, 2026 at 9:03 pm

    This is a challenging task. An application can have any number of top level windows. These can come and go as the application runs.

    I see you are using SendKeys – are you writing an automation or test system? If so, you may want to look at the accepted answer to this question.

    Could you better explain what you are trying to do? For example, are you working with random applications? Or is the target process something you have control over?

    Update

    Ok, your extra information means this problem is more tractable. You need to use Spy++, a debugger, or Xperf, Process Explorer, or some other tool to undertand the windowing and threading behavior.

    Once you know that, you can then use various Window management functions to find the window you need and deal with it.

    Also, be aware of the Windows Integrity Mechanism. The application you use to find windows in another process and send them messages must be at a higher Integrity Level (IL) that the driven application.

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

Sidebar

Related Questions

I'm trying to get a window handle on a child window in my process
I am trying to get the window handles to a Delphi application from an
I'm trying to get a handle to the foreground window in C#/Net 2.0/WinForms by
I am trying to get a list of receivers that handle android.intent.action.BOOT_COMPLETED for other
I try to get the managed control from a shown Word Application window using
I'm trying to get the name of the executable of a window that is
I'm trying to access a specific window using its handle (that is System.IntPtr value):
I'm trying to get a handle on whether we have a problem in our
I am trying to get a handle on Solrnet and interacting an ASP.NET site
I have been trying to get a handle on using MVC 4.0 with EF

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.