Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my application's window border grey in Windows 8, rather than being based off the desktop like other windows?

I have a large legacy application which is showing up with a perpetually grey border on every Windows 8 machine we run it on, while the other windows for other apps accurately use a color derived from the desktop background. For the life of me I can't find out why.

I've tried my best google-fu to crawl MSDN for APIs to control this but came up empty. The app looks like all others in Windows XP, Vista, and 7...just Windows 8 is grey in color. We definitely haven't added Win8 specific code to treat this otherwise.

It's just an MFC window on the outside, but inside it embeds a .NET/WPF component and a Direct3D 9-enabled visual area.

My best guess is it could somehow be related to having a Direct3D surface in the window, but I couldn't validate that anywhere.

Any help would be greatly appreciated!

Thanks

Edit: The grey matches the effect of not having focus, and we definitely do play games with window focus...so that could be it.

like image 769
SentientAI Avatar asked Dec 01 '12 00:12

SentientAI


1 Answers

The problem was a developer overloaded OnNcActivate() and returned TRUE at the end. They needed to call up to the baseclass's (CWnd) OnNcActivate instead.

This was visible on Windows 7 as well if you looked close enough.

like image 99
SentientAI Avatar answered Nov 15 '22 05:11

SentientAI