1
\$\begingroup\$

Normally I would create a hidden overlay window and render my DX scene into that, but I think it is possible to render without a window at all as well, is this true? The goal for me is to render on top of all running Windows applications without using a TOPMOST window.

Does someone know how this would approximately be achieved? Thanks!

\$\endgroup\$
1
\$\begingroup\$

Firstly, you can render to a target backbuffer without a swap chain. That's possible, the issue you really have is basically taking over a section of the users desktop to have priority on the desktop. I believe the ability to do this removed back in win 98 days (someone can confirm).

So really, you are left with doing annoying things to bring this to the front. That being, you either can use a windows form or a UWP, but they are in a window. You can though remove the frame of the form firstly to make it look like it has no parent window (UWP does this well). But then you are left with then bringing it to the front of everything, you can do that with a thread that constantly checks if it is in focus and bring it in focus/to the front. But this has the issue that it then takes focus off other applications which makes it aggravationware. I haven't seen other methods that can simulate your requirements, but that's the way I would look to solve for it (for now!).

| improve this answer | |
\$\endgroup\$
-1
\$\begingroup\$

You can render to the full screen by setting the DXGI_SWAP_CHAIN_FULLSCREEN_DESC struct's Windowed property to TRUE. You can use this struct by creating your swap chain with the IDXGIFactory2::CreateSwapChainForHwnd method.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I don't think you can use a swap chain without a window handle. I am trying to render onto the screen without any window handle. \$\endgroup\$ – Steffen Brem Jun 10 '17 at 17:15
  • \$\begingroup\$ You probably can't do it then because creating the window handle (hwnd) is one of the first things when creating a windows application. Or you could create a Universal Windows application which is kind of different. \$\endgroup\$ – János Turánszki Jun 11 '17 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.