Better Tip of the Day dialog
New VC++ look Tip of the day
Standard Component Gallery Tip of the Day dialog
Microsoft supplies a standard Component Gallery item called Tip of the day. IMHO this dialog is quite ugly, so I wrote another one which reproduces the look of the VC++ 4.0 Tip of the Day dialog. System color changes are handled correctly, that is the lightbulb is displayed correctly on the background (COLOR_BTNSHADOW). Therefore the lightbuld is stored in a resource bitmap and the outside of the bulb is filled with COLOR_BTNSHADOW prior to displaying.
There is another most useful feature: the Microsoft supplied Tip of the day class opens the Tip file in the current directory whereas my Tip of the Day class opens the dialog in the folder where the executable resides.
To integrate the new Tip of the day dialog into your application proceed as follows:
- Use the Insert-Component command and insert the tip of the day component. This will add TipDlg.h and TipDlg.cpp to your project.
- Edit stdafx.h and remove the #include <e:\MSDEV\Projects\Tip\TipDlg.h> or whatever line.
- Replace the two automatically generated files TipDlg.h and TipDlg.cpp with those supplied in the sample
- Replace the IDD_TIP dialog with the one supplied in the sample.
- That should be all.
Last updated: 17 July 1998

Comments
Error in OnNextTip()
Posted by Legacy on 02/02/2003 12:00amOriginally posted by: Ralf Sch�fer
ReplyError in constructor
Posted by Legacy on 01/03/2003 12:00amOriginally posted by: Andrew Truckle
I noticed that the constructor uses the creation time of the file to check for alterations of the file.
This is wrong. It should be the modification that is checked.
So modify the st_ctime to st_mtime and the problem is resolved.
You see, if you modify the same file, it will have the same creation time and thus will not return to file position 0, but checking the modified time will return to 0.
ReplyHow to put a scroll bar
Posted by Legacy on 04/02/2002 12:00amOriginally posted by: Rita Shaw
Hi,
I am developing a similar application which would show Message of the Day.However my messages are very long to fit in the rectangle for which I need a vertical scroll to fit the text.
How do i do that
ReplyThanks,
Rita
Correction
Posted by Legacy on 03/18/2002 12:00amOriginally posted by: Anonymous
If you try your sample program on Windows XP you'll see that the gray area containing the bitmap is too light. The reason is that you incorrectly paint it using COLOR_BTNSHADOW.
If you want this dialog box to look like the one in Visual C++ 6.0, you need to use COLOR_APPWORKSPACE instead.
Reply
Addition to use newlines in the tip file
Posted by Legacy on 09/28/2001 12:00amOriginally posted by: James
A really nice class you created here!
To be able to display newlines in the tip dialog, add the following line at the end of the method
void CTipDlg::GetNextTipString(CString& strNext):
strNext.Replace("\\r\\n", "\r\n");
This allows you to enter newlines in the tips.txt file as follows:
Tip of the day line1\r\nLine2
Regards
James
ReplyNew Tip Of The Day - You also need to include SplitPath.cpp/.h
Posted by Legacy on 09/27/2000 12:00amOriginally posted by: Craig Goldie
Hey, just an addition to your steps for getting the new tip of the day dialog - you reference CSplitPath in the TipDlg.cpp and don't mention that people will have to include SplitPath.h/.cpp before it'll compile properly. Otherwise nicely done, it looks great now.
Reply