w32 app that recognizes it´s own name

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

Try this...

Global GetModuleFileName (module_handle, fname:Byte Ptr, fname_size) "win32"

kernel32 = LoadLibraryA ("kernel32.dll")
If kernel32
	GetModuleFileName = GetProcAddress (kernel32, "GetModuleFileNameA")
EndIf

Function Exe$ ()
	MAX_PATH = 260
	Local filename:Byte [MAX_PATH]
	GetModuleFileName (Null, filename, MAX_PATH)
	Return String.FromCString (filename)
End Function

Notify Exe$ ()


EDIT: Oops, BlitzMax code... see next post!