When a graphics window gains focus directly from the user via mouse click or alt-tab switching, is there a simple way to automatically shift the focus over to the console window?
Thanks,
Mark
Thanks,
Mark
#COMPILE EXE '#CC 4.04# #DIM ALL #INCLUDE "Win32Api.inc" '#2005-01-27# FUNCTION PBMAIN () AS LONG LOCAL DesktopRc AS RECT LOCAL hWin AS DWORD LOCAL sKey AS STRING SystemParametersInfo %SPI_GETWORKAREA, 0, BYVAL VARPTR(DesktopRc), 0 GRAPHIC WINDOW "Window", DesktopRc.nLeft, DesktopRc.nTop, DesktopRc.nRight, DesktopRc.nBottom TO hWin GRAPHIC ATTACH hWin, 0 STDOUT "Focus always set to console and not to graphic window." STDOUT "Console can be minimized." STDOUT "Type Escape to end" DO IF GetForeGroundWindow = hWin THEN CONSOLE SET FOCUS IF IsIconic(CONSHNDL) THEN ShowWindow hWin, %SW_HIDE ELSE ShowWindow hWin, %SW_SHOW END IF sKey = INKEY$ IF LEN(sKey) THEN STDOUT sKey; SLEEP 50 LOOP UNTIL sKey = $ESC END FUNCTION
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment