set_application_title() not implimented [u524]
Reporter: EnigmaBot | Status: closed | Last Modified: September 01, 2018, 08:47:36 amConsidering this should be quick and easy to add to the core engine,
I figured, "hey, why not?" So I posted this here tracker ticket.
GameMaker 8.0 introduced set_application_title(). Both GameMaker 8.0
and 8.1 releases included this function. GameMaker:Studio dropped it
as obsolete in favor of window_set_caption(). Prior to GMStudio, the
function window_set_caption() didn't set the taskbar caption, it only
set the titlebar caption. GMStudio made it so window_set_caption()
sets both the titlebar and taskbar captions.
Added a function set_application_title(title) to set the title of the application (which is shown in the taskbar).
http://gamemaker.info/en/manual/new
What's the Win32 function for this? I believe this one was not added simply because I couldn't find a Win32 function that changes only the taskbar. Also do not forget that GMS removed room_caption in favor of a Global Game Setting for it.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633546(v=vs.85).aspx
Second, I don't see any need for two functions. I don't know why anybody would want the taskbar to say something different than the window title does. So I kind of see why they decided to just simplify it for GMS. However, in this particular case I think it will be ok to just add the function for setting the taskbar only. If somebody could just find the Win32 function that it should call we can add it immediately.
Edit: Scratch that, I see now why they did not do that.
http://stackoverflow.com/questions/6665535/changing-the-taskbar-text-without-using-setwindowtext
http://stackoverflow.com/questions/4627772/set-a-taskbar-text-different-from-the-window-title-in-wpf
You have to use ugly hacks to do it, mainly having a hidden window. This really isn't anything anyone should be doing. I don't even think it would be possible to get this to work on any Linux window manager.
set_application_title()
was possible in GM because it is Delphi-based. And every Delphi program that uses VCL and Application
class doesn't have main windows as it's understood by WinAPI. So it's began possible to set one taskbar title (it is the Application.Title
property) and different captions for windows (Caption
property that every form has).Application.Title
work? I ask this assuming that somewhere it must be calling Win32 code to do it. Would its solution be similar to the SO posts I linked above? I wonder if it is possible to do it in Delphi for a console/terminal program.Application.Title
uses WinAPI SetWindowText()
function. Application
class has an invisible window (CreateWindow()
with WS_POPUP
style and width/height set to 0), on which this function is used.
Setting Caption
property of a form directly sends WM_SETTEXT
, and afterwards CM_TEXTCHANGED
, messages. This is quite similar to SetWindowText()
.
window
namespace, eg, window_set_application_title
. It seems to offer no value over window_set_caption
. I have no idea why they added it, as I recall Game Maker 6 supporting the latter. Am I remembering incorrectly?
Or maybe... is this "application title" separate from the window title on new Windows releases? I don't know of any Linux desktops that both have that information and would allow dynamically setting it. I seem to recall Windows persisting icons of closed programs, which behave like launchers. Is this the title used by those? Mac and Linux support this through config files. There's no method to dynamically change that information, and you'd kind of need to be insane to want to.
I agree with leaving this method unimplemented, though if there's ever a compatibility layer for GM8, we can talk about it then. We can also talk about better support for creating application launchers or installers. But let's not busy ourselves with this one-off.
window_set_application_title
. It seems to offer no value over window_set_caption
. I have no idea why they added it, as I recall Game Maker 6 supporting the latter. Am I remembering incorrectly?
Yes, you are. Because window_set_caption()
changes a caption of the window but not text that is shown in the taskbar and Task Manager. That's what set_application_title()
was needed for.
And it doesn't break naming convention because there's a whole set of functions starting with set_
- set_program_priority()
, set_synchronization()
and set_application_title()
. Maybe even more, I just don't remember it properly.
WS_EX_APPWINDOW
style and call SetWindowText
on it."
It's possible that this is what GM8 was doing, I suppose, but ENIGMA has only one window, so its window_set_caption
should be controlling both, yes?
WS_EX_APPWINDOW
style and call SetWindowText
on it."
That's how Delphi VCL works, not GM itself.
window_set_caption
was pretty useless in GM because it was always overridden by room_caption
. I just tested this in GM8.1 and the only way to get it to have any effect is to put it in the step event which flickers back and forth fighting with the room_caption
. It was used a lot by users during extended resource loading, or periods during which other events are blocked, to display progress. I never realized that it didn't actually change the taskbar text until now, which ENIGMA's function does in fact do.
Checking the GameMaker 5 manual we can see that room_caption
used to be the only way to change the window's caption.
http://gamemaker.cc/downloads/documents/gmaker53.pdf
We can see that window_set_caption
was added in GameMaker 6.
http://gamemaker.cc/downloads/documents/gmaker60.pdf
http://gamemaker.cc/downloads/documents/gmaker61.pdf
This set_application_title
function was not added until GameMaker 8, which we can assume was someone at YoYoGame's decision:
http://gamemaker.cc/downloads/documents/gmaker80.pdf
The Delphi thing is probably like how in Java every JFrame technically has 2 windows behind it. Lots of frameworks still make this distinction between the application and the main window, see Qt's QApplication and QMainWindow respectively. What's interesting is that back when we had 2 windows, we would have been able to emulate this 100% but we have since moved to a single window like the modern GameMaker: Studio (which in my opinion is better).
Further, I want to state that I absolutely hate the idea of this function. Having a different caption in the taskbar for an application than the one in the Window title is certainly a violation of some design principles or Human-Computer-Interaction standards. I almost certainly blame YoYoGames for this dilemma and find this function to be one of the leading causes of all the garbage "Catch the clown" clones GameMaker became notorious for. Back in the days of the YoYo sandbox, the perception I had was that they were literally turning GameMaker into AdwareMaker or more like PopupMaker. I don't want ENIGMA to become responsible for a similar wave of annoying and misleading game ripoffs. I consider this behavior akin to alert(...)
dialogs in JavaScript.
In GameMaker: Studio room_caption
is now deprecated and so is set_application_title
.
https://docs.yoyogames.com/source/dadiospice/002_reference/rooms/room_caption.html
https://docs.yoyogames.com/source/dadiospice/002_reference/017_obsolete%20functions/obsolete%20miscellaneous%20functions.html
The only way to change the caption or taskbar now is through either window_set_caption
or by the "Display name" settings for each platform, as Josh alluded to:
So this obviously leaves us with several choices:
- Deprecate
room_caption
and go the GMS way. - Add
set_application_title
as an alias forwindow_set_caption
(which I think is more sensible since it's more crossplatformy sounding; think HTML5). - Add a ghost parent Window to ENIGMA for compatibility mode settings, so if you are running in GM8.1-or-less compliance then it behaves as you expect. Our default behavior would be like GMS.
I would probably just pick 3 and go implement it for people if somebody REALLY needed this, but I am not really convinced anybody needs it in ENIGMA.
MainFormOnTaskbar
and is deprecated by Delphi 2007 or later.http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Forms_TApplication_MainFormOnTaskBar.html
If false, a taskbar button represents the application's (hidden) main window and bears the application's Title.
MainFormOnTaskBar must be true to use Windows Vista Aero effects.
MainFormOnTaskBar defaults to True for applications created in Delphi 2007 and later products and False for earlier products.
This is a perfect reason for us not to support it, in addition to any reasons I listed above, and perfectly explains why YoYoGames dropped it too.