Hey.
I've been wondering:
When the CHAIN command is used to launch another program, and then the program closes, when a fullscreen mode is used at least for the original program, the program won't do anything until the user switches it back to active again, such as by clicking it in the taskbar.
Is there a simple way to resume program execution after a called program quits, with no user interaction?
Thank you.
(Windows) Launch/Close Programs With Fullscreen
Re: (Windows) Launch/Close Programs With Fullscreen
Workaround on Windows:
fxm wrote: ↑Aug 20, 2014 21:06 The only and best solution I've found to force a window to the foreground with the focus, whatever the starting configuration, is to run the 5 following commands in this order:
- Hide (not absolutely necessary, just to reduce a little the window flashing)
- Minimize
- Restore
- Foreground
- Focus
Test program:Code: Select all
#INCLUDE "windows.bi" #INCLUDE "fbgfx.bi" DIM HandleWindow AS HWND SCREEN 12 PRINT PRINT " You have 5 seconds:" PRINT " - to put the graphic window in the background," PRINT " - or to minimize the graphic window." SLEEP 5000 SCREENCONTROL(FB.GET_WINDOW_HANDLE, CAST(INTEGER, HandleWindow)) ShowWindow(HandleWindow, SW_HIDE) 'Hide ShowWindow(HandleWindow, SW_MINIMIZE) 'Minimize ShowWindow(HandleWindow, SW_RESTORE) 'Restore SetForegroundWindow(HandleWindow) 'Foreground SetFocus(HandleWindow) 'Focus PRINT PRINT " The window is back in the foreground with the focus." SLEEP
Re: (Windows) Launch/Close Programs With Fullscreen
Thank you!fxm wrote: ↑Jul 15, 2022 4:49 Workaround on Windows:fxm wrote: ↑Aug 20, 2014 21:06 The only and best solution I've found to force a window to the foreground with the focus, whatever the starting configuration, is to run the 5 following commands in this order:
- Hide (not absolutely necessary, just to reduce a little the window flashing)
- Minimize
- Restore
- Foreground
- Focus
Test program:Code: Select all
#INCLUDE "windows.bi" #INCLUDE "fbgfx.bi" DIM HandleWindow AS HWND SCREEN 12 PRINT PRINT " You have 5 seconds:" PRINT " - to put the graphic window in the background," PRINT " - or to minimize the graphic window." SLEEP 5000 SCREENCONTROL(FB.GET_WINDOW_HANDLE, CAST(INTEGER, HandleWindow)) ShowWindow(HandleWindow, SW_HIDE) 'Hide ShowWindow(HandleWindow, SW_MINIMIZE) 'Minimize ShowWindow(HandleWindow, SW_RESTORE) 'Restore SetForegroundWindow(HandleWindow) 'Foreground SetFocus(HandleWindow) 'Focus PRINT PRINT " The window is back in the foreground with the focus." SLEEP
I will try that (at some point I'll get around to it).