I came across this very unfortunate effect:
When a program with a GRAPHIC WINDOW does not need the focus for input by keyboard or mouse - and the GW gets closed -
a second GW will stay iconized and will be waiting for the user to click it back onto the screen.
In this state the taskbar icon starts blinking or becomes orange.
The program behaves extremely stubborn then. It does not react to any command to change the focus or appearance.
PB support has been helpful in explaining but does not have any solution.
I find it very irritating that MS requests the user to interact physically before a program can continue.
Normally, there seems to be an API call for everything and anything else!
Can someone point us to a description of this iconized blinking state?
Is there possibly a programmatic way out of this state?
Rgds,
Gert Voland.
Here is some sample code. REM out the first GRAPHIC WAITKEY$ and you are stuck!
When a program with a GRAPHIC WINDOW does not need the focus for input by keyboard or mouse - and the GW gets closed -
a second GW will stay iconized and will be waiting for the user to click it back onto the screen.
In this state the taskbar icon starts blinking or becomes orange.
The program behaves extremely stubborn then. It does not react to any command to change the focus or appearance.
PB support has been helpful in explaining but does not have any solution.
I find it very irritating that MS requests the user to interact physically before a program can continue.
Normally, there seems to be an API call for everything and anything else!
Can someone point us to a description of this iconized blinking state?
Is there possibly a programmatic way out of this state?
Rgds,
Gert Voland.
Here is some sample code. REM out the first GRAPHIC WAITKEY$ and you are stuck!
Code:
'Focus problem for second GW 'Compilers: PB/CC 5.01and PB/Win 9.01 'OS: Win XP SP2 #COMPILE EXE #DIM ALL #IF %DEF(%PB_CC32) #BREAK ON #CONSOLE OFF #ENDIF #INCLUDE "Win32Api.Inc" '---------------------------------------------------------------------------------------------- FUNCTION PBMAIN LOCAL hGW1, hGW2 AS DWORD GRAPHIC WINDOW "Test_focus: Green", 300, 300, 300, 100 TO hGW1 GRAPHIC ATTACH hGW1, 0 GRAPHIC CLEAR %GREEN GRAPHIC PRINT " Press any key ..." GRAPHIC WAITKEY$ '<-- Take this line out and hGW2 does not get the focus any more GRAPHIC WINDOW END GRAPHIC WINDOW "Test_focus: Red", 400, 400, 300, 100 TO hGW2 GRAPHIC ATTACH hGW2, 0 GRAPHIC CLEAR %RED GRAPHIC SET FOCUS '<-- Neither this works, 'nor OpenIcon(), ShowWindow(), SetActiveWindow(), SetForegroundWindow(), SetWindowPos() ,....? GRAPHIC PRINT " Press any key ..." GRAPHIC WAITKEY$ GRAPHIC WINDOW END END FUNCTION '----------------------------------------------------------------------------
Comment