Click here to Skip to main content
15,891,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: to Run UNIX based EXE [MKS] through Shell in VC++ application Pin
David Crow12-May-08 2:44
David Crow12-May-08 2:44 
AnswerRe: to Run UNIX based EXE [MKS] through Shell in VC++ application Pin
kulkarniquiet12-May-08 17:00
kulkarniquiet12-May-08 17:00 
QuestionRe: to Run UNIX based EXE [MKS] through Shell in VC++ application Pin
David Crow13-May-08 3:35
David Crow13-May-08 3:35 
QuestionMenu item in Visual C++ greyed out and doesn't send command message Pin
Bluesray11-May-08 11:40
Bluesray11-May-08 11:40 
QuestionHow do I code Spin Control dialog button Pin
Kwanalouie11-May-08 9:08
Kwanalouie11-May-08 9:08 
AnswerRe: How do I code Spin Control dialog button Pin
JudyL_MD11-May-08 12:23
JudyL_MD11-May-08 12:23 
AnswerRe: How do I code Spin Control dialog button Pin
David Crow11-May-08 16:42
David Crow11-May-08 16:42 
QuestionProblem with Domodal overide behavior Pin
tom groezer11-May-08 8:25
tom groezer11-May-08 8:25 
I have written the below code in the InitInstance method of application class
I have overwridden the dailog behavior by removing ok and cancel button and also by overiding the deafult behavior of esc and return virtual key down messages.

Now the problem is that I want to have control such that the lines after
dlg.DoModal();</ are executed as they are the lines that kill the dialog. he basic requirement to to kill the dialog only when a particular exe is executed. I'm waiting for this process to complete but that line is after DoModal after which the control is not going.

if (!CreateProcess(NULL, /* No module name (use command line). */<br />
theApp.m_lpCmdLine, /* Command line. */<br />
NULL, /* Process handle not inheritable. */<br />
NULL, /* Thread handle not inheritable. */<br />
FALSE, /* Set handle inheritance to FALSE. */<br />
CREATE_NO_WINDOW, /* Do not display console window */<br />
NULL, /* Use parent's environment block. */<br />
NULL, /* Use parent's starting directory. */<br />
&si, /* Pointer to STARTUPINFO structure. */<br />
&pi)) /* Pointer to PROCESS_INFORMATION structure. */<br />
status = GetLastError();<br />
<br />
CProgressActivityDlg dlg;<br />
m_pMainWnd = &dlg;<br />
//INT_PTR nResponse = <br />
dlg.DoModal();<br />
//if (nResponse == IDOK)<br />
//{<br />
// TODO: Place code here to handle when the dialog is<br />
// dismissed with OK<br />
//}<br />
//else if (nResponse == IDCANCEL)<br />
//{<br />
// TODO: Place code here to handle when the dialog is<br />
// dismissed with Cancel<br />
//}<br />
<br />
MessageBox(NULL, _T("Before loop"), _T("Test"), MB_OK);<br />
WaitForSingleObject(pi.hProcess, INFINITE);<br />
MessageBox(NULL, _T("Out of loop"), _T("Test"), MB_OK);<br />
<br />
CloseHandle(pi.hProcess);<br />
CloseHandle(pi.hThread);<br />
PostMessageW(dlg.GetSafeHwnd(), WM_CLOSE ,0, 0);<br />
// Since the dialog has been closed, return FALSE so that we exit the<br />
// application, rather than start the application's message pump.<br />
AfxGetMainWnd()->PostMessage(WM_CLOSE, 0, 0);<br />
return FALSE;

AnswerRe: Problem with Domodal overide behavior Pin
Mark Salsbery11-May-08 11:10
Mark Salsbery11-May-08 11:10 
AnswerRe: Problem with Domodal overide behavior Pin
Mark Salsbery11-May-08 12:11
Mark Salsbery11-May-08 12:11 
GeneralRe: Problem with Domodal overide behavior Pin
Nelek11-May-08 13:02
protectorNelek11-May-08 13:02 
GeneralRe: Problem with Domodal overide behavior Pin
tom groezer11-May-08 21:16
tom groezer11-May-08 21:16 
GeneralRe: Problem with Domodal overide behavior Pin
Mark Salsbery12-May-08 5:16
Mark Salsbery12-May-08 5:16 
QuestionProblem with Domodal overide behavior Pin
tom groezer11-May-08 8:24
tom groezer11-May-08 8:24 
AnswerRe: Problem with Domodal overide behavior Pin
Nelek11-May-08 13:01
protectorNelek11-May-08 13:01 
QuestionTPM in windows XP. Pin
Green Fuze11-May-08 4:09
Green Fuze11-May-08 4:09 
QuestionRe: TPM in windows XP. Pin
David Crow11-May-08 16:51
David Crow11-May-08 16:51 
AnswerRe: TPM in windows XP. Pin
Green Fuze12-May-08 0:21
Green Fuze12-May-08 0:21 
QuestionIs there any way to remove process from Task manager ? Pin
Yanshof11-May-08 2:45
Yanshof11-May-08 2:45 
AnswerRe: Is there any way to remove process from Task manager ? Pin
Hamid_RT11-May-08 4:26
Hamid_RT11-May-08 4:26 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Yanshof11-May-08 4:33
Yanshof11-May-08 4:33 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Hamid_RT11-May-08 5:07
Hamid_RT11-May-08 5:07 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Yanshof11-May-08 18:42
Yanshof11-May-08 18:42 
GeneralRe: Is there any way to remove process from Task manager ? Pin
Hamid_RT11-May-08 19:04
Hamid_RT11-May-08 19:04 
AnswerRe: Is there any way to remove process from Task manager ? Pin
Maximilien11-May-08 5:03
Maximilien11-May-08 5:03 

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.