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

Started by
2 comments, last by KoldGames 10 years, 1 month ago

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

Advertisement

Never Mind! I fixed the bordeless window problem. How would I enable the Windows Key and Function Keys in DirectInput?

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

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

This topic is closed to new replies.

Advertisement