Archived

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

DirectDraw and minimizing windows...

This topic is 5826 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

Hi, My problem is when I do directdraw in Fullscreen Mode, and I minimize it, the ->Flip method always fails over and over again... each time it loops over. Is there anyway to fix this? Disable Crtl+Alt+Del and Alt+Tab? - How? Or know when the window gets minimized, and what would you do to make sure the error doesn''t happen? Any help? Thanks, Eric //---------------------------- In a world without boundaries - who needs gates or windows ? ----------------------------\\

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Set a flag somewhere when your game loses focus, and stop the game loop. When you get focus again (or go fullscreen or whatever), restore your stuff and start going again.

Share this post


Link to post
Share on other sites
Well, all surface get lost when your fullscreen app loses the focus. If you're using DX8, have a look at the chapter dealing with lost devices (especially the IDirect3DDevice8::Reset method). If you're using an older version, look at the chapter loosing surfaces (and you have to call the Restore method of you're surface objects).
Anyway you have to restore the contents of your surfaces (textures).
You should be able to find an example in the DX-SDK.

Edited by - VolkerG on January 1, 2002 5:47:55 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i am taiwanese, so my english no good, i use DirectX 7.0

like this:

BOOL MyScreen:resent(VOID)
{
if(m_pDD == NULL) return E_FAIL;
if(m_pBackBuffer == NULL) return E_FAIL;
if(m_pPrimaryBuffer == NULL) return E_FAIL;

if(IsIconic(m_hWnd)) return TRUE; /* minimize icon, don''t flip */

m_pPrimaryBuffer->Flip(NULL, DDFLIP_WAIT);

return TRUE;
}


Disable Ctrl + Alt + Del:
m_pDD->SetCooperativeLevel(hWnd, DDSCL_EXCLUSIVE |
DDSCL_FULLSCREEN |
DDSCL_ALLOWMODEX |
DDSCL_ALLOWREBOOT);
Remove DDSCL_ALLOWREBOOT Flag.

Disable Alt+Tab
i don''t know, how do to this.


made in taiwan, perfact.

Share this post


Link to post
Share on other sites
Hi,

Well at least I know how to disable CRTL+ALT+DEL - but first off let me remind you that I''m using DirectDraw - NOT Direct3D! Second off - I''m wondering how I can tell when the window is being minimized and when it''s not... not that I should have a flag/bool when its minimized or not - that''s a given.

Any other help?

Eric

//----------------------------
In a world without boundaries -
who needs gates or windows ?
----------------------------\\

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i am taiwanese, so my english no good, i use DirectX 7.0

you can hook WM_ACTIVATE message,like this:

case WM_ACTIVATE:
if(LOWORD(wParam) == WA_INACTIVE || (BOOL)HIWORD(wParam))
{
Pause(TRUE);
}
else /*if(LOWORD(wParam) == WA_ACTIVE) ||
LOWORD(wParam) == WA_CLICKACTIVE))*/
{
Pause(FALSE);
}
break;

well, now you know your program is activate or not.

made in taiwan, perfact.

Share this post


Link to post
Share on other sites
Hey I wasn't trying to be rude. I appreciate all help, it sometimes just bugs me when people reply to posts they haven't read properly or completely... any help, even if it's wrong is still appreciated. I appreciate all help from anyone taking their time to answer a question.

Thanks!

Eric

//----------------------------
In a world without boundaries -
who needs gates or windows ?
----------------------------\
BTW: I know the Windows API pretty darn well, but I didn't know that WM_SIZE counts when minimizing. I thought it was only when the user drags the window to make it bigger or smaller, and I didn't think it would apply to my problem anyway since my program is running in fullscreen...

I'll give both the WM_ACTIVATE, and WM_MOVE messages a try...

Thanks again!

Edited by - Destroyer on January 2, 2002 10:01:34 AM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i am taiwanese, so my english very poor, i use DirectX 7.0

don''t angry.
my english very poor, so some words and expressions i don''t understand.
if you written simple words or expressions or some source code,
maybe easy help you.

Share this post


Link to post
Share on other sites