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.
BUT
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!
I've downloaded the examples from Nan, just to know how the SetTimer and KillTimer functions need to be implemented in a assembler application.
BUT
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!
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
TIMERPROC endp
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
TIMERPROC endp
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.
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.
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.
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.
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!!
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!!
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
ret
TimerProc endp
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
ret
TimerProc endp