Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sand clock object

Status
Not open for further replies.

avivhal

Programmer
Nov 14, 2001
9
NL
Hi,
Does anyone know if there is an MFC class to represent the "sand clock"?


Thanks.
 
Perhaps the thing you're after is "hour glass"?

Haven't seen an MFC one though...perhaps you should write it.


/Per
[sub]
if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
[/sub]
 
If you design a class called HourGlass or SandTimer, there are a couple of approaches. You could have it post messages to windows or threads or have it be as simple as

void HourGlass::StartTimer()
{
m_startTime = GetTickCount();
}

DWORD HourGlass::GetElapsedTime() // in milliseconds
{
if(m_startTime)
{
return GetTickCount()-m_startTime;
}
return 0;
}

void HourGlass::StopTimer()
{
m_startTime = 0;
}

That is the basic gist of it. You can expand it to post messages and have a timeout. That would required it to run a thread until the time has elapsed. Once it has elapsed, you can post messages to windows/threads that registered themselves with it.

Matt
 
Sure a Sand Clock or Hour Glass class. Now I know Exactly what you need.

We really could use a forum here at Tek-Tips for Requirements [lol]


-pete
 
To show the hour glass cursor put the following line of code at the top of your loop that is taking some time.

CWaitCursor wait;

Hope this helps.
 
bcravens
>> To show the hour glass cursor
[lol] If that's it, your crystal ball is in top form and you deserve a beer for that one [cheers]


-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top