Click here to Skip to main content
15,889,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: debug function in dll Pin
derek73-Mar-06 21:58
derek73-Mar-06 21:58 
Questionc++ Pin
yaaqub3-Mar-06 21:09
yaaqub3-Mar-06 21:09 
AnswerRe: c++ Pin
Gary R. Wheeler4-Mar-06 4:33
Gary R. Wheeler4-Mar-06 4:33 
QuestionTAPI Pin
_tasleem3-Mar-06 19:55
_tasleem3-Mar-06 19:55 
QuestionProblem with Active X control Pin
Adeel6883-Mar-06 18:05
Adeel6883-Mar-06 18:05 
Questionbinary code and source code and debug Pin
derek73-Mar-06 16:40
derek73-Mar-06 16:40 
AnswerRe: binary code and source code and debug Pin
Stephen Hewitt3-Mar-06 20:04
Stephen Hewitt3-Mar-06 20:04 
QuestionSHELLEXECUTEINFO Pin
Larry Mills Sr3-Mar-06 16:02
Larry Mills Sr3-Mar-06 16:02 
When you load a ".doc" using this:
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof (SHELLEXECUTEINFO);
sei.lpVerb = "open";
sei.lpFile = "RD Bennett13.doc ";
sei.nShow = SW_SHOW;
sei.hInstApp = NULL;
sei.lpDirectory = "C:\\BASIC\\Maps\\";
sei.fMask = SEE_MASK_DOENVSUBST|SEE_MASK_NOCLOSEPROCESS;
sei.lpParameters = NULL;
ShellExecuteEx (&sei);
This loads the "doc" with MS WinWord. but I can't make it close PROGRAMMATICALLY!

How do I close MS WinWord.exe after the user reads and moves on to another function in my program not involving MS WinWord.exe?

I tried using:
STARTUPINFO si = {0};
si.cb = sizeof(si);
PROCESS_INFORMATION pi;
BOOL bOk = CreateProcess(
"C:\\Program Files\\Microsoft Office\\OFFICE11\\WINWORD.exe", // LPCTSTR lpApplicationName
NULL, // LPTSTR lpCommandLine,
NULL, // LPSECURITY_ATTRIBUTES lpProcessAttributes,
NULL, // LPSECURITY_ATTRIBUTES lpThreadAttributes,
FALSE, // BOOL bInheritHandles
0, // DWORD dwCreationFlags
NULL, // LPVOID lpEnvironment
NULL, // LPCTSTR lpCurrentDirectory
&si, // LPSTARTUPINFO lpStartupInfo
&pi // LPPROCESS_INFORMATION lpProcessInformation
);

if ( bOk )
{
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
Of course this doesn't load the particular "doc" I want loaded and it doesn't close the file or MS WinWord.exe either.

How do I close MS WinWord.exe from within my program?



C++ is my favorite programming language
AnswerRe: SHELLEXECUTEINFO Pin
Michael Dunn3-Mar-06 17:07
sitebuilderMichael Dunn3-Mar-06 17:07 
GeneralRe: SHELLEXECUTEINFO Pin
Larry Mills Sr4-Mar-06 0:56
Larry Mills Sr4-Mar-06 0:56 
GeneralRe: SHELLEXECUTEINFO Pin
Gary R. Wheeler4-Mar-06 2:49
Gary R. Wheeler4-Mar-06 2:49 
GeneralRe: SHELLEXECUTEINFO Pin
Malli_S3-Mar-06 21:40
Malli_S3-Mar-06 21:40 
GeneralRe: SHELLEXECUTEINFO Pin
Larry Mills Sr4-Mar-06 0:51
Larry Mills Sr4-Mar-06 0:51 
GeneralRe: SHELLEXECUTEINFO Pin
Larry Mills Sr4-Mar-06 14:12
Larry Mills Sr4-Mar-06 14:12 
Questionwhat is the tech. of MouseKeys Pin
leenmie3-Mar-06 15:33
leenmie3-Mar-06 15:33 
QuestionRunning another application within a window Pin
TuPacMansur3-Mar-06 15:02
TuPacMansur3-Mar-06 15:02 
AnswerRe: Running another application within a window Pin
Naveen3-Mar-06 18:00
Naveen3-Mar-06 18:00 
GeneralRe: Running another application within a window Pin
TuPacMansur3-Mar-06 18:53
TuPacMansur3-Mar-06 18:53 
GeneralRe: Running another application within a window Pin
TuPacMansur3-Mar-06 18:59
TuPacMansur3-Mar-06 18:59 
AnswerRe: Running another application within a window Pin
Malli_S3-Mar-06 21:55
Malli_S3-Mar-06 21:55 
GeneralRe: Running another application within a window Pin
TuPacMansur5-Mar-06 23:43
TuPacMansur5-Mar-06 23:43 
Questiondll Pin
derek73-Mar-06 14:44
derek73-Mar-06 14:44 
AnswerRe: dll Pin
QuickDeveloper3-Mar-06 17:22
QuickDeveloper3-Mar-06 17:22 
QuestionTop margin in CEditView Pin
Hugh S. Myers3-Mar-06 10:20
Hugh S. Myers3-Mar-06 10:20 
AnswerRe: Top margin in CEditView Pin
Richard_483-Mar-06 11:29
Richard_483-Mar-06 11:29 

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.