Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding all system messages and messages from other software

Tags:

c

windows

Here is the situation. The company I work for builds this piece of software in c that can make a Windows computer act a bit like a TV. Essentially, our piece of software is meant to be played full screen and content is displayed from the internet without the user having to ever touch the computer again.

The problem is that once in a while, the system brings up pop-ups like "Your Windows system is ready for an upgrade." or "Please renew your Norton subscription" etc. which the user has to periodically and manually remove.

Is there a way to display content full screen without being bothered by those warnings?

like image 306
Randomblue Avatar asked Nov 04 '11 13:11

Randomblue


3 Answers

Yah, whether or not the development community agrees, Microsoft has several standards for when and why it might be acceptable to have exclusive use of the monitor.

The most official strategy is to use DirectX in exclusive mode. This is what games do, what windows media player does in full screen video with hardware acceleration enabled, etc... If your application is multimedia intensive (as suggested by TV like functionality), you should probably be using DirectX too. Besides giving you the exclusive display access it will also increase your applications performance while lowering the CPU load (as it will overload graphics work to the video card when possible).

If DirectX is not an option, there are a great number of hacks available that seem to all behave differently between various generations of windows operating systems. So you might have to be prepared to implement several techniques to cover each OS you plan to support.

One technique is to set your application as the currently running screensaver. A screensaver if really just an EXE renamed to SCR with certain command line switches it should support. But you can write your own application to be such a screensaver and a little launcher stub that sets it as the screensaver and launches it. Upon exit the application should return the original screensaver settings (perhaps the launcher waits for the process to exit so that it returns the settings in both graceful exits and any unplanned process terminations ie: app crash). I'm not sure if this behavior is consistent across platforms though, you'll have to test it.

Preventing other applications from creating window handles is truly a hack in my opinion and pretty bad one that I wouldn't appreciate as a customer of such software.

A constant BringWindowToTop() call to keep you in front is better (it doesn't break other software) but still a little hack-ish.

like image 160
BenSwayne Avatar answered Nov 11 '22 03:11

BenSwayne


Catch window creation messages with a global hook. This way you can close or hide unwanted windows before they become visible.

EDIT: If you definitely want to avoid hooks, then you can call a function periodically, which puts your window to the top of the z-stack.

like image 39
kol Avatar answered Nov 11 '22 03:11

kol


You could disable system updates http://support.microsoft.com/kb/901037 and remove the norton malware.

You could also connect a second screen so that the bubbles appear in the the first monitor.

Or you rewrite it for linux or windows ce.

One final option is to install software that reconfigures your os into a kiosk http://shop.inteset.com/Products/9-securelockdown.aspx

like image 4
Joseph Le Brech Avatar answered Nov 11 '22 01:11

Joseph Le Brech