I am no AutoIt expert, but in .Net, I would attempt to Process.Kill(); Engine.exe before it exits. That would instantly close the process without it saving any data. This is one reason why autoIt is not a good language to be dealing with window APIs and calling DLL functions.
Originally Posted by WarPathSin666
P.S. You realize it only returns 1 if the process no longer EXISTS.
Smart comeback but you realize you didn't do what you mentioned above?
Pauses script execution until a given process does not exist.
ProcessWait Close ( "process" [, timeout] )
You can never know if "_GETPROCHANDLE" fails, because it even if $PROCESS isn't an int, it still returns 0.
Func _FREEREMOTEDLL($HMODULE, $PROCESS)
Local $RET, $ERR = 0
Local $HPROCESS = _GETPROCHANDLE($PROCESS)
If Not $HPROCESS Then
$ERR = 7
Local $FREELIBRARY = _GETPROCADDRESS(_WinAPI_GetModuleHandle("kernel32.dll"), "FreeLibrary")
$RET = _CREATEREMOTETHREAD($HPROCESS, $FREELIBRARY, $HMODULE)
If Not $RET Then
$ERR = 12
Return SetError($ERR, 0, Number(($ERR = 0)))
Local $HPROCESS = 0
Local $PERMISSION = BitOR(2, 8, 32)
If IsInt($PROCESS) Then
If $PROCESS > 0 Then
Local $RET = DllCall("kernel32.dll", "ptr", "OpenProcess", "dword", $PERMISSION, "int", 0, "dword", $PROCESS)
If ((Not @error) And $RET) Then
$HPROCESS = $RET
Return SetError(Number(($HPROCESS = 0)), 0, $HPROCESS)
And BTW, the coding scipt for autoIT .dll injection can be found with a click of a button on google, so I don't know if you really did that yourself or not. And considering your style of recording things down and coding, it's very doubtful you did it from scratch. If you had to look at a reference while you coded that thing. That shows you don't know much either.