Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3670
Number of posts: 9122

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Example Code Posted by Luke7 on 16 Dec 2005 at 10:03 AM
I am looking for some example code to copy files in WinXP.
The code I currently have doesn't work if the destination folder is hidden.

Thanks.
Report
Re: Example Code Posted by Gaashius on 16 Dec 2005 at 10:51 AM
This message was edited by Gaashius at 2005-12-16 10:51:47

: I am looking for some example code to copy files in WinXP.
: The code I currently have doesn't work if the destination folder is hidden.
:
: Thanks.
:
Show us the code and we maybe can help.

EDIT: maybe

****************

Gaashius




Report
Re: Example Code Posted by Luke7 on 16 Dec 2005 at 12:55 PM
: This message was edited by Gaashius at 2005-12-16 10:51:47

: : I am looking for some example code to copy files in WinXP.
: : The code I currently have doesn't work if the destination folder is hidden.
: :
: : Thanks.
: :
: Show us the code and we maybe can help.
:
: EDIT: maybe
:
: ****************
:
: Gaashius
:
:
:
:
:

Here is what I have so far.
Thanks.

; copyf.asm Copy a file over an existing file
;

.486
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive


include \masm32\include\windows.inc
include \masm32\include\masm32.inc
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\Comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\shell32.inc
include \masm32\include\oleaut32.inc
include \masm32\macros\macros.asm

includelib \masm32\lib\masm32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\Comctl32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\shell32.lib
includelib \masm32\lib\oleaut32.lib

.data

File1 db "C:\Supplies\Lab_Order.xls", 0 ; file names are case sensitive
File2 db "C:\spare\Lab_Order.xls", 0

.code

start:

main proc

LOCAL buffer[260]:BYTE
invoke GetCL,1,ADDR buffer

; Specifies how this operation is to proceed if a file of the same
; name as that specified by lpNewFileName already exists.
; If this parameter is TRUE and the new file already exists,
; the function fails. If this parameter is FALSE and the new file
; already exists, the function overwrites the existing file and succeeds.

invoke CopyFile, offset File1, offset File2, FALSE
invoke ExitProcess,0

main endp

end start

Report
Re: Example Code Posted by Gaashius on 17 Dec 2005 at 3:25 AM
: : This message was edited by Gaashius at 2005-12-16 10:51:47

: : : I am looking for some example code to copy files in WinXP.
: : : The code I currently have doesn't work if the destination folder is hidden.
: : :
: : : Thanks.
: : :
: : Show us the code and we maybe can help.
: :
: : EDIT: maybe
: :
: : ****************
: :
: : Gaashius
: :
: :
: :
: :
: :
:
: Here is what I have so far.
: Thanks.
:
: ; copyf.asm Copy a file over an existing file
: ;
:
: .486
: .model flat, stdcall ; 32 bit memory model
: option casemap :none ; case sensitive
:
:
: include \masm32\include\windows.inc
: include \masm32\include\masm32.inc
: include \masm32\include\gdi32.inc
: include \masm32\include\user32.inc
: include \masm32\include\kernel32.inc
: include \masm32\include\Comctl32.inc
: include \masm32\include\comdlg32.inc
: include \masm32\include\shell32.inc
: include \masm32\include\oleaut32.inc
: include \masm32\macros\macros.asm
:
: includelib \masm32\lib\masm32.lib
: includelib \masm32\lib\gdi32.lib
: includelib \masm32\lib\user32.lib
: includelib \masm32\lib\kernel32.lib
: includelib \masm32\lib\Comctl32.lib
: includelib \masm32\lib\comdlg32.lib
: includelib \masm32\lib\shell32.lib
: includelib \masm32\lib\oleaut32.lib
:
: .data
:
: File1 db "C:\Supplies\Lab_Order.xls", 0 ; file names are case sensitive
: File2 db "C:\spare\Lab_Order.xls", 0
:
: .code
:
: start:
:
: main proc
:
: LOCAL buffer[260]:BYTE
: invoke GetCL,1,ADDR buffer
:
: ; Specifies how this operation is to proceed if a file of the same
: ; name as that specified by lpNewFileName already exists.
: ; If this parameter is TRUE and the new file already exists,
: ; the function fails. If this parameter is FALSE and the new file
: ; already exists, the function overwrites the existing file and succeeds.
:
: invoke CopyFile, offset File1, offset File2, FALSE
: invoke ExitProcess,0
:
: main endp
:
: end start
:
:
The problem should be in the CopyFile thingy you invoke... what could not be modified easily I think. If you know in which include file does CopyFile exist, you could show us that also.

****************

Gaashius


Report
Re: Example Code Posted by Luke7 on 18 Dec 2005 at 11:29 AM
: : : This message was edited by Gaashius at 2005-12-16 10:51:47

: : : : I am looking for some example code to copy files in WinXP.
: : : : The code I currently have doesn't work if the destination folder is hidden.
: : : :
: : : : Thanks.
: : : :
: : : Show us the code and we maybe can help.
: : :
: : : EDIT: maybe
: : :
: : : ****************
: : :
: : : Gaashius
: : :
: : :
: : :
: : :
: : :
: :
: : Here is what I have so far.
: : Thanks.
: :
: : ; copyf.asm Copy a file over an existing file
: : ;
: :
: : .486
: : .model flat, stdcall ; 32 bit memory model
: : option casemap :none ; case sensitive
: :
: :
: : include \masm32\include\windows.inc
: : include \masm32\include\masm32.inc
: : include \masm32\include\gdi32.inc
: : include \masm32\include\user32.inc
: : include \masm32\include\kernel32.inc
: : include \masm32\include\Comctl32.inc
: : include \masm32\include\comdlg32.inc
: : include \masm32\include\shell32.inc
: : include \masm32\include\oleaut32.inc
: : include \masm32\macros\macros.asm
: :
: : includelib \masm32\lib\masm32.lib
: : includelib \masm32\lib\gdi32.lib
: : includelib \masm32\lib\user32.lib
: : includelib \masm32\lib\kernel32.lib
: : includelib \masm32\lib\Comctl32.lib
: : includelib \masm32\lib\comdlg32.lib
: : includelib \masm32\lib\shell32.lib
: : includelib \masm32\lib\oleaut32.lib
: The problem should be in the CopyFile thingy you invoke... what could not be modified easily I think. If you know in which include file does CopyFile exist, you could show us that also.
:
: ****************
:
: Gaashius

Would you be able to narrow down the list of include files. I don't have
a search utility that can search through multiple files.

Thanks.
Report
Re: Example Code Posted by anthrax11 on 18 Dec 2005 at 12:04 PM
: : : : This message was edited by Gaashius at 2005-12-16 10:51:47

: : : : : I am looking for some example code to copy files in WinXP.
: : : : : The code I currently have doesn't work if the destination folder is hidden.
: : : : :
: : : : : Thanks.
: : : : :
: : : : Show us the code and we maybe can help.
: : : :
: : : : EDIT: maybe
: : : :
: : : : ****************
: : : :
: : : : Gaashius
: : : :
: : : :
: : : :
: : : :
: : : :
: : :
: : : Here is what I have so far.
: : : Thanks.
: : :
: : : ; copyf.asm Copy a file over an existing file
: : : ;
: : :
: : : .486
: : : .model flat, stdcall ; 32 bit memory model
: : : option casemap :none ; case sensitive
: : :
: : :
: : : include \masm32\include\windows.inc
: : : include \masm32\include\masm32.inc
: : : include \masm32\include\gdi32.inc
: : : include \masm32\include\user32.inc
: : : include \masm32\include\kernel32.inc
: : : include \masm32\include\Comctl32.inc
: : : include \masm32\include\comdlg32.inc
: : : include \masm32\include\shell32.inc
: : : include \masm32\include\oleaut32.inc
: : : include \masm32\macros\macros.asm
: : :
: : : includelib \masm32\lib\masm32.lib
: : : includelib \masm32\lib\gdi32.lib
: : : includelib \masm32\lib\user32.lib
: : : includelib \masm32\lib\kernel32.lib
: : : includelib \masm32\lib\Comctl32.lib
: : : includelib \masm32\lib\comdlg32.lib
: : : includelib \masm32\lib\shell32.lib
: : : includelib \masm32\lib\oleaut32.lib
: : The problem should be in the CopyFile thingy you invoke... what could not be modified easily I think. If you know in which include file does CopyFile exist, you could show us that also.
: :
: : ****************
: :
: : Gaashius
:
: Would you be able to narrow down the list of include files. I don't have
: a search utility that can search through multiple files.
:
: Thanks.
:

CopyFile is a standard Winapi function defined in kernel32.inc
I dont know how this is helpful though.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.