The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Reminder popup at certain time - thoughts

I'm in the process of adding a reminder feature to an existing app here. Basically, there are tasks and events with due dates and/or scheduled times, and I want to pop up a reminder sort of like Outlook does, when a scheduled time is approaching.

This is pretty straightforward except I'm not sure what "best practices" would dictate for actually detecting that a scheduled time is approaching (or has arrived).

The easiest way is probably to check the system time every minute and update a clock value within the program, but that seems like a pretty nasty, sloppy way to handle it. I'm sure there's a much better way to accomplish this. I'd appreciate any replies on what would be the appropriate manner of doing this.

Nick Send private email
Wednesday, May 07, 2008

1-Use Windows' Scheduler.
2-A different thread calculates the remaining time to the next event, and sleeps for a very long time, the sleep time decreasing as you approach the event.
3-Make times multiples of 5 minutes, Check every 5 minutes?
Totally Agreeing
Wednesday, May 07, 2008
Make sure this is actually a good idea - one of the most disruptive things an application can do is pop a window into your face when you're not expecting it, and steal your focus while it's at it. Unless the matter really is as important as that, you run the risk of getting cheesing users off more than you help them. It's got plenty of scope for ruining that important business presentation, for example.

At the very least make sure there's an option somewhere to turn it off.
Duncan Sharpe
Wednesday, May 07, 2008
+1 Duncan

The window shouldn't steel the focus. Meaning I can happily type along in Word while an Outlook-reminder pops up. Even Live Messenger (WLM) supports those little non-disruptive popups, on emailarrival and the kind.

Once your mind is in the zone, you tend to block out all distractions. I often miss the notification-Window itself on those moments, but one can add *sounds* to the specific events.

Keep it simple; add a timer-component with a high interval. It's highly maintainable and it doesn't waste (that) much resources.
Eddy Vluggen Send private email
Wednesday, May 07, 2008
MS Outlook reminders work well, I always imitate that design when I build this into my apps.
Jason T
Thursday, May 08, 2008
"The window shouldn't steel the focus. "

As of Windows 2000 (I think) a Window can't steel the focus. The OS prevents it.
Thursday, May 08, 2008
"As of Windows 2000 (I think) a Window can't steel the focus. The OS prevents it."

Sorry, but, Is that a joke?

They must have put the feature back in WindowsXP, because applications are stealing my focus all the time.

not a guru Send private email
Friday, May 09, 2008
See the setForegroundWindow API call for more details on how the OS will disallow applications from opening as the foreground window and stealing the focus. Note that there is still a way to do it but it requires a registry setting at installation time.

If other applications are really stealing focus then it is probably because they have explicity set the registry setting to allow them to do it. This of course is NOT considered a "nice thing to do".
Friday, May 09, 2008
Nope. A simple modal dialog will automatically steal focus.


LRESULT OnTmpButton( ... )
  Sleep(1000 * 5);
  CAboutBox about;

Hit the button. Give another app focus. Then wait a couple of seconds and *BOOM*. Focus gone.
Sniffing glue
Sunday, May 11, 2008

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz