Yeah, got it :) full unreadable sourcecode follows:




; in .data:
[...]
szPathMask db "%s%s", 0
szOFNFilter db "Audio (*.mp3, *.wav, *.wma)", 0, "*.mp3;*.wav;*.wma", 0,
"Video (*.avi, *.mpg, *.mpeg)", 0, "*.avi;*.mpg;*.mpeg", 0, 0
[...]
; in .data?:
[...]
szOFNBuffer db 16384 dup (?)
szFile01Buffer db 512 dup (?)
szFile02Buffer db 512 dup (?)
szFile03Buffer db 512 dup (?)
ofn OPENFILENAME <?>
[...]
; in .code:
[...]
mov ofn.lStructSize, sizeof OPENFILENAME
push hWin
pop ofn.hwndOwner
mov ofn.hInstance, 40000h
mov ofn.lpstrFilter, offset szOFNFilter
mov ofn.lpstrFile, offset szOFNBuffer
mov ofn.nMaxFile, 16384
mov ofn.lpstrTitle, offset szAppName
mov ofn.Flags, OFN_EXPLORER or OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_ALLOWMULTISELECT

invoke GetOpenFileName, addr ofn

.if byte ptr [szOFNBuffer] != 0
lea edi, szOFNBuffer
lea esi, szFile01Buffer
@@:
mov al, byte ptr [edi]
mov byte ptr [esi], al
inc edi
inc esi
or al, al
jnz @B
cmp byte ptr [edi+1], 0
je @@sel_one
invoke lstrlen, addr szFile01Buffer
cmp eax, 3
je @@next
lea esi, szFile01Buffer
add esi, eax
mov byte ptr [esi], "\"
@@next:
lea esi, szFile02Buffer
@@:
mov al, byte ptr [edi]
mov byte ptr [esi], al
inc edi
inc esi
or al, al
jnz @B
invoke wsprintf, addr szFile03Buffer, addr szPathMask, addr szFile01Buffer, addr szFile02Buffer
invoke MessageBox, hWin, addr szFile03Buffer, 0, 0
cmp byte ptr [edi+1], 0
jne @@next
jmp @@exit
@@sel_one:
invoke MessageBox, hWin, addr szFile01Buffer, 0, 0
@@exit:
invoke RtlZeroMemory, addr szFile01Buffer, 512
invoke RtlZeroMemory, addr szOFNBuffer, 16384
.endif
[...]


P.S.: used wsprintf instead of lstrcat, because I didn't want to overwrite szFile01Buffer (wich contains the directory in this case)
Posted on 2001-12-30 16:45:19 by bazik