Click here to Skip to main content
16,021,115 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: NamedPipe Error in CreateFile Pin
Llasus15-Nov-07 18:38
Llasus15-Nov-07 18:38 
QuestionCapture TEXT in screen Pin
chiwaki15-Nov-07 13:22
chiwaki15-Nov-07 13:22 
AnswerRe: Capture TEXT in screen Pin
chiwaki15-Nov-07 15:37
chiwaki15-Nov-07 15:37 
QuestionHelp Pin
dellthinker15-Nov-07 13:10
dellthinker15-Nov-07 13:10 
QuestionHow to process and update GUI Pin
nrbracke15-Nov-07 11:32
nrbracke15-Nov-07 11:32 
AnswerRe: How to process and update GUI Pin
Mark Salsbery15-Nov-07 11:38
Mark Salsbery15-Nov-07 11:38 
GeneralRe: How to process and update GUI Pin
nrbracke17-Nov-07 12:44
nrbracke17-Nov-07 12:44 
GeneralRe: How to process and update GUI Pin
Mark Salsbery17-Nov-07 13:03
Mark Salsbery17-Nov-07 13:03 
You need to call UpdateWindow() as well, so a WM_PAINT message gets sent to
the window.  That window would need to actually draw in response to WM_PAINT.

You really should be doing lengthy operations on a separate thread if you want your
UI to stay responsive.  By not letting the message loop run, you're preventing the UI
from getting and dispatching the messages it needs.

You could also periodically pump queued messages during your lengthy operation,
something like this:
<span style="color: Green;">// MFC version</span>
MSG msg;
while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) 
{ 
    if (!AfxGetApp()-> PumpMessage()) 
    { 
        break; 
    } 
} 


<span style="color: Green;">// Win32 Version</span>
MSG msg;
while(::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
    ::TranslateMessage(&msg);
    ::DispatchMessage(&msg);
}

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionHow to add menu to CListbox? Pin
Gofur Halmurat15-Nov-07 9:46
Gofur Halmurat15-Nov-07 9:46 
AnswerRe: How to add menu to CListbox? Pin
Mark Salsbery15-Nov-07 10:37
Mark Salsbery15-Nov-07 10:37 
GeneralRe: How to add menu to CListbox? Pin
Gofur Halmurat15-Nov-07 10:59
Gofur Halmurat15-Nov-07 10:59 
GeneralRe: How to add menu to CListbox? Pin
Mark Salsbery15-Nov-07 11:28
Mark Salsbery15-Nov-07 11:28 
GeneralRe: How to add menu to CListbox? Pin
Gofur Halmurat16-Nov-07 6:18
Gofur Halmurat16-Nov-07 6:18 
GeneralRe: How to add menu to CListbox? Pin
Mark Salsbery16-Nov-07 6:22
Mark Salsbery16-Nov-07 6:22 
GeneralRe: How to add menu to CListbox? Pin
Mark Salsbery16-Nov-07 6:25
Mark Salsbery16-Nov-07 6:25 
GeneralRe: How to add menu to CListbox? Pin
Gofur Halmurat16-Nov-07 7:01
Gofur Halmurat16-Nov-07 7:01 
GeneralRe: How to add menu to CListbox? Pin
Gofur Halmurat17-Nov-07 6:04
Gofur Halmurat17-Nov-07 6:04 
GeneralRe: How to add menu to CListbox? Pin
Gofur Halmurat17-Nov-07 11:44
Gofur Halmurat17-Nov-07 11:44 
GeneralRe: How to add menu to CListbox? Pin
Mark Salsbery17-Nov-07 13:05
Mark Salsbery17-Nov-07 13:05 
Questionsort numbers with its index Pin
sarojsigdel15-Nov-07 9:41
sarojsigdel15-Nov-07 9:41 
AnswerRe: sort numbers with its index Pin
George L. Jackson15-Nov-07 12:29
George L. Jackson15-Nov-07 12:29 
GeneralRe: sort numbers with its index Pin
George L. Jackson15-Nov-07 13:20
George L. Jackson15-Nov-07 13:20 
GeneralRe: sort numbers with its index Pin
toxcct15-Nov-07 21:17
toxcct15-Nov-07 21:17 
GeneralRe: sort numbers with its index Pin
George L. Jackson16-Nov-07 1:07
George L. Jackson16-Nov-07 1:07 
GeneralRe: sort numbers with its index Pin
toxcct16-Nov-07 1:28
toxcct16-Nov-07 1:28 

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.