Click here to Skip to main content
16,004,479 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to display a bitmap when starting an application? Pin
jhwurmbach18-Nov-03 2:05
jhwurmbach18-Nov-03 2:05 
GeneralRe: How to display a bitmap when starting an application? Pin
jean-michel vanye18-Nov-03 3:17
jean-michel vanye18-Nov-03 3:17 
Questionhow to add *.hpp defined by myself to the*.cpp? Pin
Anonymous17-Nov-03 22:30
Anonymous17-Nov-03 22:30 
AnswerRe: how to add *.hpp defined by myself to the*.cpp? Pin
Anonymous17-Nov-03 23:12
Anonymous17-Nov-03 23:12 
GeneralMapAndLoad() Pin
hph17-Nov-03 22:27
hph17-Nov-03 22:27 
GeneralKill a process!! Pin
chadell17-Nov-03 22:18
chadell17-Nov-03 22:18 
GeneralRe: Kill a process!! Pin
Brian Shifrin17-Nov-03 22:48
Brian Shifrin17-Nov-03 22:48 
GeneralRe: Kill a process!! Pin
Michael Gunlock18-Nov-03 9:59
Michael Gunlock18-Nov-03 9:59 
Try to avoid TerminateProcess() if possible. See MSDN description of TerminateProcess for the reasoning. Solutions depend on whether the child process has a top level window or are running in a console. I'll assume the child process you describe will be running in a console.

One way is to...
1. Spawn child process with ShellExecuteEx() or CreateaProcess()
2. WaitForSingleObject(Handle_To_ChildProcessID,YourTimeOutValue)...consider putting this in worker thread
3. If times out, then kill child process
***NOTE: I have read about others getting CreateRemoteThread to work as described below but I personally have not confirmed this. CreateRemoteThread is available in NT/2K/XP. Dead | X| ***
- CreateRemoteThread() using the ProcessID handle you got from CreateProcess and passing the address of ExitProcess() as the lpStartupAddress. ExitProcess() appears to be mapped to the same address in each processes address space. You can obtain this address by using the address from your process.
- When the remote thread starts (and calls ExitProcess) within the child process, the child process can now "cleanly" terminate.

If the child process has a top level window, then just PostMessage(HandleToChildsWnd, WM_CLOSE, 0,0), then confirm the process terminated.

Regards
Mike
Generalado nextrecordset failed Pin
zhangxinghai17-Nov-03 21:47
zhangxinghai17-Nov-03 21:47 
GeneralHelp drawing vertical text Pin
Juan Carlos Cobas17-Nov-03 21:33
Juan Carlos Cobas17-Nov-03 21:33 
GeneralMSMQ Pin
arthivjii17-Nov-03 20:12
arthivjii17-Nov-03 20:12 
GeneralRe: MSMQ Pin
Dudi Avramov18-Nov-03 2:57
Dudi Avramov18-Nov-03 2:57 
Generalstrange warning Pin
Jerome Conus17-Nov-03 19:35
Jerome Conus17-Nov-03 19:35 
GeneralRe: strange warning Pin
Michael Dunn17-Nov-03 19:59
sitebuilderMichael Dunn17-Nov-03 19:59 
GeneralRe: strange warning Pin
Jerome Conus17-Nov-03 20:07
Jerome Conus17-Nov-03 20:07 
GeneralRe: strange warning Pin
Prakash Nadar17-Nov-03 23:52
Prakash Nadar17-Nov-03 23:52 
GeneralColumn based selection; Pin
Bo Hunter17-Nov-03 19:29
Bo Hunter17-Nov-03 19:29 
QuestionMaximum length of string?? Pin
xxhimanshu17-Nov-03 19:28
xxhimanshu17-Nov-03 19:28 
AnswerRe: Maximum length of string?? Pin
Michael Dunn17-Nov-03 20:01
sitebuilderMichael Dunn17-Nov-03 20:01 
GeneralRe: Maximum length of string?? Pin
xxhimanshu17-Nov-03 20:05
xxhimanshu17-Nov-03 20:05 
GeneralDeveloping for Pocket PC Pin
georgiek5017-Nov-03 18:58
georgiek5017-Nov-03 18:58 
GeneralRe: Developing for Pocket PC Pin
Michael P Butler17-Nov-03 22:42
Michael P Butler17-Nov-03 22:42 
GeneralRe: Developing for Pocket PC Pin
georgiek5017-Nov-03 22:48
georgiek5017-Nov-03 22:48 
QuestionCMap Efficiency??? Pin
Uma Mahes17-Nov-03 18:04
Uma Mahes17-Nov-03 18:04 
AnswerRe: CMap Efficiency??? Pin
Brian Shifrin18-Nov-03 0:03
Brian Shifrin18-Nov-03 0: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.