471,605 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Killing a Shell_NotifyIcon balloon tip and powering on monitor in C#


I have hunted round the web and managed to put together some code which
displays a balloon tip for a notification icon in the system tray when
I am running a windows service. This times out after about 10 seconds
if I move the mouse around the screen which is pretty much okay, but if
I don't do anything the balloon just stays showing for a long time. Is
there a method to kill this balloon tip without killing the whole icon
(a method I have temporarily employed is making the icon invisible and
then making it visible again the next time I want to display a balloon
tip). Ideally, I would like the icon to remain so users are able to
see the service is running in the background.

Also, does anyone know how to power up the monitor when Power
Management has switched the monitor off from within code? I have tried
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MONITORPOWER = 0xF170;
public const int MONITOR_ON = 1;
public const int MONITOR_OFF = 2;

[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, int

static extern IntPtr GetDesktopWindow();

SendMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_MONITORPOWER, 1);

without success.

Kieran Lee

Jan 12 '06 #1
1 2218
As is often the case, I sussed out the first part of my query moments
after sending the email by simply adding a timer and raising an even
when the timer elapsed.

Still stumped as to the power management though.

Jan 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Daniel Bickett | last post: by
2 posts views Thread by Aki Niimura | last post: by
2 posts views Thread by Ahsan | last post: by
2 posts views Thread by Andrea V.F. | last post: by
reply views Thread by Eric | last post: by
1 post views Thread by MrNobody | last post: by
3 posts views Thread by Ed Courtenay | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.