You can retrieve the window title of a frozen Windows 10 application by identifying its Process ID (PID) in Task Manager and then using PowerShell to query the active window handles. This method allows you to distinguish between legitimate system processes and third-party software that may be causing instability or freezing issues on your device.
When an application becomes unresponsive, standard interaction is impossible, making it difficult to identify exactly which program is stuck. Often, multiple instances of the same software run simultaneously, or background services mimic user-facing apps. By extracting the specific window title associated with a PID, you gain critical visibility into the state of the process without needing to force quit blindly. This diagnostic step is essential for troubleshooting complex hangs where the cause is not immediately obvious from the task list alone.
Identifying the Process via Task Manager
The first step involves locating the correct Process ID within the Windows interface. You must access the detailed view of running applications to see both the name and the unique identifier assigned by the operating system.
- Press
Ctrl + Shift + Esc to open the Task Manager directly.
- If the window appears compact, click More details at the bottom left.
- Navigate to the Details tab to view the full list of processes.
- Locate the frozen application in the list. If you do not see the PID column, right-click the header row and select Select columns, then check Image Name and PID.
- Note down the PID number associated with the frozen executable.
It is important to ensure you have selected the correct entry. Some applications spawn helper processes that share similar names but serve different functions. Verifying the PID prevents you from querying the wrong window handle later in the process.
Using PowerShell to Query Window Titles
Once you have the PID, PowerShell provides a robust way to enumerate all windows associated with that process. This script leverages .NET classes to interact with the Windows API, specifically targeting the caption text of each top-level window.
Open PowerShell as an administrator to ensure you have sufficient permissions to read the properties of other processes. Run the following command, replacing
<PID> with the number you recorded:
$pid = <PID>
$process = Get-Process -Id $pid -ErrorAction SilentlyContinue
if ($process) {
$windows = @()
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Win32 {
[DllImport("user32.dll")]
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
public static extern bool IsWindowVisible(IntPtr hWnd);
}
"@
foreach ($windowHandle in $process.MainWindowHandle) {
$sb = New-Object System.Text.StringBuilder(256)
[Win32]::GetWindowText($windowHandle, $sb, $sb.Capacity) | Out-Null
$title = $sb.ToString()
if ([string]::IsNullOrWhiteSpace($title) -eq $false) {
Write-Output "Window Title: $title"
}
}
} else {
Write-Output "Process with PID $pid not found."
}
This script defines the necessary Windows API calls and iterates through the main window handles of the specified process. It retrieves the text string stored in the window's title bar. If the process has multiple open windows, this loop will output the title for each one. This is particularly useful when an app freezes while displaying a dialog box or a secondary menu that is distinct from the main application frame.
Interpreting the Results
After executing the script, examine the output carefully. The returned string represents the current caption of the window. In many cases, a frozen app will display a generic title like "Not Responding" appended to the original name. However, sometimes the title remains static, showing the last successful state before the hang occurred.
If the output is empty or returns no titles, the process might be a background service without a GUI, or the window handle may have been destroyed while the process remained alive. In such scenarios, checking the
Details tab again can help verify if the process is still listed. If the PID no longer exists, the app has likely crashed silently rather than frozen.
For users dealing with persistent software issues, understanding the exact state of a frozen process can prevent unnecessary reinstalls. If you are experiencing related stability problems, such as unexpected file deletions, you might want to investigate further. See our guide on
Application files being deleted repeatedly for additional troubleshooting steps.
Troubleshooting Frozen Applications
Knowing the window title helps you decide whether to end the task manually or wait for Windows to intervene. If the title indicates a specific error message, you can search for that exact phrase online to find targeted fixes. For instance, if the title includes a DLL name, it may indicate a missing module issue similar to those found in driver errors. Check out our article on
Error: Specified Module Not Found if you suspect library-related failures.
If the application continues to freeze frequently, consider updating the software or checking for conflicting extensions. Sometimes, third-party overlay tools or antivirus scanners interfere with window rendering, causing the UI thread to block. Disabling these temporary overlays can often resolve the hang without requiring a system reboot.
Frequently Asked Questions
Why does my frozen app show "Not Responding" in Task Manager?
Windows automatically appends "Not Responding" to the title of any window that fails to process messages for a set period. This indicates the main UI thread is blocked, usually by a long-running operation or a deadlock. It confirms the application is indeed frozen rather than just slow.
Can I use Command Prompt instead of PowerShell for this task?
While possible, achieving this in Command Prompt requires complex WMI queries or external utilities like NirCmd. PowerShell offers built-in access to .NET libraries, making it much easier to call
GetWindowText directly. It is the recommended approach for most modern Windows environments.
What should I do if the PowerShell script returns no titles?
If no titles are returned, the process may not have a visible window handle, or it may be a background service. Verify the PID in Task Manager to ensure the process is still running. If it is gone, the app has terminated unexpectedly, and you should check Event Viewer for crash logs.
How can I stop a frozen app after identifying its PID?
You can terminate the process by returning to the
Details tab in Task Manager, right-clicking the PID, and selecting
End task. Alternatively, use the PowerShell command
Stop-Process -Id <PID>. Always save your work elsewhere first, as this action cannot be undone.
Does this method work for UWP apps or only traditional EXEs?
This method primarily targets traditional desktop applications (EXEs) that expose standard window handles. Universal Windows Platform (UWP) apps often use different composition layers and may not respond to standard
GetWindowText calls in the same way. For UWP issues, consider resetting the app via Settings > Apps.