Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: How to prevent game from switching to windows desktop???

  1. #1

    How to prevent game from switching to windows desktop???

    Hi, I have made a game wich runs in full screen and uses the mouse, however when the user points the mouse to the bottom of the screen (where the taskbar usually is) and presses mouse button the game is minimized.I have flip enabled and align all client in DXDraw, but still no efect.How can I prevent the game from switching to desktop?I have seen it done in several UndelphiX Demos, but all thoe I looked at the code I can't figure out how they didi it.

  2. #2

    How to prevent game from switching to windows desktop???

    It's a setting in the dxdraw component. Check the properties for the fullscreen option.

    I´m curious though, you say you have fullscreen, how exactly did you realize that?

  3. #3

    How to prevent game from switching to windows desktop???

    Trav is right. Go into a sprite demo and look at the code under the fullscreen option on the menu bar.

  4. #4

    How to prevent game from switching to windows desktop???

    I forgot to mention I allready have doFullscreen set to true, that is how I know it is full screen.The problem occurs when the user clicks
    with the mouse where the windows task bar is (its invisible actualy because DXDraw draws over it) wich results in minimizeing the game and switching the focus to the desktop.So my question actualy is how can I prevent the game from minimizing and looseing the focus?

    P.P.
    Sorry if my question was unclear or for any spelling and grammar mistakes,but English is not my native language.

  5. #5

    How to prevent game from switching to windows desktop???

    However you are going to fix it, never do it by preventing user to alt+tab out of the game, if anything pisses me off more is this.
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  6. #6

    How to prevent game from switching to windows desktop???

    That's odd, I've never had that problem before.

    I think the best option is to search for the difference between your game and the demo's.
    You could also try and upload you game somewhere so we can have a look at it. Maybe it's related to your machine.

  7. #7

    How to prevent game from switching to windows desktop???

    Thanks for trying to help guys, I think I found what is causing this.I am using
    Mouse.CursorPos... which seems to be a global variable (i dont use DXInput, it stops working sometimes ),now I have to figure out how to fix it .I could upload my game somewhere ,but its rather big (>30mb) and the source code is more than 4000 lines ,so I dont want to boder you wich such things

  8. #8

    How to prevent game from switching to windows desktop???

    Quote Originally Posted by Delfi
    However you are going to fix it, never do it by preventing user to alt+tab out of the game, if anything pisses me off more is this.
    I agree

  9. #9

    How to prevent game from switching to windows desktop???

    Quote Originally Posted by p(3.14)
    Thanks for trying to help guys, I think I found what is causing this.I am using
    Mouse.CursorPos... which seems to be a global variable (i dont use DXInput, it stops working sometimes ),now I have to figure out how to fix it .I could upload my game somewhere ,but its rather big (>30mb) and the source code is more than 4000 lines ,so I dont want to boder you wich such things
    In what situations have you found DXInput to stop working?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  10. #10

    How to prevent game from switching to windows desktop???

    Well, I compile the game and it runs ok, the next day I run delphi,load my game project, but when i try to run it i get a message FDInput ... cant pass parameter or something (sry cant quote,but when it happens again I'll tell you what the exact error is) and it switchs to DXInput.pas showing some line where the error is.However, when i overwrite the dxinput files it works fine for some time and then it happens again.Btw, I solved my problem,had to set DXDraw align property to align custom ,because if it is set to align all it excludes the taskbar from the client area for some reason.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •