Does anyone know why this prog don't execute msgbox.exe 2 times but only one time and in an endless loop?. (msgbox.exe is this prog.) I mean it shoul start msgbox.exe 2 times right?


.data
MsgCaption db "Iczelion's tutorial no.2",0
MsgBoxText db "Win32 Assembly is Great!",0
programname db "msgbox.exe"
processInfo PROCESS_INFORMATION <>
startInfo STARTUPINFO <>


.code
start:
invoke MessageBox, NULL,addr MsgBoxText, addr MsgCaption, MB_OK
invoke CreateProcess,ADDR programname,NULL,NULL,NULL,FALSE,\
NORMAL_PRIORITY_CLASS,\
NULL,NULL,ADDR startInfo,ADDR processInfo

invoke CreateProcess,ADDR programname,NULL,NULL,NULL,FALSE,\
NORMAL_PRIORITY_CLASS,\
NULL,NULL,ADDR startInfo,ADDR processInfo


invoke ExitProcess,NULL


end start
Posted on 2001-09-25 09:57:41 by pietje
Umm... if you have a program unconditionally executing itself, of course
it will run in an endless loop. Just like if you had a "call start" at
the end of your program, before ExitProcess.
Posted on 2001-09-25 10:20:45 by f0dder
forking program :grin: !
forking pile of ...... :tongue:

Mirno
Posted on 2001-09-25 10:33:12 by Mirno
Thank you I see the logic now!
Posted on 2001-09-25 11:15:13 by pietje
pietje,

if the msgbox.exe is in current directory just add ",0" to programname
before -> programname db "msgbox.exe"
after-> programname db "msgbox.exe", 0

if you are not sure just use full path name
this1 works for me:
programname db "c:\windows\calc.exe" ,0
Posted on 2001-09-25 14:04:21 by buliaNaza