Hello everyone!

I've downloaded the examples from Nan, just to know how the SetTimer and KillTimer functions need to be implemented in a assembler application.

He uses an dialogbox application , wich is of course very nice, and I want to use a simple windows application.
He don't use a procedure let us call it TimerProc (just like in the MSDN of microsoft).

What i wanna know is:
How must I implement an TimerProc in my program that is being called from the SetTimer procedure (or initiated) and let the KillTimer procedure do his job too.

I already experimented with these and the only rsult was a screen full of messageboxes. They w'ere mine but I only wanted five of those not 500 LOL

The purpose of this application is the make a CPU clock to direct my simulation of a microprocessor that i'm (still) writing.
anyone an idea?

homepage will be online soon!
Posted on 2004-08-06 06:47:58 by raidu
lo raidu,

u might have a look at Iczelion?s Tutorial 18 (Common Controls)
he?s using there a Timer also it?s not a TimerProc

but it shouldn?t be hard to use a Proc instead
it could be something like this

invoke SetTimer,hWnd,IDC_TIMER,100,ADDR TIMERPROC ; create a timer

TIMERPROC proc hWnd:DWORD, uMsg:DWORD, idEvent:DWORD, dwTime:DWORD

ur coding here

Posted on 2004-08-07 03:53:32 by Allanon
Thanks for the quick reply BUT

I already did it the way you suggested and unfortunately it doesn't work. In my timerproc I invoked a message box, and it actually worked! the problem was that it never stopped showing messageboxes not even with a conditional loop. So again my question, can somebody help me.
Maybe a small example will guide me into the light.
Posted on 2004-08-07 06:19:55 by raidu

inside your TimerProc, call KillTimer before you call MessageBox. Otherwise the timer fires repeatedly, filling your message queue with WM_TIMER messages while the MessageBox is on screen.

If that's not the problem, consider posting your code.
Posted on 2004-08-07 10:05:08 by Frank
I surely will test that possibility. However I'm really busy creating objects for masm32 (wich I will put on my homepage as soon I've got the time for it). Those can be used by anyone who as the need for it.
From the moment I (re)start this program, you will see the code or on this messagegroup or n my homepage.
Thanks a lot for your quick reply and if any examples are in your possesion, you may send them if you like!!
Posted on 2004-08-08 05:42:43 by raidu
sorry for the late answer raidu

somethin like this (already mentioned by Frank) should do the job

TimerProc proc hWnd:DWORD, uMsg:DWORD, idEvent:DWORD, dwTime:DWORD

invoke KillTimer,hWnd,idEvent
invoke MessageBox,0,0,0,MB_OK
xor eax,eax

TimerProc endp
Posted on 2004-08-08 05:59:24 by Allanon