• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
shinypixel

How to hide the taskbar with Win32 API on resize?

12 posts in this topic

I have a windowed app on Windows 7. I double click the title bar to make the window max the entire screen. The taskbar remains visible on the bottom, but this is undesired. I did some research, and this is what I came up with. However, the task bar is still showing. Any thoughts would be helpful. Thanks.

 

Edit: To clarify, this is for a fullscreen-windowed game that covers the taskbar, and not actually trying to kill the user's taskbar.

                    ShowWindow(g_hWnd, SW_HIDE);

                    LONG lStyle = GetWindowLong(g_hWnd, GWL_STYLE);
                    lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_SYSMENU);  
                    SetWindowLong(g_hWnd, GWL_STYLE, lStyle);
                    
                    LONG lExStyle = GetWindowLong(g_hWnd, GWL_EXSTYLE);
                    lExStyle &= WS_EX_APPWINDOW | WS_EX_TOPMOST;
                    SetWindowLong(g_hWnd, GWL_EXSTYLE, lExStyle);
   
                    SetWindowPos(g_hWnd, HWND_TOPMOST, 0,0,0,0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
                    ShowWindow(g_hWnd, SW_SHOW);
Edited by shinypixel
0

Share this post


Link to post
Share on other sites

Thanks, but even removing the two flags still show the taskbar, and oddly enough the task bar is somewhat cut off near the top.

0

Share this post


Link to post
Share on other sites

Well, if you played Angry Birds on the Mac, a full screen game is actually a window. It covers the taskbar on the bottom. I'm trying the same for Windows.

 

I did auto-hide the taskbar, and the window dimensions were long enough.

 

So, I'm not trying to get rid of the taskbar, but trying to do a fullscreen-window feature that will cover the taskbar.

 

So far, the window is only partially above the top of the taskbar.

Edited by shinypixel
0

Share this post


Link to post
Share on other sites

trying to do a fullscreen-window feature that will cover the taskbar.

"Full-screen" is different than "maximized." In Windows, setting full-screen mode results in the Window client area covering the entire monitor screen (no taskbar), and the window has no title-bar, no frame and no menu bar. Is that what you're trying to do?

 

EDIT:

 


So far, the window is only partially above the top of the task bar.

That's the auto-hide feature of the taskbar reserving a few pixels at the bottom of the screen to detect the mouse being moved down to bring up the taskbar. That's good!

Edited by Buckeye
2

Share this post


Link to post
Share on other sites

Yes. The issue is OpenGL won't render as a single buffer in fullscreen mode due to Aero, I believe. It does work when it's in windowed mode. So If I double click the title bar (or send a message to call WM_SIZE), I can get single buffering working as if it's full screen for the project's needs. If I auto-hide the taskbar, the window's dimensions cover the entire monitor, and the single buffer works. So, now I'm trying to cover the entire taskbar with the window when it's not in auto-hide.

0

Share this post


Link to post
Share on other sites

Someone suggested just making and drawing to an FBO (frame buffer object) and send that buffer to the back buffer, which gives the same feel as a single buffer. I haven't studied that far into OpenGL, so perhaps this is a better solution down the road than black magic with window manipulation. I was just thinking short-term with a window reaching the monitor's dimensions, but I can always just auto-hide the taskbar as I study until that point. Thanks for the idea on auto-hiding the taskbar as I study.

 

Edit: This ended up covering the taskbar for a full-screen window effect with single buffering, despite Aero, though I don't recommend it for real projects:

        LONG lStyle = GetWindowLong(win_getHandle(), GWL_STYLE);
            lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_SYSMENU);  
            SetWindowLong(win_getHandle(), GWL_STYLE, lStyle);
                       
            SetWindowPos(win_getHandle(), 0, 0, 0,     win.SystemInfo.DesktopResolution.right-1,     
                win.SystemInfo.DesktopResolution.bottom-1, SWP_SHOWWINDOW);
            MoveWindow(win_getHandle(), 0, 0, win.SystemInfo.DesktopResolution.right+1,
                win.SystemInfo.DesktopResolution.bottom+1, TRUE);
Edited by shinypixel
0

Share this post


Link to post
Share on other sites

Try something like this:
 

    CreateWindowEx(WS_EX_TOPMOST,
                          "ClassName",
                          "Caption",
                          WS_VISIBLE | WS_POPUP
                          0, 0,    // the starting x and y positions should be 0
                          SCREEN_WIDTH, SCREEN_HEIGHT,
                          NULL,
                          NULL,
                          GetModuleHandle(NULL),
                          NULL);
Edited by Eliad Moshe
0

Share this post


Link to post
Share on other sites

You could have a look at my game window class in my 3d engine, that's how i do it. My guess is that you forgot the

CDS_FULLSCREEN

at line 110 in my code, in the ChangeDisplaySettings() function.

 

You don't need (or want) to hide the taskbar... with this code, the taskbar will be covered by the fullscreen window automagically.

 

I also agree that using a fbo for multiple resolutions is the way to go. It may cause stretching though, for example, when resizing the window in windowed mode.

Edited by Vortez
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0