Please can someone help me. i don't know where to start.
i need to write a programme in c/C++. the features of the programme are stated below:
Write a program for Windows XP that makes a countdown timer in your Tray (at the bottom of the screen).

When you right click it, there is a menu that pops up and allows me to...

Set time (Years/Days/Minutes/Seconds)
Restart when it reaches zero (yes/no)
Close Program

The source code should be in Borland C++ Builder 5 or 6.

Dani AI

Generated

Practical starting plan for 's Windows‑XP tray countdown: implement the tray icon with the Shell API (Shell_NotifyIcon / NOTIFYICONDATA) so the app gets mouse callbacks and can update the tooltip/balloon on the fly, or install a small third‑party tray component if a VCL wrapper is preferred. Note that older C++Builder/VCL releases didn’t ship a built‑in tray control, so many projects use a component package instead of calling the API by hand. As requested, showing starter code helps; as noted, this looks like a typical assignment — the steps below give a clear, minimal route. NOTIFYICONDATA (MSDN). (learn.microsoft.com)

Minimal implementation steps (order matters): create a hidden window to receive a custom callback message (e.g. WM_USER+1), call Shell_NotifyIcon(NIM_ADD) with NIF_MESSAGE|NIF_ICON|NIF_TIP, handle the tray callback for WM_RBUTTONUP / WM_LBUTTONDBLCLK and show a popup menu with TrackPopupMenu. Call SetForegroundWindow before TrackPopupMenu so the menu closes correctly, and use NIM_MODIFY to change the tooltip text as the countdown updates. For balloon hints use NIF_INFO / uTimeout on Win2000/XP. See the practical Shell_NotifyIcon examples for the common pitfalls. (codeproject.com)

Example snippets (conceptual — adapt to Borland/VCL types):

/* convert Y/D/H/M/S (treat 1 year = 365 days) */
totalSec = years*365*24*3600 + days*24*3600 + hours*3600 + minutes*60 + seconds;

/* NOTIFYICONDATA: add and later modify tooltip */
NOTIFYICONDATA nid;
memset(&nid,0,sizeof(nid));
nid.cbSize = sizeof(nid);
nid.hWnd = hWnd; nid.uID = 1;
nid.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP;
nid.uCallbackMessage = WM_USER+1;
nid.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_MYICON));
strncpy(nid.szTip,"Remaining: 00:10:00",sizeof(nid.szTip)-1);
Shell_NotifyIcon(NIM_ADD,&nid);
/* update: change nid.szTip then Shell_NotifyIcon(NIM_MODIFY,&nid) */

Keep these cautions in mind: use a 64‑bit accumulator if large intervals are possible; tooltip text is limited (64/128 chars depending on OS); decide whether “years” means calendar years or fixed 365‑day spans — for calendar accuracy compute a target datetime and subtract current time. If preferring a component, packages like the TTrayIcon/CoolTrayIcon families are available for CB5/6 and wrap the API and popup handling. TTrayIcon on Torry’s · Tray icons index / CoolTrayIcon. (torry.net)

Recommended Answers

All 2 Replies

>The source code should be in Borland C++ Builder 5 or 6.
That's gives us the impression that you want us to write it for you, which isn't going to happen. Show us what you've tried so far instead of just posting your requirements, and we'll help you get it working.

>The source code should be in Borland C++ Builder 5 or 6.
That's gives us the impression that you want us to write it for you, which isn't going to happen. Show us what you've tried so far instead of just posting your requirements, and we'll help you get it working.

Agree... sounds a little to much like classwork to me though, like many of these kinds of questions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.