Restored from previous forum. Originally posted by MrVainSCL.
hi @ all
here is small Win32 API example how to get the filename of your running application.

Code: Select all
; ------------------------------------------------------------
;
; PureBasic Win32 API - Get filename of your App - Example v1.0
;
; by Tranquilizer & MrVainSCL! 04/Dec/2002 PB v3.40+
;
; ------------------------------------------------------------
;
Global filename$
;
Procedure MyGetFilename()
hMod = GetModuleHandle_(0)
tmp$ = Space(255)
GetModuleFilename_(hMod,@tmp$,255)
filename$ = GetFilePart(tmp$)
EndProcedure
;
MyGetFilename()
MessageRequester("The filename of your application is:",filename$,0)
End
;
; ------------------------------------------------------------
PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...
greetz
MrVainSCL! aka Thorsten