the one in masm32.lib dosnt work when in loop such as process 32 first and next HELP?????!!!! :cry: :cry: :cry: :cry: :oops:
Posted on 2004-12-03 04:07:58 by Retsim_X
edit: sorry, wrong topic
Posted on 2004-12-03 04:26:12 by Scorpie

ExtractShortFileName proc uses esi fnm:DWORD, incldir:DWORD
mov esi, fnm
invoke lstrlen, esi
add esi, eax
.IF al == '\'
.IF incldir > 0h
dec incldir
add esi, 2d
jmp FoundBackslash
cmp esi, fnm
ja @b

mov eax, esi
ExtractShortFileName endp

The Usage:

wholefile db 'D:\masm32\bin\file.asm', 0h

invoke ExtractShortFileName, addr wholefile, 0h a pointer to "file.asm"...

invoke ExtractShortFileName, addr wholefile, 1d a pointer to "bin\file.asm"...

feel free to re-write the procedure...
Posted on 2004-12-03 05:00:33 by Dom
this is the same thing as the strrchr() proceduce in VC. I use it for the same reason, for stripping off a filename from a fullpath.
Posted on 2004-12-03 07:56:20 by mark_larson
Thanx :lol: :-D
Posted on 2004-12-03 21:52:31 by Retsim_X
There's also PathFindFileName, in shwlapi.dll if I recall correctly.
Posted on 2004-12-04 11:37:21 by QvasiModo