From b1f53bedf3a35326cc2510a7db62d1a91313eafc Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Sun, 15 Aug 2021 00:49:06 -0300 Subject: [PATCH] Allows QB64 to be used to debug itself again. --- internal/support/vwatch/vwatch.bm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/support/vwatch/vwatch.bm b/internal/support/vwatch/vwatch.bm index 79d227a74..17060ec81 100644 --- a/internal/support/vwatch/vwatch.bm +++ b/internal/support/vwatch/vwatch.bm @@ -16,10 +16,15 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET) SUB vwatch_starttimers ALIAS start_timers SUB unlockvWatchHandle SUB set_qbs_size (target AS _OFFSET, BYVAL length&) - SUB set_foreground_window (BYVAL hwnd AS _OFFSET) FUNCTION stop_program_state& END DECLARE + $IF WIN THEN + DECLARE DYNAMIC LIBRARY "user32" + FUNCTION SetForegroundWindow& (BYVAL hWnd AS _OFFSET) + END DECLARE + $END IF + IF vw_bypass THEN EXIT SUB vwatch_goto = 0 @@ -190,7 +195,9 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET) vw_cmd$ = "current sub:" + LEFT$(vwatch_stack(vwatch_sublevel), INSTR(vwatch_stack(vwatch_sublevel), ",") - 1) GOSUB SendCommand - set_foreground_window vw_idehwnd + $IF WIN THEN + vw_i = SetForegroundWindow&(vw_idehwnd) + $END IF DO 'main loop IF stop_program_state& THEN vw_bypass = -1: EXIT DO