Advertisement

Creating a Full screen window?

Started by June 14, 2002 02:35 PM
9 comments, last by Ronin Magus 22 years, 5 months ago
Hi guys, I''ve got a question here... how do you create a full-screen window, with the client area of the window the size of the screen, from top to bottom? I used this code:
  
	WNDCLASS wc;
	int windowWidth = GetSystemMetrics(SM_CXSCREEN);
	int windowHeight = GetSystemMetrics(SM_CYSCREEN);

        ...

	wc.cbClsExtra = NULL;
	wc.cbWndExtra = NULL;
	wc.hbrBackground = HBRUSH(COLOR_WINDOW + 1);
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	wc.hInstance = hInstance;
	wc.lpfnWndProc = WndProc;
	wc.lpszClassName = CLASS_NAME;
	wc.lpszMenuName = NULL;
	wc.style = CS_OWNDC | CS_VREDRAW | CS_HREDRAW;

	RegisterClass(&wc);

	hwndMain = CreateWindowEx(WS_EX_TOPMOST, CLASS_NAME, NULL, WS_VISIBLE, 0, 0, windowWidth, windowHeight, NULL, NULL, hInstance, NULL);

	ShowWindow(hwndMain, SW_SHOWNORMAL);
	UpdateWindow(hwndMain);
  
But it still creates a window that has an empty title bar at the top. The window is the size of the screen as it should be, but I don''t want a title bar. How do you do this?
Try adding WS_POPUP to the style parameter of the CreateWindowEx call. And if you want to put an icon in the tray for alt-tabbing purposes, add WS_SYSMENU as well.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Advertisement
Thank you, WS_POPUP got rid of the title bar.
WS_SYSMENU doesnt work!?

_________________________________________________________________________
Can someone be nice and help me on my way to be the next Hideo Kojima? Thought So...
quote: Original post by Pipo DeClown
WS_SYSMENU doesnt work!?


How so? Bear in mind, the icon in the tray won''t manifest unless you alt tab out of the fullscreen app.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
I think you mean the taskbar, not the system tray.
Advertisement
How can you put it in SystemTray trhen?

_________________________________________________________________________
Can someone be nice and help me on my way to be the next Hideo Kojima? Thought So...
Shell_NotifyIcon, if you mean SysTray.
---visit #directxdev on afternet <- not just for directx, despite the name
Yes I meant the task bar - however in some of the docs the task bar is refered to as the tray - the older docs moreso. Here''s the snippet that I referenced when initially answering the question:
        WS_VISIBLE | // so we don''t have to call ShowWindow        WS_POPUP |   // non-app window        WS_SYSMENU,  // so we get an icon in the tray 


This is from the ''donuts'' demo that shipped with an older version of the DirectX SDK. I had been playing around with it the day before so it was handy.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Well HOW do you use Shell_NotifyIcon?

_________________________________________________________________________
Can someone be nice and help me on my way to be the next Hideo Kojima? Thought So...

This topic is closed to new replies.

Advertisement