dotnet / dotnet/dotnet-api-docs
update of MainWindowTitle
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
The content of MainWindowTitle didn't changed after first access?
If i open an application and get the MainWindowTitle after 5 seconds the title contains the application name
But if i request the MainWindowTitle after a few milliseconds after opening the title is empty and will stay empty also after 5 seconds!
workaround:
var title = infologgerProcess.MainWindowTitle;
var processlist = Process.GetProcessesByName("InfoLogger");
foreach (Process process in processlist.Where(process => process.Id == infologgerProcess.Id))
{
if (!title.Equals(process.MainWindowTitle))
{
Debug.WriteLine($"change title from infologgerProcess.MainWindowTitle '{infologgerProcess.MainWindowTitle}' to process.MainWindowTitle '{process.MainWindowTitle}' );
title = process.MainWindowTitle;
}
}
resulting debug log:
change title from infologgerProcess.MainWindowTitle '' to process.MainWindowTitle 'Please wait while the application opens'
change title from infologgerProcess.MainWindowTitle '' to process.MainWindowTitle 'ServiceConnect InfoLogger'
change title from infologgerProcess.MainWindowTitle '' to process.MainWindowTitle 'InfoLogger - loading ...
change title from infologgerProcess.MainWindowTitle '' to process.MainWindowTitle 'InfoLogger - Zeus_IE_ASFB-0024_10040_07eda5ba25ad.gsr'
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: f5cb1b9d-3051-c4cc-c0a6-eaba5b7e80fe
* Version Independent ID: e9716fa8-3f4c-bc20-1ade-5f72b61c5e58
* Content: [Process.MainWindowTitle Property (System.Diagnostics)](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.mainwindowtitle?view=netframework-4.7.2)
* Content Source: [xml/System.Diagnostics/Process.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Diagnostics/Process.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Contributor guide
Assessment
This issue has not been assessed yet.