Click here to Skip to main content
15,898,718 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: problem in Access database use with CRecordset class. Pin
Niklas L8-Oct-10 21:32
Niklas L8-Oct-10 21:32 
GeneralRe: problem in Access database use with CRecordset class. Pin
Le@rner8-Oct-10 21:43
Le@rner8-Oct-10 21:43 
AnswerRe: problem in Access database use with CRecordset class. Pin
David Crow9-Oct-10 15:58
David Crow9-Oct-10 15:58 
QuestionErrors not being reported on Windows Server 2003 box Pin
Interrobang8-Oct-10 10:06
Interrobang8-Oct-10 10:06 
AnswerRe: Errors not being reported on Windows Server 2003 box Pin
Rolf Kristensen8-Oct-10 12:01
Rolf Kristensen8-Oct-10 12:01 
QuestionWhen is an MFC application fully realized or how to reclaim focus/activation ? Pin
Maximilien8-Oct-10 4:26
Maximilien8-Oct-10 4:26 
AnswerRe: When is an MFC application fully realized or how to reclaim focus/activation ? Pin
Moak8-Oct-10 5:03
Moak8-Oct-10 5:03 
GeneralRe: When is an MFC application fully realized or how to reclaim focus/activation ? Pin
Maximilien8-Oct-10 8:08
Maximilien8-Oct-10 8:08 
Moak wrote:
SW_SHOWNOACTIVATE


Thanks for the info ..

I tried doing this with a simple dummy project and it does not work, B (the secondary application) is still active after the CreateProcess.

// for the sake of experimenting, created a simple MDI application (A) and a simple dialog application (B)
void CMainFrame::OnOpensubOpen()
{
	PROCESS_INFORMATION pi;
	ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
	STARTUPINFO si;
	CString cCommandLine=_T("C:\\Users\\me\\Documents\\B\\Debug\\B.exe");

	ZeroMemory( &si, sizeof( STARTUPINFO ) );
	si.cb = sizeof( STARTUPINFO );
	si.dwFlags = STARTF_USESHOWWINDOW;
	si.wShowWindow = SW_SHOWNOACTIVATE;

	if( CreateProcess( NULL, cCommandLine.GetBuffer(), NULL, NULL, FALSE,  NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi ) )
	{
		WaitForInputIdle (pi.hProcess, INFINITE);
	}
}


The SW_SHOWNOACTIVATE (or SW_SHOWMINNOACTIVE or SW_SHOWNA ) does not work, the B application is still activated when started up;I've been able to "make it work" by using SW_MINIMIZE (doc says it will activates the next top-level window in the Z order).

Maybe I'm not certain what is active or not when a new UI process is created; When I create the process B, A is active, so if be is launched with the SW_SHOWNOACTIVATE flag, A should not be de-activated ?

Thanks again, still looking into this.
Max.
Watched code never compiles.

GeneralRe: When is an MFC application fully realized or how to reclaim focus/activation ? Pin
Moak8-Oct-10 9:04
Moak8-Oct-10 9:04 
AnswerRe: When is an MFC application fully realized or how to reclaim focus/activation ? Pin
Sauro Viti8-Oct-10 5:04
professionalSauro Viti8-Oct-10 5:04 
AnswerRe: When is an MFC application fully realized or how to reclaim focus/activation ? Pin
Joe Woodbury10-Oct-10 9:08
professionalJoe Woodbury10-Oct-10 9:08 
QuestionScrollbar move with mouse ? Pin
mesajflaviu8-Oct-10 2:51
mesajflaviu8-Oct-10 2:51 
AnswerRe: Scrollbar move with mouse ? Pin
Sauro Viti8-Oct-10 3:51
professionalSauro Viti8-Oct-10 3:51 
GeneralRe: Scrollbar move with mouse ? Pin
mesajflaviu8-Oct-10 5:49
mesajflaviu8-Oct-10 5:49 
GeneralRe: Scrollbar move with mouse ? Pin
Sauro Viti8-Oct-10 10:25
professionalSauro Viti8-Oct-10 10:25 
GeneralRe: Scrollbar move with mouse ? Pin
mesajflaviu9-Oct-10 2:27
mesajflaviu9-Oct-10 2:27 
AnswerRe: Scrollbar move with mouse ? Pin
mesajflaviu11-Oct-10 0:30
mesajflaviu11-Oct-10 0:30 
QuestionCodeJocks ToolkitPro in VS 2010? Pin
Stefan_Lang7-Oct-10 5:42
Stefan_Lang7-Oct-10 5:42 
AnswerRe: CodeJocks ToolkitPro in VS 2010? Pin
Rhuros7-Oct-10 23:29
professionalRhuros7-Oct-10 23:29 
GeneralRe: CodeJocks ToolkitPro in VS 2010? Pin
Stefan_Lang8-Oct-10 2:58
Stefan_Lang8-Oct-10 2:58 
GeneralRe: CodeJocks ToolkitPro in VS 2010? Pin
Rhuros8-Oct-10 3:27
professionalRhuros8-Oct-10 3:27 
GeneralRe: CodeJocks ToolkitPro in VS 2010? Pin
Stefan_Lang8-Oct-10 3:41
Stefan_Lang8-Oct-10 3:41 
AnswerRe: CodeJocks ToolkitPro in VS 2010? Pin
Rhuros8-Oct-10 4:47
professionalRhuros8-Oct-10 4:47 
GeneralRe: CodeJocks ToolkitPro in VS 2010? Pin
Stefan_Lang8-Oct-10 6:25
Stefan_Lang8-Oct-10 6:25 
QuestionVC++ debugger, mouse-over variable inspection question Pin
Dave Calkins7-Oct-10 3:18
Dave Calkins7-Oct-10 3:18 

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.