flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
strcpy()
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
i guess it's accessible through the msvcrt.dll
|
|||
![]() |
|
f0dder
Or use CreateProcess instead of depending on msvcrt.dll. Or ShellExecute, if your needs are simple.
|
|||
![]() |
|
LocoDelAssembly
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
also ShellExecute
|
|||
![]() |
|
LocoDelAssembly
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
Indeed, locodelassembly. And don't forget CloseHandle*2
![]() |
|||
![]() |
|
LocoDelAssembly
oooh, good advice
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.