d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Countdown Message Box In C
Add Reply New Topic New Poll
Member
Posts: 29,347
Joined: Mar 27 2008
Gold: 504.69
Mar 24 2016 08:04pm
Looking for some help.

I need to come up with a message box that pops up and has a countdown timer that count down from 15 seconds.
With two buttons, okay and cancel.
After the countdown some action will take place.
If okay is hit the action takes place immediately.
If cancel is hit the action is cancelled.

Having some trouble using <windows.h> and MessageBox since you can't easily update it.

It has to be done with C and no other language. If it can't be done I need to come up with some alternative, also using C though.
Any help would appreciated.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 24 2016 08:07pm
Quote
Having some trouble using <windows.h> and MessageBox since you can't easily update it.


so i assume that means you have the timer working perfectly, but you're not sure how to update the UI to reflect it? message boxes in general are not designed to have an updated message. you'll probably have to create your own dialog box.

a quick google search found someone who wrote a lib for this. http://www.johnfindlay.plus.com/lcc-win32/winprog/winprog.htm

scroll down to XMsgBox

This post was edited by carteblanche on Mar 24 2016 08:12pm
Member
Posts: 29,347
Joined: Mar 27 2008
Gold: 504.69
Mar 25 2016 10:06pm
Quote (carteblanche @ Mar 24 2016 10:07pm)
so i assume that means you have the timer working perfectly, but you're not sure how to update the UI to reflect it? message boxes in general are not designed to have an updated message. you'll probably have to create your own dialog box.

a quick google search found someone who wrote a lib for this. http://www.johnfindlay.plus.com/lcc-win32/winprog/winprog.htm

scroll down to XMsgBox


Thank you. This is exactly what I was looking for but I don't think I will use it (it's for a project, and I feel the instructor will frown upon it).
Not sure what I am going to do otherwise, but thanks none the less.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll