a newbie-ish question about windows programming
-
I am writeing a windows program that runs a file i/o function that takes a while to run, and I can't figure out how to make it update the programs window while it is running the funtion. How do I get it to run the window's window procedure in the middle of the function? (I think that is what I have to do..) This is probably a really easy thing to fix, but I can't figure it out. BTW this is a dialog based program (a dialog made in the resource editor) if that makes any difference.. Any help would be greatly appreciated. Thank You.
-
I am writeing a windows program that runs a file i/o function that takes a while to run, and I can't figure out how to make it update the programs window while it is running the funtion. How do I get it to run the window's window procedure in the middle of the function? (I think that is what I have to do..) This is probably a really easy thing to fix, but I can't figure it out. BTW this is a dialog based program (a dialog made in the resource editor) if that makes any difference.. Any help would be greatly appreciated. Thank You.
Hi! Put the following function into your dialog class and call it in the file i/o loop. This will ensure that the window messages are correctly disptached. void CYourDialog::PumpMessages() { static MSG msg; if( GetSafeHwnd() != NULL ) { while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { if( !IsDialogMessage( &msg ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } } } } HTH Holger Persch
-
Hi! Put the following function into your dialog class and call it in the file i/o loop. This will ensure that the window messages are correctly disptached. void CYourDialog::PumpMessages() { static MSG msg; if( GetSafeHwnd() != NULL ) { while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { if( !IsDialogMessage( &msg ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } } } } HTH Holger Persch