A downloadable tool for Windows

Download NowName your own price

win32ApiGM is a dll / extension for GameMaker: Studio to interact with the windows api. You can use Messageboxes, execute (restricted) shell commands, make a window blinking in the taskbar, change the icon of the game window in runtime or set the desktop wallpaper.

Note: The dll is made for GMS1.4, partially works in GMS2.3:

Broken functions in GMS2.3 are: setWindowTitle(), setWindowOptions(), setWindowIcon(), setFlashingSelf().

Feature list:

  • set window width and height
  • check if there’s a window with a requested name opened
  • get the title of the currently focused window at any time
  • show messageboxes:
    • “Normal” messageboxes with just an OK button,
    • messageboxes with yes and no button,
    • messageboxes with a continue, try again and cancel button
  • set the game’s main window icon to any icon file
  • execute the windows shell (shellExecuteEx)
  • set the window’s icon in taskbar as flashing
    • this can either be done to the main game window or any window if you pass it’s title
  • set window position on screen
  • set window title
  • set desktop wallpaper
  • Experimental: Get information on the current device: Number of processors and username

Documentation

Documentation will be fully available soon, there are some functions lacking further explanation right now. (Definitely check the project's github)
note: void return type means the returned value is arbitrary and not useful.
Also, the datatype “double” is synonym to real, float, ty_real, same with string being synonym to ty_string or char
*

dll functions (when using the raw dll)

function name parameters (first to last) returns description
setWindowTitle (windowTitle: string) void Sets the current game window’s title
setWindowOptions (x: double, y: double, width: double, height: double) void Sets the game window’s position and width on the screen
getProcessors () double Returns the number of processors
getUser () string Returns the username as a string (Currently WIP, may not work as expected)
checkWindowName (windowName: string, returnValue: double) double Returns a 1 if the window with title specified in windowName is found, else 0, returnValue must be passed as 1
getWindowNameC () string Returns the title of the currently focused window
showMessageboxOk (headline: string, bodytext: string) void Shows a messagebox with OK button and the specified text
showMessageboxCTC (headline: string, bodytext: string, returnVal: double) double If the user pressed “cancel” returns 0, “try again” = 1, “continue” = 2
showMessageboxYN (headline: string, bodytext: string, returnVal: double) double returns “yes” = 1, “no” = 0
setWindowIcon (icopath: string) void sets the icon to the ico file specified in icopath… Remember to use double backslashes!
shellExecEx (verb: string, file: string, showtype: string) void Executes a shell (ShellExecute). “showtype” is an integer value passed as a string.
setFlashingSelf (flashCount: double, flashRateMillis: double) void Flashes the window icon in the taskbar flashCount amount of times with flashRateMillis rate
setFlashingName (windowName: string, flashCount: double, flashRateMillis: double) void Does the same thing as *self but this time to another window that has windowName as its title

Download

Download NowName your own price

Click download now to get access to the following files:

win32api_GM.dll (GMS1.4, GMS2, GMS2.3) 99 kB
win32Api_GM14.gmez (GMS1.4) 38 kB

Development log

Leave a comment

Log in with itch.io to leave a comment.