The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: timertik on April 15, 2007, 10:16:33 AM

Title: using timers
Post by: timertik on April 15, 2007, 10:16:33 AM
what i want to do is delay my dialog items at the start of the app
I thought using some kind of a timer would be the best place to start

I plan to use ShowWindow to hide and restore the items for example
at startup all the items will be hid then a timer is set for say 7 seconds
after the timer finishes the buttons are restored.

can someone help me get started and show me how to use a timer like this?
Title: Re: using timers
Post by: zooba on April 15, 2007, 11:30:58 AM
invoke SetTimer, hWnd, 1, 7000, 0
...
.if(uMsg == WM_TIMER)
    .if(wParam == 1)
        ; display controls
    .endif
.endif
...


Cheers,

Zooba :U
Title: Re: using timers
Post by: timertik on April 16, 2007, 01:02:30 AM
wow thanks man I didnt know it was that simple very nice and interesting
Title: Re: using timers
Post by: Vortex on April 16, 2007, 05:02:54 PM
timertik,

Don't forget to destroy the timer when it completes the task :

invoke KillTimer,hWnd,ID_TIMER
Title: Re: using timers
Post by: zooba on April 17, 2007, 08:20:33 AM
Quote from: Vortex on April 16, 2007, 05:02:54 PM
Don't forget to destroy the timer when it completes the task :

Oops, forgot that.

BTW. ID_TIMER is whatever you pass to SetTimer in place of the 1, and what you compare wParam to.