Advertisement Jump to content
Sign in to follow this  
KoldGames

Fullscreen Borderless Window - Allow Windows 8 Charms to Show On Top

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

Hello!  I am trying to setup a full screen borderless window that will allow me to see Windows 8 music/search charms.  Similar to this:

swjv.png

mik2.png

 

How would I allow the search and music controls to show up over the game? Also,  how I would I go about enabling the Windows Key and FN Shortcuts in DirectInput? Here is my window code:

WNDCLASSEX wc;
			DEVMODE dmScreenSettings;
			int posX, posY;
			ApplicationHandle = this;
			hInstance = GetModuleHandle(NULL);
			wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
			wc.lpfnWndProc = WndProc;
			wc.cbClsExtra = 0;
			wc.cbWndExtra = 0;
			wc.hInstance = hInstance;
			wc.hIcon = LoadIcon(NULL, ApplicationIcon);
			wc.hIconSm = wc.hIcon;
			wc.hCursor = LoadCursor(NULL, IDC_ARROW);
			wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
			wc.lpszMenuName = NULL;
			wc.lpszClassName = Title;
			wc.cbSize = sizeof(WNDCLASSEX);

			RegisterClassEx(&wc);

			width = GetSystemMetrics(SM_CXSCREEN);
			height = GetSystemMetrics(SM_CYSCREEN);

			if (FullScreen)
			{
				posX = posY = 0;

				if (!Borderless)
				{
					memset(&dmScreenSettings, 0, sizeof(dmScreenSettings));
					dmScreenSettings.dmSize = sizeof(dmScreenSettings);
					dmScreenSettings.dmPelsWidth = (unsigned long) width;
					dmScreenSettings.dmPelsHeight = (unsigned long) height;
					dmScreenSettings.dmBitsPerPel = 32;
					dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;

					ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);
				}
			}
			else
			{
				width = DefaultWindowedWidth;
				height = DefaultWindowedHeight;
				posX = (GetSystemMetrics(SM_CXSCREEN) - width) / 2;
				posY = 3;
				/*posY = (GetSystemMetrics(SM_CYSCREEN) - screenHeight) / 2;*/
			}

			if (Borderless)
				Window = CreateWindowEx(WS_EX_APPWINDOW, Title, Title, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_POPUP, posX, posY, width, height, NULL, NULL, hInstance, NULL);
			else
				Window = CreateWindowEx(WS_EX_APPWINDOW, Title, Title, WS_CLIPSIBLINGS | WS_CLIPCHILDREN, posX, posY, width, height, NULL, NULL, hInstance, NULL);

			if (Window == NULL)
				return false;

			ShowWindow(Window, SW_SHOW);
			SetForegroundWindow(Window);
			SetFocus(Window);
			ShowCursor(IsCursorVisible); 

Thanks! smile.png

Edited by KoldGames

Share this post


Link to post
Share on other sites
Advertisement

A wild guess would be to handle <WIN>+W and pass it to DefWindowProc?

 

I don't know if you can still slide from the right if you have a fullscreen window on a touch enabled screen & windows 8 - I don't have one to test with. I sort of doubt it, unless you handle the touch gestures yourself and pass that to the OS. I suspect that not many have touch screen monitors or laptops...

 

 

Edit to add - if you fixed the problem would you mind sharing so others have the benefit of your wisdom smile.png

Edited by mark ds

Share this post


Link to post
Share on other sites

Hey! I found what was preventing me from using the Windows or FN keys.  During the setup of DirectInput,  I was setting the keyboard's cooperative level to DISCL_EXCLUSIVE. So I changed I changed it to DISCL_NONEXCLUSIVE and was able to bring up the search bar by using WIN + S.  I fixed the borderless window problem by creating a window as usual, using WS_POPUP in CreateWindowEx, and setting fullscreen to false during the creation of my GPU Device/Context. Thanks! smile.png

 

2uvt.png

Edited by KoldGames

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!