Class WindowHelper
- Namespace
- VisioForge.Core.Helpers
- Assembly
- VisioForge.Core.dll
Provides utility methods for working with Windows windows and processes.
public static class WindowHelperInheritance
Inherited Members
Remarks
This helper class contains methods for enumerating window handles associated with processes and retrieving window titles. It wraps Windows API calls to interact with the window management system.
Methods
GetWindowNamesByProcessName(string)
Retrieves the titles of all windows associated with a process by its name.
public static string[] GetWindowNamesByProcessName(string processName)Parameters
processNamestring-
The name of the process (without .exe extension) to query windows for.
Returns
- string[]
-
An array of strings containing the titles of all windows belonging to the specified process.
Remarks
This method finds the first process matching the specified name, enumerates all its windows, and retrieves the window title for each window by sending a WM_GETTEXT message. Empty or untitled windows will return empty strings in the array.
Exceptions
- InvalidOperationException
-
Thrown when no process with the specified name is found.