flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
strcpy() 28 Sep 2006, 18:22
Hi all!
i want to use the C´s system() function but in FASM is there some way, using the WINAPI or something ? thanks! |
|||
![]() |
|
Tommy 28 Sep 2006, 19:21
i guess it's accessible through the msvcrt.dll
|
|||
![]() |
|
f0dder 28 Sep 2006, 21:57
Or use CreateProcess instead of depending on msvcrt.dll. Or ShellExecute, if your needs are simple.
|
|||
![]() |
|
LocoDelAssembly 28 Sep 2006, 23:43
And even more simple WinExec (not recomended by Microsoft but this worked for me on WinXP 64-bit
![]() Code: include 'win32axp.inc' .code start: invoke WinExec,\ "notepad.exe test.asm",\ ; address of command line SW_SHOWNORMAL ; window style for new application invoke ExitProcess, 0 .end start My source is named "test.asm" so when I press F9 on FASMW I get a notepad with the source code of the program that opened it ![]() |
|||
![]() |
|
Vasilev Vjacheslav 29 Sep 2006, 04:36
also ShellExecute
|
|||
![]() |
|
LocoDelAssembly 29 Sep 2006, 13:43
If ShellExecute runs synchronously then is the prefered, otherwise I think it's better CreateProcess with a wait-for-terminate code. WinExec returns control at the first GetMessage call of the program passed to WinExec (but the program still alive and doesn't finished its work).
The wait-for-terminate code is something around CreateProcess, OpenProcess and WaitForSingleObject. |
|||
![]() |
|
f0dder 29 Sep 2006, 13:55
Indeed, locodelassembly. And don't forget CloseHandle*2
![]() |
|||
![]() |
|
LocoDelAssembly 29 Sep 2006, 13:58
oooh, good advice
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.