Skip to content

Use user32.dll GetForegroundWindow() to fix WAM pop-behind #3677

Description

Is your feature request related to a problem? Please describe the problem.

IntPtr consoleHandle = GetConsoleWindow();
IntPtr handle = GetAncestor(consoleHandle, GetAncestorFlags.GetRootOwner);
return handle;

Describe the solution you'd like.

[DllImport("user32.dll")]
static extern IntPtr GetForegroundWindow();
IntPtr parentWindowHandle = GetForegroundWindow();

Additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions