Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process ID returned by FlaUI.Core.Application is different from windows process ID #610

Open
amit83pandey opened this issue Jan 9, 2024 · 2 comments

Comments

@amit83pandey
Copy link

Describe the bug
The process ID returned does not match the original process id of the target application. How can I get the exact process ID of any application that I launch from the library?

Code snippets
public FlaUI.Core.Application application = FlaUI.Core.Application.Launch(appPath);
application = FlaUI.Core.Application.Attach(application.ProcessId);

Screenshots
image

Additional context
Same code works fine on some of the variants of Windows.

@Roemer
Copy link
Member

Roemer commented Mar 8, 2024

You are probably running into the issue that the calculator is a windows store app which you need to start differently. Try it with an application that is not a Windows Store App (like notpad++) and there it should work.

@andonima
Copy link

We were having issues also launching the calculator on W11 and this old response of @Roemer was the key.
#267 (comment)
In our case:

var app = FlaUI.Core.Application.LaunchStoreApp("Microsoft.WindowsCalculator_8wekyb3d8bbwe!App");
and getting the parent to interact with it
var window = app.GetMainWindow(automation).Parent.AsWindow();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants