Windows: Attach to process and read debug output
How c开发者_如何学运维an I attach to another process using WinAPI? I want to read its OutputDebugStrings and be able to pause its execution.
You need to write a debugger with the WaitForDebugEvent() api function. DEBUG_EVENT.DebugString supplies the text generated with OutputDebugString(). This SDK article is a good starting point for getting this going.
精彩评论