w32 app that recognizes it´s own name

Miscellaneous Forums/Win32 Discussion/w32 app that recognizes it´s own name

Oops, meant to be for BlitzPlus (needs addition to userlibs -- see below if unsure)...

Function Exe$ ()
	MAX_PATH = 260
	name = CreateBank (MAX_PATH)
	length = GetModuleFileName (0, name, MAX_PATH)
	If length
		For byte = 0 To length - 1
			executable$ = executable$ + Chr (PeekByte (name, byte))
		Next
	EndIf
	FreeBank name
	Return executable$
End Function

Notify Exe$ ()

If the userlibs file ... BlitzPlus\userlibs\kernel32.decls already exists, just add this line to it (assuming GetModuleFileName isn't listed)...
GetModuleFileName% (module_handle, fname*, fname_size) : "GetModuleFileNameA"

If ... BlitzPlus\userlibs\kernel32.decls doesn't already exist, create it using Notepad or similar (save a plain text file with that name), and add this:
; .lib "kernel32.decls"
; GetModuleFileName% (module_handle, fname*, fname_size) : "GetModuleFileNameA"