OpenGL Non-exclusive Fullscreen Mode (A.K.A. Fullscreen Borderless Window) - c++

I'm trying to get support for a fullscreen borderless window working but none of the information I've found helps.
Regardless of whether or not the window is set as WS_EX_TOPMOST, the window will always be in exclusive fullscreen mode. I've checked the window styles in games using fullscreen borderless window mode with WinSpy++ and the styles I'm using are identical.
I know it's in exclusive fullscreen mode because WDM stops rendering the little aero preview thing for my window. I also get that desktop flicker from focusing and unfocusing the window.
The only way I've been able to get a behaviour similar to what I want is by tricking windows into thinking I don't want fullscreen mode. The way I do that is by adjusting the window position by 1px so that it doesn't match the position and size of the screen. This stops Windows from automatically turning on exclusive fullscreen mode.
I know in DirectX the solution to this is simply to create the device with the windowed flag set to true. However, I have never seen anything like that in OpenGL.
Edit as per first comment:
I'm not using any third party library for my windowing, just Win32 and OpenGL.
Edit:
I am using WS_POPUP as the window style. With this same window style in some DirectX tests I did, I can properly create a fullscreen borderless window or a fullscreen exclusive window by changing the 'windowed' property.
For hardware I'm using a GTX690 with the latest drivers on Win7 x64.

Use PFD_SUPPORT_COMPOSITION in the PIXELFORMATDESCRIPTOR of ChoosePixelFormat/SetPixelFormat.
See The OpenGL Pipeline Newsletter - Volume 003

Related

Qt event when switching desktops

I am currently using a Mac to test my software, I have a fullscreen Qt window that opens a floating Qt::Tool on top of it. I would love for the Qt::Tool to be linked to the fullscreen window, however when switching between desktops (three-finger swipe), the Qt::Tool is displayed on the other desktops although its parent window is in fullscreen in another desktop.
Is there an event that handles switching desktops so that I know when a window is no longer in focus and hide its child windows/tools?
Thank you very much in advance.
You are probably using some set of window flags that leads to this behaviour. Try to change those and see if you can get it to work like you want. I bet Mac handles one of the window flags you set in a special way such that it carries across virtual desktops.

How to create a borderless window with titlebar in windows c++

I am trying to create a Direct3D app that is operating in windowed mode with a title bar and minimize/quit button. However, I'd really like to be able to axe the border around the window.
I am looking to do this because it looks pretty cheesy on dual monitors when the app is filling the primary monitor horizontally (with room to move the app vertically), but its window border overflows onto the secondary screen. I've tried a bunch of combinations of setwindowlong with GWL_STYLE and GWL_EXSTYLE, but can't seem to make headway unless I disable the title bar.
I've seen a bunch of apps that are borderless however they seem to emulate the title bar rather than using the built in one provided by Microsoft.
Thanks for any suggestions.
You can't remove the border and keep the titlebar AFAIK.
You can reimplement the titlebar by using WM_NCHITTEST but you still need to draw it yourself which would not be a bad idea if you want your D3D app to look its best.
Visual Studio, last time I checked, achieves its border with transparent layered windows standing behind the primary one. They are the shadows you see.

DWM, how to not render a window?

My application is a fullscreen window rendering a specified window or the desktop.
I would like to know if it's possible to fetch the window bitmap (like i'm already doing) but without the render of my window's application ?
There is the idea : dwm.giveBitmapWithoutRendering(HWND myApplicationHandler)
Working on Windows 7/8/8.1, QTCreator C++ MINGW
You can use the PrintWindow function with your own memory DC. The success of this method will depend on how the window and its child windows have implemented the WM_PRINT message.
This doesn't use DWM but rather gets the window to repaint itself. Since it's not repainting to the screen I hope it meets your requirements.

MFC: how to create Skinnied Dialog with transparent PNG as backrownd (and instead of window chrome)?

So here is a grate small, readable MFC sample. But its background is a solid image; I wonder how to create a transparent PNG as app backround?
There are two basic methods to alter the non-client ("chrome") area of windows.
Layered windows, were introduced in Windows XP - and allow varying levels of window effects. The technique here is to add the WS_EX_LAYERED style to a window - which prevents the WM_PAINT (in MFC CWnd::OnPaint) from operating. Instead, layered windows are painted by the application calling UpdateLayeredWindow, providing a DIBSection filled with pre-multiplied 32bpp data.
Windows Vista introduced the Desktop Window Manager, that composes windows before painting them to enable desktop alpha effects. Using the DWM API to get alpha effects is not as customizable as a PNG, but is still quite attractive.
Both techniques run into problems as child window painting is not alpha aware - layered windows simply don't paint child windows so you need to enumerate and paint all child controls to offscreen surfaces manually. DWM windows do paint child controls - but none of the standard windows controls available to native Apps has been modified to be alpha aware.
Ironically, .NET WinForms apps, on the surface appear to simply wrap the standard windows common controls, but actually all the standard controls have been redeveloped for .NET, and they paint correctly when placed in the 'glass' area of windows.

Need transparent overlay window to draw lines on top of window drawing video? ::MFC,C++,windows::

How do you create a transparent window that can be placed over another window that is actively having streaming video drawn to it. I want to create a window on top of the video window that I can draw on without video constantly drawing back over it.
I can create a window from a transparent dialog resource and set its z-order using SetWindowPos(...) but it doesn't seem to have any effect. Having the dialog set as a WS_CHILD style or WS_POPUP also appears to have no effect.
I'm using a media (video) framework another development group in my company developed and am providing a window handle to that code. That handle is being used by their rendering plugin in the pipeline that uses Direct3d for rendering the video on that window surface.
Video is rendered to a hardware overlay in the video adapter. You'll need to create your own to overlay that overlay. I think DirectX provides that capability, you can also get it by using the WS_EX_LAYERED window style and the SetLayeredWindowAttributes(). Which you'll need to set the transparency key. Not so sure that's a slam-dunk btw, I've seen this behave oddly.