#include once "window9.bi"

Function GetCurrentFileName() As String Export
  Dim As String*512 Nameinst
  GetModuleFileName(0,Cast(LPSTR,@Nameinst),512)
  Return GetFilePart(Nameinst)
End Function

Function GetCurrentFileNameA() As String Export
  Dim As String*512 Nameinst
  GetModuleFileName(0,Cast(LPSTR,@Nameinst),512)
  Return ReplaceString(GetFilePart(Nameinst),".exe","")
End Function
