Page 1 of 1

Alt+Tab switching

Posted: Fri Feb 27, 2004 8:59 pm
by merendo
Hi @ll

I am coding a little strategy game (not important).
Now i'm trying to get the Alt+Tab switching to work. I have a little condition at the end of my code which puts the whole programme into a wait-loop if the screen is minimized. But it doesn't work properly (yes, i wrote the code AFTER the FlipBuffers() command).

Code: Select all

  Repeat
    Delay(5)
    IsScreenActive=IsScreenActive()
    If IsScreenActive=0
      ReleaseMouse(1)
    EndIf
  Until IsScreenActive=1
The programme crashes (Crtl+Alt+Del says the programme does not respond anymore) and when i click the programmes icon in the taskbar nothing happens. Any idea why?

Posted: Fri Feb 27, 2004 10:04 pm
by filperj
Try to add a "flipbuffers" before the "isscreenactive", to receve the event :wink:

Posted: Fri Feb 27, 2004 10:43 pm
by merendo
That's what i did. And i even wrote that i did :lol: :lol: :lol: :lol: :lol:

Posted: Fri Feb 27, 2004 10:47 pm
by filperj
No, I mean in the wait-loop:

Code: Select all

Repeat
    Delay(5)
    FlipBuffers()
    IsScreenActive=IsScreenActive()
    If IsScreenActive=0
      ReleaseMouse(1)
    EndIf
  Until IsScreenActive=1

Posted: Fri Feb 27, 2004 11:28 pm
by merendo
hmm... interesting :)

Posted: Sat Feb 28, 2004 12:16 am
by merendo
Okay. Now the Alt+Tab switching works. No. It doesn't work but at least it does no longer cause a crash. Instead, all sprite masking informations (TransparentSpriteColor()) become lost. Why? What am i doing wrong now?

Code: Select all

   Repeat
    FlipBuffers()
    IsScreenActive=IsScreenActive()
    If IsScreenActive=0
      ReleaseMouse(1)
      Delay(5)
    Else
      ReleaseMouse(0)
    EndIf
  Until IsScreenActive=1

Posted: Sat Feb 28, 2004 8:41 am
by Shopro
I've had the same problem. the only way I got around it is by reloading all images and stuff after every ALT+TAB.

:(

-Shopro

Posted: Sat Feb 28, 2004 9:08 am
by merendo
Well, for me it works by only assigning the MaskColours to all sprites after Alt+Tab back again.

However, thank you very much for your help!