Visual Studio: How to stop breakpoint hit from stealing focus?

前端 未结 5 1071
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-12 21:55

When a breakpoint is hit in Visual Studio, it steals the focus from whatever other application the programmer is

5条回答
  •  余生分开走
    2020-12-12 22:36

    One workaround is to use OutputDebugString() function to output current state into the debugger output window. You just place Visual Studio in background, position the debugged program window so that the "Output" window is visible - and no focus transition ever happens.

    You will perhaps want to use macros for conditional compilation so that tracing code is not included into the release builds.

提交回复
热议问题