win-capture: add capturing specific window by PID#13302
Open
PerikiyoXD wants to merge 1 commit intoobsproject:masterfrom
Open
win-capture: add capturing specific window by PID#13302PerikiyoXD wants to merge 1 commit intoobsproject:masterfrom
PerikiyoXD wants to merge 1 commit intoobsproject:masterfrom
Conversation
- provides better control when multiple windows share the same title - extends window-helpers with ms_find_window_by_pid and ms_fill_pid_window_list - en-US and es-ES locale strings provided
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the ability to select a capture target by process ID (PID), providing reliable window capture when multiple windows share the same title. A new "Capture by PID" checkbox toggles between the existing title-based window selector and a PID-based dropdown that lists all visible top-level windows with their PID, executable, and title.
ms_find_window_by_pidandms_fill_pid_window_listhave been added towindow-helpersinlibobsso the implementation reuses existing window validation logic (check_window_valid,IsWindowCloaked, internal Microsoft executable filtering) rather than duplicating it.Locale strings added for
en-USandes-ES.Motivation and Context
When the same application is launched more than once, all instances share the same window title. The existing title/class/executable matching always resolves to the first instance with no way to target a specific one. Selecting by PID uniquely identifies the intended window regardless of title.
Caveats: PID mode is Windows-only. PIDs are not stable across sessions. If the target process is restarted, its PID changes and the capture source must be reconfigured manually. This mode is intended for cases where title-based matching is ambiguous, not as a general replacement for it.
How Has This Been Tested?
Tested on Windows 10 x64 LTSC, AMD64, NVIDIA GPU.
window-helpers.c/handwindow-capture.cplus locale filesTypes of changes
Checklist: