Click here to Skip to main content
16,010,673 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to pause processing? Pin
Mark Salsbery27-Dec-06 12:13
Mark Salsbery27-Dec-06 12:13 
AnswerRe: How to pause processing? Pin
Dustin Henry27-Dec-06 12:36
Dustin Henry27-Dec-06 12:36 
GeneralRe: How to pause processing? Pin
Mark Salsbery27-Dec-06 12:52
Mark Salsbery27-Dec-06 12:52 
AnswerRe: How to pause processing? Pin
Johan Pretorius27-Dec-06 12:40
Johan Pretorius27-Dec-06 12:40 
GeneralRe: How to pause processing? Pin
Johan Pretorius27-Dec-06 12:43
Johan Pretorius27-Dec-06 12:43 
GeneralRe: How to pause processing? Pin
Dustin Henry27-Dec-06 12:51
Dustin Henry27-Dec-06 12:51 
GeneralRe: How to pause processing? Pin
Mark Salsbery27-Dec-06 12:56
Mark Salsbery27-Dec-06 12:56 
GeneralRe: How to pause processing? Pin
Johan Pretorius27-Dec-06 12:57
Johan Pretorius27-Dec-06 12:57 
This should stop all processing (except the messages).


case WM_ACTIVATE:
{
   //See if we lost or gained focus
   if (LOWORD(wParam) == WA_ACTIVE)
   {
     g_bRunning = true;
   }
   else
   {
     g_bRunning = false;
   }
}
break;


static bool m_bRunning = true;

while(TRUE)
{
	// Get the time this function began executing
	//DWORD dwStartTime = GetTickCount();
	// test if there is a message in queue, if so get it
        do
        {
             if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
             { 
		// test if this is a quit
		if (msg.message == WM_QUIT)
		   break;
		// translate any accelerator keys
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
		{
			TranslateMessage(&msg);
			// send the message to the window proc
			DispatchMessage(&msg);
		}
	     } // end if
        } while(!m_bRunning)
 /* Other processing... */
}





Artificial Intelligence is no match for Natural Stupidity

No one can understand the truth until he drinks of coffee's frothy goodness. ~Sheik Abd-al-Kadir

I can't always be wrong ... or can I?


AnswerRe: How to pause processing? Pin
Mark Salsbery27-Dec-06 13:01
Mark Salsbery27-Dec-06 13:01 
GeneralRe: How to pause processing? Pin
Johan Pretorius27-Dec-06 13:16
Johan Pretorius27-Dec-06 13:16 
GeneralRe: How to pause processing? Pin
Mark Salsbery27-Dec-06 13:22
Mark Salsbery27-Dec-06 13:22 
QuestionON_UPDATE_COMMAND_UI never get called Pin
chiheb zak27-Dec-06 8:53
chiheb zak27-Dec-06 8:53 
AnswerRe: ON_UPDATE_COMMAND_UI never get called Pin
Naveen27-Dec-06 16:27
Naveen27-Dec-06 16:27 
GeneralRe: ON_UPDATE_COMMAND_UI never get called Pin
chiheb zak28-Dec-06 5:27
chiheb zak28-Dec-06 5:27 
GeneralRe: ON_UPDATE_COMMAND_UI never get called Pin
Naveen28-Dec-06 16:38
Naveen28-Dec-06 16:38 
GeneralRe: ON_UPDATE_COMMAND_UI never get called Pin
chiheb zak2-Jan-07 9:44
chiheb zak2-Jan-07 9:44 
QuestionSniffing a loopback tcp connection Pin
Federico Milano27-Dec-06 8:49
Federico Milano27-Dec-06 8:49 
AnswerRe: Sniffing a loopback tcp connection Pin
Johan Pretorius27-Dec-06 9:31
Johan Pretorius27-Dec-06 9:31 
QuestionTo Prompt an user. Pin
Marimuthu.r27-Dec-06 5:19
Marimuthu.r27-Dec-06 5:19 
AnswerRe: To Prompt an user. Pin
Mark Salsbery27-Dec-06 5:52
Mark Salsbery27-Dec-06 5:52 
AnswerRe: To Prompt an user. Pin
James R. Twine27-Dec-06 6:10
James R. Twine27-Dec-06 6:10 
Questionhow to get filenames from CFileDialog with multiselection files? Pin
Arris7427-Dec-06 4:25
Arris7427-Dec-06 4:25 
AnswerRe: how to get filenames from CFileDialog with multiselection files? Pin
prasad_som27-Dec-06 5:07
prasad_som27-Dec-06 5:07 
AnswerRe: how to get filenames from CFileDialog with multiselection files? Pin
Mark Salsbery27-Dec-06 5:11
Mark Salsbery27-Dec-06 5:11 
GeneralRe: how to get filenames from CFileDialog with multiselection files? Pin
Hamid_RT27-Dec-06 6:22
Hamid_RT27-Dec-06 6:22 

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.