dwm

Prevent Win32 from drawing classic title bar

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 03:13:16
问题 I wanted to add a nice shadow to my borderless form, and the best way I found to do it with minimal performance loss is to use DwmExtendFrameIntoClientArea. However, this seems to be causing Windows to draw a classic title bar over the window, but it is non-functional (ie. the glitch is merely graphical). This is the code I am using: int v = (int) DWMNCRENDERINGPOLICY.DWMNCRP_ENABLED; NativeApi.DwmSetWindowAttribute(Handle, DwmWindowAttribute.NCRENDERING_POLICY, ref v, sizeof(int)); int

Windows: send Mouse/Keyboard event to background window?

别等时光非礼了梦想. 提交于 2019-12-06 12:17:47
问题 My application is a fullscreen window which is rendering a designated other window (from dwm), for example Google Chrome. I would like to know if it's possible to send events (such as mouse keyboard events) to the specified window. Of course the designated window has to stay in background, and my current application on the foreground. My application is written in C++. I'm working on Windows 7/8. 回答1: Just to put it into an answer. Based on this question Does any program/language/library that

Acrylic material in win32 app

烈酒焚心 提交于 2019-12-06 05:38:40
问题 Microsoft recently revealed their new "fluent" design langauge, and one part of it is the "acrylic" material. This effect makes an element transparent and blurs the background. It can either be applied to a window, such that parts of underlying windows shine though (background acrylic), or to individual elements in the window, so other controls shine through (in-app acrylic). It is conceptually and visually very similar to vibrancy on macOS. It is implemented as a special Brush in XAML, but I

Custom window frame with DWM: how to handle WM_NCCALCSIZE correctly

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 11:06:45
I'm trying to make a custom window frame for my form using DWM. The platform is C# WinForms, Pinvoking DWM. Following the MSDN article on making custom window frame with DWM , the main steps are next: Remove standard frame (non-client area), returning 0 in answer to WM_NCCALCSIZE message Extend the frame into client area using DwmExtendFrameIntoClientArea function I handle WM_NCCALCSIZE message in the next way: protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_NCCALCSIZE: if (isDwmWindowFramePaintEnabled() && m.WParam != IntPtr.Zero) { m.Result = IntPtr.Zero; } else {

Prevent Win32 from drawing classic title bar

人盡茶涼 提交于 2019-12-05 06:06:15
I wanted to add a nice shadow to my borderless form, and the best way I found to do it with minimal performance loss is to use DwmExtendFrameIntoClientArea . However, this seems to be causing Windows to draw a classic title bar over the window, but it is non-functional (ie. the glitch is merely graphical). This is the code I am using: int v = (int) DWMNCRENDERINGPOLICY.DWMNCRP_ENABLED; NativeApi.DwmSetWindowAttribute(Handle, DwmWindowAttribute.NCRENDERING_POLICY, ref v, sizeof(int)); int enable = 0; NativeApi.DwmSetWindowAttribute(Handle, DwmWindowAttribute.ALLOW_NCPAINT, ref enable, sizeof

Drawing in the extended frame gives strange colors

旧巷老猫 提交于 2019-12-05 02:44:49
问题 I have a window with extended frame made like this: Custom Window Frame Using DWM But anything drawn in the extended frame has very strange colors (except for white, the only color that stays the same), like this (ignore the messy content in the center and the messy toolbar at the right. The pink rectangle ( 0xFFC9FF ) was supposed to be 0x8000FF . If I put the DirectX11 content (the center thing) in the extended frame, alpha blending for my FPS counter gets messed up. If I do the same to the

WINAPI/DWMAPI Blur-behind window with irregular shape

左心房为你撑大大i 提交于 2019-12-05 01:51:08
问题 NB: THIS IS NOT A QUESTION ABOUT A BORDERLESS WINDOW. So, I stumbled upon this program while I was exploring my Start menu the other day on Windows 7: It's a native Windows program, called "Math Input Panel." Now, I'm curious about the window shape. I know that it's not completely drawn by DWM, because the borders and Close button look fishy and the window has no drop shadow (I have drop shadows enabled). My first guess as to how this was made would be using DwmEnableBlurBehindWindow , but I

Custom dwm drawn window frame flickers on resizing if the window contains a HwndHost element

不羁岁月 提交于 2019-12-05 00:39:32
问题 I've been thinking about this for a couple of days but I think I lack some basic understanding of how windows and wpf work internally to figure this out. The problem is this: I created a window that should let me draw wpf controls on an aero title bar (like office). This works fine as long as I don't add a Hwndhost element to the window, in this case whenever i resize it the frame and the HwndHost start to flicker pretty badly (other elements seem to render properly). I also tried using the

DwmExtendFrameIntoClientArea strange behaviour on Windows 10

六眼飞鱼酱① 提交于 2019-12-04 23:04:52
问题 I'm having some trouble extending the window frames using DwmExtendFrameIntoClientArea on Windows 10. The images below show the behaviour I'm getting: The white titlebar colour is extended from the top, while from the sides and the bottom it extends the coloured edge of the window. If I set the margins all to -1 to extend the frames all the way, the window is filled with white and loses its coloured edge altogether: This result is very inconsistent, I was expecting the white colour to be

Windows: send Mouse/Keyboard event to background window?

寵の児 提交于 2019-12-04 19:45:06
My application is a fullscreen window which is rendering a designated other window (from dwm), for example Google Chrome. I would like to know if it's possible to send events (such as mouse keyboard events) to the specified window. Of course the designated window has to stay in background, and my current application on the foreground. My application is written in C++. I'm working on Windows 7/8. AnotherUser Just to put it into an answer. Based on this question Does any program/language/library that interacts with windows do it via the WIN32 API? you should be able to use the windows API to