flat assembler
Message board for the users of flat assembler.
Index
> Windows > FASM Program |
Author |
|
lilljocke 14 Mar 2006, 11:34
I use to design the dialog first and the controls. If i would make a program that copeis a file to another path i would start to make the dialog and controls and define a 2 buffers that can receve the text from the textboxes and then use CopyFile to copy the file.
BOOL CopyFile( LPCTSTR lpExistingFileName, // pointer to name of an existing file LPCTSTR lpNewFileName, // pointer to filename to copy to BOOL bFailIfExists // flag for operation if file exists ); |
|||
14 Mar 2006, 11:34 |
|
shoorick 14 Mar 2006, 11:48
write in upper box name of existing file, and in box below - new file name, and press OK: if fail try to use full pathnames.
check there for more complex examples: http://board.flatassembler.net/topic.php?t=4359
_________________ UNICODE forever! |
|||||||||||
14 Mar 2006, 11:48 |
|
jumpex 14 Mar 2006, 18:37
What's that "BOOL CopyFile ... " thing. It looks to me like a function. I'm fairly new to FASM, so I can't understand every aspect of it. Can you tell me more? I was thinking more of a console solution (if I can express myself that way). Nongraphic, nonwindow... Like the COPY command in windows. A complete example would be great with some comments. But I don't expect this. Just an explanation or a direction. Where to start? How could I achieve this.
|
|||
14 Mar 2006, 18:37 |
|
Borsuc 14 Mar 2006, 18:53
That "BOOL CopyFile" is NOT Fasm.. It's C language
Anyway, if you want to write a simple console, you can use only one API call (CopyFile). In C, BOOL CopyFile means that, after you 'call' the function, in the register 'eax' it will be a boolean value (00000000h or 00000001h). The other parameters (lpExistingFileName, lpNewFileName, bFailIfExists) are just 'dwords' on the stack (via push instruction). So, you can look at MSDN for more info (remember, ignore "LPCTSTR", it's just a 'dword', and the last "BOOL bFailIfExists" is also just a 'dword' ) Then use that API to copy files. Sure, if you don't know how to get the command line, see the GetCommandLine function.. remember, the "LPTSTR" before it's name is actually nothing (i.e the return value is simply eax after you called your function). So, after you invoke that function, in 'eax' you should be able to find the pointer to the command line. You'll need to extract it manually with this method, though (i.e skip spaces, find arguments.. the string pointed by eax (after you called function) will just be somewhat like you typed it, i.e: "MyCopyProgram param1 param2", this is the exact string that will be put in that string, if you typed it that way). The rest.. i hope you'll be able to find it yourself, it's really not that hard, trust me have patience Sorry if I confused you, I'm not very good at it though Hope it helps |
|||
14 Mar 2006, 18:53 |
|
jumpex 14 Mar 2006, 19:21
Thank you for your response. Amazing. Thanks again.
P.S: I thought that BOOL ~ looked familiar. |
|||
14 Mar 2006, 19:21 |
|
UCM 15 Mar 2006, 15:00
here is an example
http://board.flatassembler.net/topic.php?t=4841#35415 |
|||
15 Mar 2006, 15:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.