Cap0 Posted December 24, 2007 Share Posted December 24, 2007 How do you do it? i mean, in C++ it returns its process information stored..like: int main() { STARTUPINFO start; PROCESS_INFORMATION proc; ZeroMemory(&start,sizeof(start)); start.cb = sizeof(start); ZeroMemory(&proc,sizeof(proc)); CreateProcess("C:\\test",NULL,NULL,NULL,FALSE,0,NULL,NULL,&start,&proc); } How would you do the following in Autoit?..i'm not good with structs and all(hell, i haven't scripted in autoit since last year). Link to comment Share on other sites More sharing options...
James Posted December 24, 2007 Share Posted December 24, 2007 Look at the DLLCall function. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Zedna Posted December 24, 2007 Share Posted December 24, 2007 Look at the DLLCall function.and DllStructCreate Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
James Posted December 24, 2007 Share Posted December 24, 2007 Yeah, I forgot that one. Good reminder Zedna Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
FrenchTroll Posted December 24, 2007 Share Posted December 24, 2007 Func _CreateProcess($sAppName, $sCommand, $pSecurity, $pThread, $fInherit, $iFlags, $pEnviron, $sDir, $pStartupInfo, $pProcess) Local $pAppName, $tAppName, $pCommand, $tCommand, $pDir, $tDir, $aResult if $sAppName <> "" then $tAppName = DllStructCreate("char Text[" & Stringlen($sAppName) + 1 & "]") $pAppName = DllStructGetPtr($tAppName) DllStructSetData($tAppName, "Text", $sAppName) endif if $sCommand <> "" then $tCommand = DllStructCreate("char Text[" & Stringlen($sCommand) + 1 & "]") $pCommand = DllStructGetPtr($tCommand) DllStructSetData($tCommand, "Text", $sCommand) endif if $sDir <> "" then $tDir = DllStructCreate("char Text[" & Stringlen($sDir ) + 1 & "]") $pDir = DllStructGetPtr($tDir) DllStructSetData($tDir, "Text", $sDir) endif $aResult = DllCall("Kernel32.dll", "int", "CreateProcess", "ptr", $pAppName, "ptr", $pCommand, "ptr", $pSecurity, "ptr", $pThread, _ "int", $fInherit, "int", $iFlags, "ptr", $pEnviron, "ptr", $pDir, "ptr", $pStartupInfo, "ptr", $pProcess) Return SetError(GetLastErreur(), 0, $aResult[0]<>0) EndFunc Func GetLastErreur() Local $aResult $aResult = DllCall("Kernel32.dll", "int", "GetLastError") Return $aResult[0] EndFunc It's in A3LWinAPI.au3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now