Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Mikecrosoft

Please help me with my program (Minimize DirectX program)

This topic is 5890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need make that my program supports ALT+TAB keys but I can''t do it: This is my situation The first problem is, when I minimize or press ALT+TAB the program resturns DDERR_SURFACELOST error, Ok, this is solved with Restore function, but when I use this one the program returns DDERR_WRONGMODE error because the function restores the surface only if the video mode is the same of the surface, How I can return to a the video mode of the surfaces, I think that this is with Setdisplaymode function, I''m usin this but when I return to program this not show nothing, this is my code for all this: This loop is executed when the active window is not the program (this code is into the main loop)
...
            HWND_ACTIVA = GetActiveWindow
            
            If HWND_ACTIVA <> DX_CAT.hWnd Then
                Do
                    DoEvents
                    HWND_ACTIVA = GetActiveWindow
                    
                Loop While HWND_ACTIVA <> DX_CAT.hWnd
                
                DD.SetCooperativeLevel DX_CAT.hWnd, DDSCL_EXCLUSIVE Or DDSCL_FULLSCREEN
                DD.SetDisplayMode 800, 600, 16, 0, DDSDM_DEFAULT
                
                
            End If

''This part of the code restore the surfaces
''Note: When the program is minimized the DDERR_SURFACELOST on each surface functions is ignored.
...

 
When I return to my program the previous code sets the video mode, then all surfaces can be restored (I think),but this not happend !!!! Ing. Mike

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!