IDebugProcess2::Detach
Detaches the debugger from this process by detaching all of the programs in the process.
HRESULT Detach(
void
);
int Detach();
Return Value
If successful, returns S_OK; otherwise, returns an error code.
Remarks
All programs and the process continue running, but are no longer part of the debug session. After the detach operation is complete, no more debug events for this process (and its programs) will be sent.