question

Emmett avatar image
0 Votes"
Emmett asked RLWA32-6355 commented

Display a customized OSD (on-screen display), like windows 10 volume OSD, when a specific hot key is pressed

Hi,

I am developing Desktop/UWP application on windows 10. And I have a little development experience with WDM/WDF.
My vendor has a request to do that display a customized OSD (on-screen display), like windows 10 volume OSD, when a specific hot key is pressed.
The customized OSD will displayed for a few seconds and must be displayed on the top overlay everything.

AFAIK, it is impossible in normal application.
I already try the win7 audio osd example (https://github.com/microsoft/Windows-classic-samples/tree/master/Samples/Win7Samples/multimedia/audio/osd),
and read this article: "How do I create a topmost window that is never covered by other topmost windows?" (https://devblogs.microsoft.com/oldnewthing/?p=11253)

I also use the keyword "OSD", "on screen display" to search, but no found useful answer to me.

Our application/driver will bundle in windows 10 device.
1. Is there a way to request some privilege let application to to that?
2. Can driver do that? what kind of driver?


P.S.
Tags request but, I can not key any relative tag.
It show: The following tags do not exist, and you don't have permissions to create new ones: Windows 10, OSD, on screen display, desktop, driver

Thanks,
Emmett

windows-api
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

As these two questions show 1 2, you can create a WS_POPUP | WS_VISIBLE Window Styles, WS_EX_TOPMOST | WS_EX_LAYERED Extended Window Style Window. and Then drawing on it Just As the attached sample.


0 Votes 0 ·

Thank you,

I tested these window style, but still can not overlay everything. I also build and run the sample "OSDwindow", download from link 2, but it also didn't work.
These solution not work on some situations, such as:
1. task manager with "always on top"
2. UWP (such as Movies & TV) in full screen mode

But windows 10 volume OSD can overlay.

0 Votes 0 ·

You can make change based on windows 10 volume OSD sample which also create a WS_POPUP style and WS_EX_LAYERED | WS_EX_TOPMOST | WS_EX_NOACTIVATE extended style window.

0 Votes 0 ·
Show more comments

1 Answer

RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered RLWA32-6355 commented

Try configuring your application so that it runs with UIAccess=true and with a window that is WS_EX_TOPMOST.
In order to run with UIAccess it must be properly manifested, signed and loaded from a secure location (e.g., C:\Program Files..., C:\Windows\System32).

In my quick and dirty test a Windows desktop application was able to place itself in the Z-order above other windows. It always appeared above windows (even TOPMOST) of other applications that did not have UIAccess privileges. But there is no guarantee that it would always appear over TOPMOST windows created by other UIAccess enabled applications.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you.
It work now.

Record my step for those who have the same problem:
1. Download win7 audio osd example (https://github.com/microsoft/Windows-classic-samples/tree/master/Samples/Win7Samples/multimedia/audio/osd)
2. Open from VS2019
3. Set UIAccess to true in "Project properties - Linker - Manifest File"
4. Set Treat Warnings As Errors to No in "Project properties - C/C++" or fix warning:
osd.cpp(147): warning C4838: conversion from 'UINT' to 'LONG' requires a narrowing conversion
4. build the OSD project
5. Sign OSD.exe
6. Put OSD.exe to C:\Program Files (x86)\OSD\OSD.exe and run it

In step 5, I got a error "A referral was returned from the server" at the beginning, but then I found the solution from the post:
Problem with manifest and uiAccess set to true...
https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/350ceab8-436b-4ef1-8512-3fee4b470c0a/problem-with-manifest-and-uiaccess-set-to-true?forum=windowsgeneraldevelopmentissues

0 Votes 0 ·

You're welcome.

0 Votes 0 ·