I want this code to copy the contents of a directory (CurrentDir) to a new directory (NewDir) automatically and without a window, on running the program. Does anyone know why this code isn't working please?? It's based on Iczelion's listview.asm. Any help gratefully appreciated. Jim. .386 .model flat,stdcall option casemap:none MainFunction PROTO include \masm32\include\windows.inc include \masm32\include\masm32.inc include \masm32\include\kernel32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\masm32.lib .data FileNamePattern db "*.*",0 NewDir db "c:\windows\desktop\tmp\",0 CurrentDir db "c:\windows\desktop\tmp2\",0 .code start: invoke SetCurrentDirectory,ADDR CurrentDir ; change drive invoke MainFunction invoke ExitProcess,eax MainFunction proc uses edi LOCAL tmpbuf[256]:BYTE LOCAL finddata:WIN32_FIND_DATA LOCAL FHandle:DWORD invoke FindFirstFile,addr FileNamePattern,addr finddata .if eax!=INVALID_HANDLE_VALUE mov FHandle,eax xor edi,edi .while eax!=0 test finddata.dwFileAttributes,FILE_ATTRIBUTE_DIRECTORY .if ZERO? inc edi .endif invoke lstrcpy,addr tmpbuf,addr NewDir invoke szCatStr,ADDR tmpbuf,ADDR finddata invoke CopyFile, addr finddata, addr tmpbuf,0 invoke FindNextFile,FHandle,addr finddata .endw invoke FindClose,FHandle .endif ret MainFunction endp end start
Posted on 2000-11-21 08:39:00 by Jim
Hi again All, I rewrote the code and it works fine now so please ignore my previous message. Many Thanks, Jim
Posted on 2000-11-22 07:58:00 by Jim