removing start bar in windows
William Labbett

Hi,

I'm using window 10 with allegro 5.0.10 and I set the display flags to ALLEGRO_FULLSCREEN to get a fullscreen display.

The thing I don't know how to do is how to hide or remove the start bar at the bottom
of the screen with the start menu button, the search box and the quick launch shortcuts, etc...

Is there something I can do?

Bob Keane

Try right clicking the task bar, then click lock the task bar to unlock. Go into task bar settings and turn the automatically hide the task bar setting to on.

William Labbett

Thanks a lot. So there's no way to remove it with code (if the person running the program
hasn't got autohide set on there machine) ?

Bob Keane

I don't know. You can try this.

William Labbett

Many thanks Bob. Page saved for later as very busy at the moment.

Bob Keane

If it works, show your code. I could probably use it. ;)

Chris Katko

this doesn't sound right. are you saying it's fullscreen, and still showing the taskbar?

William Labbett

Yes.

Bob Keane

I believe this is what the OP is posting about:

{"name":"612803","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/8\/4853b777703bd68f4980a2e750921400.png","w":1366,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/8\/4853b777703bd68f4980a2e750921400"}612803

Autohide does not help, there is still a space where the taskbar should go:

{"name":"612802","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/f\/2f31f64fb0e2b4e131bdede583dd1fe3.png","w":1366,"h":768,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/f\/2f31f64fb0e2b4e131bdede583dd1fe3"}612802

I'd like to find a fix myself.

Elias

Almost sounds like a bug with ALLEGRO_FULLSCREEN in Windows - I feel it should hide the task bar. Does it also happen with ALLEGRO_FULLSCREEN_WINDOW (which will give the window the wrong size so not always an alternative of course)?

torhu

I don't think there is any way it can be real fullscreen mode if the taskbar is showing, the Windows desktop is not an overlay. I've seen glitches where the game hangs and you just get the desktop back partially, but not quite the same thing. If it's actually "fullscreen window", then it sounds like an Allegro bug. It's quite common for games today to use this mode, SC2 is the first one I remember using it. I'm playing Far Cry 5 now, which defaults to it.

Bob Keane

I thought it might be a Microsoft thing but when I use retroarch full screen the taskbar and space for it is not there. Probably a bug, but I will check my code later to see if I used full screen or full screen windowed.

William Labbett

It does happen with ALLEGRO_FULLSCREEN_WINDOW.

Dizzy Egg

You can run this code to hide the start bar...

static HWND hShellWnd = ::FindWindow("Shell_TrayWnd", NULL);
ShowWindow(hShellWnd, SW_HIDE);

BUT be sure to run this before you exit, otherwise you won't get it back!!

hShellWnd = ::FindWindow("Shell_TrayWnd", NULL);
ShowWindow(hShellWnd, SW_SHOW);

William Labbett

Great. Will that work in both cases ALLEGRO_FULLSCREEN and ALLEGRO_FULLSCREEN_WINDOWED? Had to ask.

Dizzy Egg

Yeah that'll hide it regardless of window/fullscreen.

torhu

Hiding the taskbar programmatically seems like a bad idea. What happens if the user switches back to the desktop without exiting the game first, or if the game crashes?

William Labbett

Is it possible to switch back to the desktop in fullscreen mode if the taskbar is hidden (except by triggering a close display event)?

torhu

Yeah, press the Windows key, Alt-Tab or Ctrl+Alt+Del :P

I don't think I have a functional Allegro installation any longer, otherwise I could have done some tests...

Dizzy Egg

It is a bad idea to do it in code!

William Labbett

I'm quite prone to having bad ideas. Nice to have all the info.
Don't professional (AAA say or quite expensive) games hide the taskbar?
Just seems naf.

bamccaig

You shouldn't need to hide the taskbar in fullscreen mode.

If possible I think positioning your window above the taskbar to cover it would be ideal to hiding the taskbar. If your game crashes or any other unexpected event happens then the taskbar could remain hidden and cripple the user's computer until a reboot (or at least explorer.exe is killed and restarted). :P

I wonder if the Windows key would still make it appear if you used code to "hide" it. :-/

Append:

The only way to make this work nicely by hiding the taskbar would be to handle the event when your window loses focus and showing the taskbar again. Hopefully before the user notices anything is amiss. :P But that may still be flaky. AAA studios have the resources to call Microsoft up and get this information directly from the source with full support. :P You and I cannot.

torhu

Raymond Chen says the taskbar should hide automatically:
https://devblogs.microsoft.com/oldnewthing/20050505-04/?p=35703

You could check if fullscreen windows work properly in other apps, like F11 in web browsers. If not, you could try restarting Windows (or just Windows Explorer), or maybe updating your graphics driver?

William Labbett

Thanks all. I've gone off the idea but for the record I've tried F11 (on a browser). All as it should be. I tried rebooting and running my app, all as before (taskbar present).
Haven't tried updating graphics driver. Can I with no GFX card?

Might switch to another machine which is better and try with that. Thanks again.

May take some time to try the last thing.

bamccaig

Integrated graphics still require drivers. :) But I doubt a driver update is going to fix this.

Maybe you should try developing a short program that you can share that demonstrates this problem. Then we can compile it and run it ourselves and report back our results, which can help to rule out your environment and might also help us spot the problem. :)

William Labbett

I did so and guess what?, the display really is fullscreen so I've been looking to see if
I've done something wrong in my actual program I need it to work for but so far I've found nothing.

So the only thing I can think of to do now is post all the requisite files for my project so those that would could look at it but I'm a bit worried I'm going to be embarrassed if I'm exposed as having done something stupid.

Advise please.

bamccaig

Don't be ashamed. :) Everybody makes mistakes. Even "stupid" ones. My GitHub is full of uninteresting projects full of "stupid" code. :P Besides, even if there is any "stupid" code in your project, all that exposing it will do is help you to learn more about it through constructive criticism from others so that you can get better! :) Which is exactly what the purpose of this thread is. :)

Just because something you've done is "stupid" does NOT mean that there is anything wrong with you. Ultimately, I think that it is a major disservice to our entire civilization that we expect people not to fail (in the sense that most of our states have no safety net to protect everyone from failure, deserved or otherwise). Failure is inevitable, and it is often only through failure that we succeed.

William Labbett

I've attached all the necessary files in 7zip file so if anyone really wants to they can
compile my program. I think all the extra files necessary are there ( the config, font, etc). Let me know if not and I'll post the others.

Here's what I get when I run it and that's after a call to

al_set_new_display_flags(ALLEGRO_FULLSCREEN);

{"name":"612818","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/e\/ee6f8d5771f973ce0cfaf75fdf4823f2.png","w":1229,"h":933,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/e\/ee6f8d5771f973ce0cfaf75fdf4823f2"}612818

EDIT : the display is created in the InputOutput constructor in input_output.cpp

thanks

torhu

Are you trying to set a mode the monitor/driver doesn't support?

Dizzy Egg

In your input_output.cpp you have:

al_set_new_display_flags(ALLEGRO_FULLSCREEN);

#ifdef ART_PROGRAM_DEBUG_MODE
al_set_new_display_flags(ALLEGRO_WINDOWED);
#endif // ART_PROGRAM_DEBUG_MODE

and in your global.hpp you have:

#define ART_PROGRAM_DEBUG_MODE

So remove that line from global.hpp and it will run full-screen??

(Or is the issue that in full-screen mode the taskbar is overlayed?)

William Labbett

The resolution I was trying to set was 1024 \times 768.

Thanks Dizzy Egg. You've found the answer for me. I got it working now. :)

I've realised that the reason the taskbar was showing was because it was windowed mode which I thought was fullscreen because my Desktop resolution was 1024 by 768 originally which was the size of the display being created.

torhu

Well, glad you got it working ;D Just curious, does it still work if you use the fullscreen window mode?

William Labbett

Thanks. There's no obvious difference to ALLEGRO_FULLSCREEN with ALLEGRO_FULLSCREEN_WINDOWED.

torhu

The difference should be that with the latter you can have the taskbar or even other application windows on top of your game, right? And there is no delay when switching back and forth.

William Labbett

Affirmative. I've realised that everything is the way it should be. I've also realised that when I think I've done something daft I really aught to try to find out what. Again.

Dizzy Egg

Thanks Dizzy Egg. You've found the answer for me. I got it working now.

You're welcome :)

Thread #618318. Printed from Allegro.cc