Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Window Commands for GameMaker

Check/disable/dispatch window commands in GameMaker · By YellowAfterlife

Missing docs?

A topic by peardox created Aug 26, 2023 Views: 280 Replies: 7
Viewing posts 1 to 8

Just grabbed window_command_hook-for-GMS2.3+.yymps import appears to be missing the html documentation

Specifically I just wanna make a 5120x1600 window stay on top when displayed accross two monitors (a 2560x1440 + a 2560x1600) - experimenting with multi-monitor game (but Taskbar is showing on top of window on the smaller monitor - full screen not suitable for multi-monitor). My test "bouncing block" displays under task bar when at that position

Developer

There’s a link to documentation in itch description.

Yeah, I eventually found it - but importing the yymps lists doc html file in included file.

Anyway - after finding window_set_topmost(1); it don't actually do what I was after using something like....

window_set_rectangle(0, 0, 5120, 1600);
window_set_fullscreen(false);
window_set_position(0, 0); // These can be negative in some situations
window_set_showborder(false);

Taskbar still shows - think I'll go try it with a 'proper' language - must be possible as several games non-GM appear to do it without using exclusive full screen

(3 edits)

Just tried it in Delphi

procedure TForm1.FormCreate(Sender: TObject); 
begin
   form1.Width := 5120;
   form1.Height := 1600;
   form1.Top := 0;
   form1.Left := 0;
   form1.FormStyle := fsStayOnTop;
   form1.BorderStyle := bsNone;
 end;

Did exactly what I was after (but not in GM...)

I take it topmost is just altering the Z order of the window as opposed to what Delphi's fsStayOnTop does

Possibly I need to get to the TOPMOST option here? 

Developer

That’s exactly what it does, so go figure

Looking at the Delphi source code fsStayOnTop is slightly different (two more flags in last param)

SetWindowPos(Handle, HWND_STYLE[FFormStyle = fsStayOnTop], 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE or SWP_NOOWNERZORDER);

HWND_STYLE[FFormStyle = fsStayOnTop] is equal to HWND_TOPMOST if fsStayOnTop otherwise HWND_NOTOPMOST

Developer

I don’t think those two would matter here and my test project does show over the taskbar correctly, but you can try re-compiling the DLL from the source code and report on your findings.

(1 edit)

Ahah...

I just bound window_set_topmost() to a key to switch between states and it works so I just have a timing issue by the look of it.

The end result is that if dual monitor I can select which monitor to use for the app and/or extend it to use both.

The most useful thing about this in dev is having IDE on one screen and app on another