Say I want to prepend what returns from something GetCurrentDirectory to another string? What's a good way to go about this?
:D appending it the other way, for instance.
include \masm32\include\masm32rt.inc
.data?
buffer db MAX_PATH dup (?)
.code
AppName db "Test app", 0
MyFile db "\MyParas.ini", 0
start:
invoke GetCurrentDirectory, MAX_PATH-12, addr buffer
invoke lstrcat, addr buffer, addr MyFile
invoke MessageBox, NULL, addr buffer, addr AppName, MB_OK
invoke ExitProcess, 0
end start
That was exactly what I was looking for, thanks.
Hi slovach:
You can also try:
The API GetModuleFileName
invoke GetModuleFileName,hInst,addr buffer,260]
GetModuleFileName does NOT always give you the working directory.. especially if the working directory was set by a shortcut/lnk...
and you also have to trim the exe name from it...