Mariano Alvarez Fernandez schrieb:
Waldemar Schultz escribió:
The following program exhibits problems with the window's 'focus' in windows console applications.
Well, it works as expected,
I disagree here. It is just to inform you, I observe the following: After launching grxhello.exe from a W98 DOS box the DOS Box looses focus (title bar becomes gray), the mouse arrow jumps to the top left corner of the screen, (looks like focus went to an invisible window) the first message appears in the DOS box and getch() waits for a key.
When I now hit a key _without_ moving the mouse before, the GRX window is opened with the focus on it and GrKeyRead() waits for a key (as expected).
Hitting a key _without_ moving the mouse, the second message is displayedin the DOS box and again the mouse arrow jumps to the left upper corner of the screen and the second getch() waits for a key.
Hitting a key(DOS box title is still gray) the program terminates as expected, giving focus back to the DOS box.
Whenever I move the mouse when getch() is waiting or try to put focus on the DOSbox(==console) the program hangs.
when the program exits the last app gets the focus.
I agree here.
Win programs using both console an windows io have problems not related to GRX really.
So do you think I should blame it on M$W98 or the MINGW32 implementation. Maybe anyone could try this under LINUX to see if it behaves different. I would really appreciate to have the console simultaneously wit the graphics window switching focus by the application as required.
Thank you for attention.