Skip to content

Brief flashing when launched #1781

@choung

Description

@choung

While developing a small desktop app with .NET 4.5, I noticed a brief flashing(?) when my app is launched from Windows file manager. When I double click my exe, the file manager naturally loses its input focus, but it gets the focus back briefly and then loses the focus again to my app. Metro Demo also shows the same problem.

not a bug... but definitely annoying...
Anyhow, I track down the problem and found the following:

MahApps.Metro\Microsoft.Windows.Shell\SystemParameters2.cs

168: // This might flash a window in the taskbar while being calculated.
169: // WM_GETTITLEBARINFOEX doesn't work correctly unless the window is visible while processing.
170: NativeMethods.ShowWindow(_messageHwnd.Handle, SW.SHOW);
171: NativeMethods.SendMessage(_messageHwnd.Handle, WM.GETTITLEBARINFOEX, IntPtr.Zero, lParam);

Have you considered changing "SW.SHOW" to "SW.SHOWNA" in line 170?

It definitely solved my problem (I was only able to test it on Windows 8.1.). But, judging from the comment, you guys already knew about the issue. Is there some side effects using SHOWNA instead of SHOW?

Thanks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions