DX Fullscreen Exclusive Mode???
Hello all:
I'm trying to use DDRAW 7 with a builder app simply simply to utilize the
"Easy to use" screen format controls and eliminate any sidebar menus at the
bottom of the screen and sides. To do this I'm simply calling DDRAW and
setting the screen to full screen exclusive and it works ... that is for the
form that I call it on (Which is tha app's main form) but when bringing up
another form it does not maintain its exclusive mode ??? I realize that I
cannot set the Exclusive mode again for another form because DX will return
an ERROR of ERR_HWNDALREADYSET which in English from what I can tell
basically means that I cannot set Exclusive mode again on a different
window? Below is a sample of where I'm starting DDRAW and where I'm setting
the screen format. Does anybody see a problem with this code? Thanks in
advance for your help!
//STARTING DX HERE
void __fastcall TMainmenu::FormCreate(TObject *Sender)
{
HRESULT hr;
dxs = new dx();
hr = dxs->init();
if (hr != DD_OK)
ShowMessage(dxs->get_last_dx_err(hr));
//SETTING SCREEN UP HERE
void __fastcall TMainmenu::FormActivate(TObject *Sender)
{
HRESULT hr;
//CODE IS BELOW
hr = dxs->dd_set_full(Mainmenu->Handle);
if (hr != DD_OK)
ShowMessage(dxs->get_last_dx_err(hr));
hr = dxs->get_screen(Mainmenu->Handle, &xx, &yy, &bpp);
if (hr != DD_OK)
ShowMessage(dxs->get_last_dx_err(hr));
if (xx != 1024 || yy != 768 || bpp != 32)
{
hr = dxs->set_screen(Mainmenu->Handle, 1024, 768, 32);
if (hr != DD_OK)
ShowMessage(dxs->get_last_dx_err(hr));
}
//SET COOPERATIVE AS EXCLUSIVE AND FULL SCREEN
HRESULT dx::dd_set_full(HWND hwnd)
{
lasthr = dds->SetCooperativeLevel(hwnd, DDSCL_FULLSCREEN |
DDSCL_EXCLUSIVE);
return lasthr;
}
Sorry for the long message and hope this makes sense but I wanted to give
enough info for anybody to help!
Thank you
Marshall