Timer

How can i get my program to display a count down timer while the program continues to run. if someone could help me that would be great.

Thanks,
MM
int start = 5000000;
count_sec = GetTicKCount(); //api

count_down_timer = start - count_sec ;
Try this.

1
2
3
4
5
6
7
8
9
10
11
12
13
const int NUM_MS = 1000; // Every second
//...
switch( msg ) {
case WM_CREATE:
    SetTimer( hwnd, 1, NUM_MS, NULL );
    break;
case WM_TIMER:
    //TODO: update counter
    break;
case WM_DESTROY:
    KillTimer( hwnd, 1 );
    break;
}

Topic archived. No new replies allowed.