Jump to content
  • Advertisement
Sign in to follow this  

Borderless Windowed Mode configuration

This topic is 1345 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'm trying to mod a rather old game to enable it to run in windowed mode, specifically borderless window mode. Can you guys help me with the step of configuring direct x and the windows api window settings? I would be truly grateful. 


Regard Letters.

Share this post

Link to post
Share on other sites

I can only speak for d3d9 (for now);


- make sure you set the windowed flag in the d3d parameters to true

- after creating the window, use ShowWindow and UpdateWindow (to present the window)

- in the windowclass make sure the used style (for creating the window, i.e. CreateWindowEx) has the flag "WS_POP"

	mWc.style			= CS_HREDRAW | CS_VREDRAW;
	mWc.lpfnWndProc		= (WNDPROC)pWindowProc;
	mWc.cbClsExtra		= 0;
	mWc.cbWndExtra		= 0;
	mWc.hInstance		= pHinstance;
	mWc.hIcon			= LoadIcon(0, IDI_APPLICATION);
	mWc.hCursor			= LoadCursor(0, IDC_ARROW);
	mWc.lpszMenuName	= 0;
	mWc.lpszClassName	= L"WindowClass";
	mWc.cbSize			= sizeof(WNDCLASSEX);
	style = WS_POPUP;									// borderless window (no difference fullscreen/windowed, no borders / rect issues

	if(0 == (RegisterClassEx(&mWc))) return false;

	if(NULL == (mHwnd = CreateWindowEx(NULL,L"WindowClass", L"Crealysm", style,
							 		 0, 0, mSettings.GetScreenWidth(), mSettings.GetScreenHeight(),
									 NULL, NULL, pHinstance, NULL))) return false;
		ShowWindow(mHwnd, pNcmdShow);

// another snippet

		mD3dpp.BackBufferFormat = mAdapterFormat;
		mD3dpp.Windowed = false;
		mD3dpp.BackBufferWidth = mSettings.GetScreenWidth();
		mD3dpp.BackBufferHeight = mSettings.GetScreenHeight();
		mD3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
	else mD3dpp.Windowed = true;

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!