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