views:

23

answers:

2

I am making a windows application which communicates with a microcontroller. Sometimes, communication error occurs which need to be flagged to the user. For instance, if the cable gets unplugged or the microcontroller loses power.

I've been struggling with this for awhile now, i'm back to my original solution. The original solution was to make popups but, other then being annoying, sometimes blocked the MDI parent GUI from updating it's display. Some stuff may happen while the popup is still open and that causes problems.

I've tried making the popup non-modal, and while that helped the GUI, the boss didn't like that the popup could be hidden by other windows.

What are the best-practices for flagging errors?

By the way, i had another thread with my alternate solution problems: http://stackoverflow.com/questions/3604454/tooltip-baloon-display-position-for-error-notification

A: 

You can make a window top-most without making it modal... what language are you coding in?

James B
C# with .net Framework (3.5) I had put it in the tags :)
Lily
Oh, right : ) .
James B
+1  A: 

There are also other ways to communicate with the user... a blinking icon in the system tray, a status light on the main window that turns from green to red when the connection in lost.

* Update *

Blinking an icon in the system tray is as simple as creating a timer, and on the tick event, either display/hide the icon or switch it from one icon to another. You can find an example of this here:
http://www.freevbcode.com/ShowCode.asp?ID=6826

Just reread the question... if you're looking to blink the taskbar window, there's more to it... I wouldn't go with this approach, because (1) blinking taskbar can be disabled by the user, and (2) there's nothing to indicate why it's blinking. But if that's what you want, look here:
http://pietschsoft.com/post/2009/01/26/CSharp-Flash-Window-in-Taskbar-via-Win32-FlashWindowEx.aspx

James B
I have a little cable icon in the statusbar that goes from connected to disconnected when this happened, this didn't seem to be enough for my boss. How can i make something like that blink?
Lily
I have no system tray icon, it's a status bar within the MDI Parent. I don't want to blink anything outside the application's GUI.
Lily
Okay... same answer, a timer, and on the tick hide or display the icon, or switch from one icon to another. Start or stop the timer in whatever detects the broken connection
James B