microsoft / microsoft/WindowsAppSDK

Suggestion: Window.Activate should call SetForegroundWindow or provide a separate SetAsForeground method which calls it

Open
#6,357 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area-Windowing needs-triage
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

When creating a single instance app, after redirection it is necessary to call the Win32 API SetForegroundWindow as well as Window.Activate to show the redirected-to window. See related issue - https://github.com/microsoft/WindowsAppSDK/issues/1439. It should not be necessary to do a DllImport and call a Win32 API. WindowsAppSDK should provide this functionality. Either Window.Activate should call it by default or provide a separate method on the Window or AppWindow class called `SetAsForeground ` or similar which calls SetForegroundWindow.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Window.Activate and AppWindow entry points, then read related issue #1439 to understand the redirection scenario and foregrounding constraints. Decide whether Activate should call SetForegroundWindow or whether a separate SetAsForeground method is appropriate; done means the Windows App SDK provides the requested behavior without requiring consumers to use DllImport.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.