Message board for the users of flat assembler.
> Windows > How windows execute settimer ?
Roman 16 Jul 2022, 11:16
Windows 10 64 bits. My processor AMD Ryzen 3500 CPU Cores 6
I not understood how work settimer(callback proc) on CPU.
callback proc run on threads ?
Or one core ?
I try settimer and set my proc.
invoke SetTimer,0,16,1100,Timerproc proc Timerproc HWND,uint1,uint2,uint3 invoke MessageBox,0,.txt ,0,0 ret .txt db 'buttn Timerproc0',0,0 endp
I thinked Timerproc run and wait when i press ok.
But i get many message boxes.
Its confused me.
And i not understood how exactly work settimer.
|16 Jul 2022, 11:16||
macomics 16 Jul 2022, 11:54
To block the execution of the program, MessageBox starts its own message processing cycle.
SetTimer adds the trigger time to the array/waiting list in chronological order and, with each timer interrupt, the handler checks the first element of this array/list for triggering. If it worked, a message from the timer is added to the message queue.
The first message on the timer selects your message processing cycle, and the rest - the message processing cycle of the last MessageBox shown.
To prevent such an effect, it is worth stopping the timer for the duration of its function or creating an execution flag (Event/Critical section, etc.)
|16 Jul 2022, 11:54||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.