'Called as the GUI is about to perform any interaction with the user'

def GUIAboutToInteract(self):

    frame = win32ui.GetMainFrame()
    self.bFrameEnabled = frame.IsWindowEnabled()
    self.oldForeground = None
    fw = win32ui.GetForegroundWindow()
    if (fw is not frame):
        self.oldForeground = fw
        self.oldFrameEnableState = frame.IsWindowEnabled()
        frame.EnableWindow(1)
    if (self.inForcedGUI and (not frame.IsWindowVisible())):
        frame.ShowWindow(win32con.SW_SHOW)
        frame.UpdateWindow()
    if self.curframe:
        SetInteractiveContext(self.curframe.f_globals, self.curframe.f_locals)
    else:
        SetInteractiveContext(None, None)
    self.GUIRespondDebuggerData()
