11

Many laptops nowadays have FN hot keys to change volume, brightness, etc. and usually display a visual cue that is rendered on the screen completely above the operating system. For new Windows 8/8.1 systems this visual even appears outside of the desktop in the metro side. They cannot be drawing inside of a borderless window otherwise it wouldn't show up over the metro interface.

I have tried researching whether DirectX can draw directly to the screen but it doesn't appear it can. I don't even know if I should look into OpenGL... ?

I had some success using GDI; specifically the GetDC function with the parameter NULL to grab the screen device.

#include <Windows.h>

int main() {
    const HDC dc = GetDC(NULL);
    while (1) {
        Rectangle(dc, 100, 100, 500, 500);
    }
}

However, this requires re-rendering everything repeatedly because my region of the screen can be overwritten by other windows changing in the background. And even with it re-rendering in a loop, there is massive screen flicker.

How do the OEM manufacturers of these laptops achieve this?

Thanks.

Bradley Odell
  • 1,248
  • 2
  • 15
  • 28
  • 2
    i would check shell functionality. note that rendering directly to screen can produce lots of visual artifacts (due to some broken assumptions). – Cheers and hth. - Alf Jul 29 '14 at 21:18
  • Try Windows Presentation Foundation (WPF). It can be used to draw 2D/3D graphics hovering over the desktop or any background. – rashmatash Jul 29 '14 at 21:52
  • Surely the Metro interface also uses the window manager at its core? If you can just get a hold of the right window station / desktop handle, I'm sure it's possible to show windows there as well. What user account does the vendor's overlay process run under (system account or your own)? – flodin Jul 29 '14 at 22:15
  • DirectX and OpenGL won't help, since in windowed mode they're essentially using GDI. With GDI you can use WS_EX_TOPMOST flag when creating a window to keep it on top of all other windows, but I have no idea whether this would work on Windows 8 to draw stuff over the Metro interface. – Ross Ridge Jul 30 '14 at 02:48
  • How does [link](http://sourceforge.net/projects/camstudio/)CamStudio record the desktop? Maybe there's your mechanism? – axon Apr 27 '15 at 05:58
  • take a good look into the extended window-creation options, perhaps some combination of WS_EX_TRANSPARENT (no-input magic!) may be what your looking for: http://stackoverflow.com/questions/6165136/ws-ex-transparent-what-does-it-actually-do – John Bargman Jul 08 '15 at 14:57

1 Answers1

2

It looks like these are borderless windows. For example, have a look at the task switcher window:

Borderless Window

Related question: Windows 8 Layered Windows Over Metro Apps

If you want a window on top of Metro, you need it to declare accessibility.

bish
  • 3,381
  • 9
  • 48
  • 69
MrAnno
  • 754
  • 5
  • 17