Alt+Tab switching

Advanced game related topics
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Alt+Tab switching

Post 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?
The truth is never confined to a single number - especially scientific truth!
filperj
User
User
Posts: 77
Joined: Tue Sep 16, 2003 8:53 pm
Location: Nevers(France)

Post by filperj »

Try to add a "flipbuffers" before the "isscreenactive", to receve the event :wink:
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

That's what i did. And i even wrote that i did :lol: :lol: :lol: :lol: :lol:
The truth is never confined to a single number - especially scientific truth!
filperj
User
User
Posts: 77
Joined: Tue Sep 16, 2003 8:53 pm
Location: Nevers(France)

Post 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
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

hmm... interesting :)
The truth is never confined to a single number - especially scientific truth!
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post 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
The truth is never confined to a single number - especially scientific truth!
Shopro
Enthusiast
Enthusiast
Posts: 148
Joined: Tue May 13, 2003 8:05 am

Post 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
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post 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!
The truth is never confined to a single number - especially scientific truth!
Post Reply