Click here to Skip to main content
15,918,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Pop-up Menu Pin
Iain Clarke, Warrior Programmer6-Oct-04 4:54
Iain Clarke, Warrior Programmer6-Oct-04 4:54 
GeneralRe: Pop-up Menu Pin
Rage6-Oct-04 21:07
professionalRage6-Oct-04 21:07 
GeneralProble with OnTimer() Pin
Leyu6-Oct-04 1:36
Leyu6-Oct-04 1:36 
GeneralRe: Proble with OnTimer() Pin
toxcct6-Oct-04 1:57
toxcct6-Oct-04 1:57 
GeneralRe: Proble with OnTimer() Pin
Nathan Holt at EMOM6-Oct-04 5:28
Nathan Holt at EMOM6-Oct-04 5:28 
GeneralRe: Proble with OnTimer() Pin
toxcct6-Oct-04 6:35
toxcct6-Oct-04 6:35 
GeneralRe: Proble with OnTimer() Pin
Nathan Holt at EMOM6-Oct-04 7:02
Nathan Holt at EMOM6-Oct-04 7:02 
GeneralRe: Proble with OnTimer() Pin
Iain Clarke, Warrior Programmer6-Oct-04 5:32
Iain Clarke, Warrior Programmer6-Oct-04 5:32 
As the other reply states, you can't boost the priority of WM_TIMER. It isn't a real message in the
message queue, but is synthesised by windows.

But you can be cunning...

You can override CWinApp::Run and change the message loop to time out once a second, which is lot of
work.

Or...

Create a thread which does nothing much beyond:

DWORD MyTickingThread (LPVOID lpParameter)
{
    HWND hWndNotify = (HWND) lpParameter;
    
    while (g_CarryOnTicking)
    {
        ::Sleep (1000); 
        PostMessage (hWnd, g_TickMessage, 0, 0);
    }

    return 0;
}


Of course, this is a very primitive example, but hopefully you get the idea.
You may want a more sophisticated (CreateEvent, etc) method of signalling to / from
the thread, and so on.

This still won't be exactly on the second, as windows is not a RTOS, but it will be
better WM_TIMER.

Iain.
GeneralRe: Proble with OnTimer() Pin
LittleYellowBird6-Oct-04 5:36
LittleYellowBird6-Oct-04 5:36 
GeneralRe: Proble with OnTimer() Pin
Leyu6-Oct-04 8:01
Leyu6-Oct-04 8:01 
GeneralRe: Proble with OnTimer() Pin
BlackDice6-Oct-04 10:59
BlackDice6-Oct-04 10:59 
Generalexe file not run properly out side of vc++ environment Pin
nirmit6-Oct-04 1:09
nirmit6-Oct-04 1:09 
GeneralRe: exe file not run properly out side of vc++ environment Pin
toxcct6-Oct-04 1:25
toxcct6-Oct-04 1:25 
GeneralRe: exe file not run properly out side of vc++ environment Pin
nirmit6-Oct-04 2:54
nirmit6-Oct-04 2:54 
GeneralRe: exe file not run properly out side of vc++ environment Pin
David Crow6-Oct-04 4:03
David Crow6-Oct-04 4:03 
GeneralRe: exe file not run properly out side of vc++ environment Pin
toxcct6-Oct-04 6:26
toxcct6-Oct-04 6:26 
GeneralRe: exe file not run properly out side of vc++ environment Pin
Sujan Christo6-Oct-04 1:26
Sujan Christo6-Oct-04 1:26 
QuestionHow to create a custom fonts Pin
Azghar Hussain6-Oct-04 0:54
professionalAzghar Hussain6-Oct-04 0:54 
GeneralRe-draw A ListCtrl Pin
sweep1236-Oct-04 0:34
sweep1236-Oct-04 0:34 
GeneralRe: Re-draw A ListCtrl Pin
Rage6-Oct-04 2:12
professionalRage6-Oct-04 2:12 
GeneralCOM Handler Pin
sampal5-Oct-04 23:27
sampal5-Oct-04 23:27 
GeneralRe: COM Handler Pin
Sujan Christo6-Oct-04 0:41
Sujan Christo6-Oct-04 0:41 
QuestionUsing Flash Files? Pin
Zero_One_ADO5-Oct-04 23:13
Zero_One_ADO5-Oct-04 23:13 
AnswerRe: Using Flash Files? Pin
toxcct5-Oct-04 23:19
toxcct5-Oct-04 23:19 
AnswerRe: Using Flash Files? Pin
Maximilien6-Oct-04 0:33
Maximilien6-Oct-04 0:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.