0

I am working on an application that would display things(graphics, texts, etc) like an OSD in Windows. The problem is that I am a newbie in windows programming and I couldn't find any proper solution.

What I've tried:

1: I tried to create a layered window with the WS_EX_LAYERED flag:

CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOPMOST | WS_EX_TOOLWINDOW, szWindowClass, NULL, WS_POPUP | WS_VISIBLE | WS_SYSMENU, 0, 0, 0, 0, hWndDesktop, NULL, hInstance, NULL);

The problem is with this approach is that everything works fine, I can draw any images or texts on the screen until I am not in fullscreen in other application. For example playing videos.

After searching a lot I have found an other solution for my problem:

2: Direct3D

I found a code example and a good tutorial at msdn: http://msdn.microsoft.com/en-us/library/windows/desktop/dd797814(v=vs.85).aspx, but there is a problem(as always). It seems to me it uses a hardware overlay which is not supported in every graphics card. For example: ATI Radeon HD 6XXXX. But it is exactly what I need.

Does anyone know a proper solution that doesn't need hardware support? Or did I do something wrongly?

Norbert
  • 302
  • 1
  • 9
  • 19
  • Just use the [OSD sample code](http://msdn.microsoft.com/en-us/library/windows/desktop/dd940515%28v=vs.85%29.aspx) and tweak it the way you want it. – Hans Passant Aug 20 '13 at 15:08
  • I've never thought that I should search for an example at audio related samples :) Thanks! I take a look on this. – Norbert Aug 20 '13 at 15:17
  • It is exactly the same solution that I mentoined in the 1. It sometimes works and sometimes doesnt when windows media player is in fullscreen. And I dont know why. – Norbert Aug 20 '13 at 16:02
  • It is very strange for me, because it is working if you play in fullscreen with some games, but not working with some other ones. – Norbert Aug 20 '13 at 16:36

2 Answers2

1

I solved the problem. I hope it will be helpful for someone:

So the only problem was that i didnt bring the window to the foreground after I had drawn on it. You can do it by calling the SetWindowPos. Altough this solution isnt working on Windows 8 metro surface.

Norbert
  • 302
  • 1
  • 9
  • 19
0

Did you try with SetWindowsRgn?

Mauro H. Leggieri
  • 1,084
  • 11
  • 25