shaig
asked on
changing WM_TIMER priority
How can i change message priority's in MFC, is it possible at all?
I don't know why, but WM_TIMER is a low priority message, the timer proc. is called after all other messages are handles.
I have tried already:
1) CWinApp::IsIdleMessage
2) SetWritableTmer as an alternative ( so stupid, the thread has to be in a wait/alertable stat - SleepEx )
3) timeSetEvent as an alternative - it's ok, but i would realy want to change that WM_TIMER priority - no semaphores needed + i already finished a whole lot of code writing, based on WM_TIMER...
thanx :-o
I don't know why, but WM_TIMER is a low priority message, the timer proc. is called after all other messages are handles.
I have tried already:
1) CWinApp::IsIdleMessage
2) SetWritableTmer as an alternative ( so stupid, the thread has to be in a wait/alertable stat - SleepEx )
3) timeSetEvent as an alternative - it's ok, but i would realy want to change that WM_TIMER priority - no semaphores needed + i already finished a whole lot of code writing, based on WM_TIMER...
thanx :-o
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The stuff about "eating cpu for 5 seconds..." is obvious, but why the hell is this message handled last?
Is there such a thing called a "message priority"?
Is the source code of the section you descried available anyware?
Since the timer event has to be processed by one praticular thread, another thread won't help because it will have to wait for the first one to have time for it anyway ( event's pass only when a thread is in that stupid alertable wait stat ).
Is there a way to signal ( interrupt ) a thread without having it put to sleep ( or to SleepEx if to be exact ) ?
thank you very much for responding, sorry for beeing such a pian in the butt, oh... and sorry for my poor english.
Is there such a thing called a "message priority"?
Is the source code of the section you descried available anyware?
Since the timer event has to be processed by one praticular thread, another thread won't help because it will have to wait for the first one to have time for it anyway ( event's pass only when a thread is in that stupid alertable wait stat ).
Is there a way to signal ( interrupt ) a thread without having it put to sleep ( or to SleepEx if to be exact ) ?
thank you very much for responding, sorry for beeing such a pian in the butt, oh... and sorry for my poor english.
ASKER