views:

136

answers:

5

I have a fullscreen window, and I want to prevent pop up windows that appear at the right bottom corner of my screen. I set the Topmost property to true, but apparently it does not help. I also tried activating the form and giving it the focus once it got deactivated, but that did not help either. What is a way to ignore such windows while the user is engaged with the fullscreen app? I am .NET programming in C#.

A: 

Try this guy's solution and see if it does what you want. Seems to me a way to get a form to be system modal

Conrad
A: 

I don't think that you can block all the popups, windows might not let you do that. But you can try with SetWindowPos function and pass it HWND_TOP parameter. It might work a little better than Topmost = true.

Adrian Faciu
A: 

I used a sys tray popup control on my personal project SvnRadar written in WPF.

The control is at the http://www.hardcodet.net/projects/wpf-notifyicon written by Philipp Sumi. Very nice.Only thing you will be need to "detach" it from the SysTray screen coordinates and make it appear where you wish. Hope it helps. Good luck.

Tigran
@tigran: I believed that the guy needs to *hide*, not *display* pop-ups...
serhio
+2  A: 

You can't do it, this fails the "what if two programs tried to do this" test:

  1. those popups are just normal windows like yours, they also use the same top-most style you are using.
  2. if there was a way to always be above other topmost windows they would have used it too rendering it useless (because the authors of the other apps are just as concerned about the user missing their "super important" notifications as you are about them interfering with your full screen app).

You can try and play dirty tricks to force your window to the top of the top-most z-order, but those popups are likely to use the exact same tricks, again making this all useless (and as an extra bonus all those dirty tricks can turn your app into a compatibility nightmare).

Nir
agree 100%. In fact at first I missunderstood the question. You are in the host OS and must not impact on other other application functionality (as much as you can) to respect the users of your application.
Tigran
+1  A: 

You can disable these balloon notifications using these steps:

  1. Click Start, Run and type regedit
  2. Navigate to the following subkey:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

  3. In the right pane, create a DWORD value named EnableBalloonTips

  4. Double-click the new entry, and give it a value of 0.
  5. Quit Registry Editor.
  6. Log off Windows (this is not very cool...), and then log back on for the changes to take effect.

if you need help in how doing this by program, don't hesitate to ask ;)

serhio