How to get window title of a program reduced in taskar?
With C#, i use this code to list main win开发者_JAVA百科dow processes titles
Process[] ProcessArray = Process.GetProcesses();
try {
foreach (Process proc in ProcessArray) {
Console.WriteLine(proc.MainWindowTitle);
}
} catch (Exception ex) {
Console.WriteLine(ex.Message);
}
but this doesn't work to see mainwindowtitle of processes reduced in the taskbar. How to do this ?
Instead of looping through the processes you can probably use the EnumWindows api function through the P/Invoke layer.
Once you have the window handles, you can call the GetWindowText to get the title of the window.
精彩评论