Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extending and Drawing on the Non-client Area (Windows 8)

Tags:

c#

.net

winforms

I have several programs already made that extended the Non-client area of the Window and drew controls and other things on it - these programs worked well on Windows 7 and Vista.

I've just tried writing some new ones and even using old ones that worked on Windows 7, on my Windows 8 machine and none of them work. A black screen is displayed. I've also tried all of the usual code project articles and other answers here on SO and used their code - but it doesn't matter what code I use, it just doesn't seem possible in Windows 8.

I know that Windows 8 does not have "Aero", but how do I successfully extend the Non-client area of the Window (titlebar) and draw on it?

like image 363
jay_t55 Avatar asked Nov 12 '22 21:11

jay_t55


1 Answers

If you just want to extend the color of the non client area you could get the window color from the registry.

int argbColor = (int)Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software    
    \Microsoft\Windows\DWM", "ColorizationColor", null);
var c = System.Drawing.Color.FromArgb(argbColor);
like image 76
Blue0500 Avatar answered Nov 14 '22 21:11

Blue0500