SetCooperativeLevel()-Not setting fullscreen [Archive] - C Board

PDA

View Full Version : SetCooperativeLevel()-Not setting fullscreen


JaWiB
09-30-2003, 10:42 PM
Im trying to make a simple fullscreen application for DirectDraw, but even with the DDSCL_FULLSCREEN flag set when I call SetCooperativeLevel, it only makes window that covers the whole screen (still with the title bar)...

if(FAILED(lpdd->SetCooperativeLevel(main_window_handle, DDSCL_FULLSCREEN|DDSCL_EXCLUSIVE|DDSCL_ALLOWMODEX| DDSCL_ALLOWREBOOT)))
{

MessageBox(NULL,"SetCooperativeLevel() failed!","Error!",MB_OK|MB_ICONEXCLAMATION);
}

Shouldn't that make it a full black screen?? Also, if I only have DDSCL_FULLSCREEN for the last argument, the function fails...For a good measure heres my complete source if someone feels like really helping me :)
Oh, and I'm using Dev Cpp since MSVC++ 6 didn't want to compile it! >:(

MrWizard
10-01-2003, 04:24 AM
The problem is with your CreateWindowEx function. You have the wrong style specified. The WS_VISIBLE flag is correct but change the WS_OVERLAPPED to WS_POPUP and it should work fine. Also you might want to try using the WS_EX_TOPMOST flag for the extended styles.

JaWiB
10-01-2003, 09:45 AM
Ah thanks! Actually I had to set it to WS_VISIBLE | WS_POPUP to get it to work...heres a screenshot:

MrWizard
10-02-2003, 12:29 AM
Yea if you re-read my post i say that your VISIBLE style is correct but change your overlapped to popup. Implying that you should leave your visible one in. Just thought I'd point that out. If you need any DirectX7 help let me know I have a lot of experience with it.

JaWiB
10-02-2003, 08:52 AM
Lol I misread your post...thought you said overlapped was correct but visible was not!