slightly_abnormal Posted June 15, 2006 Posted June 15, 2006 (edited) I was messing with DLLcalls.. okay heres one.. (note: my conversion to autoit is not the best ) I assume i need handle rather then process name.. but dont know how to get it../ i know this is already built into autoit i just wanna try this with a real dllcall.. $Process = 'notepad.exe' $ExitC = DllCall('kernel32.dll','None','GetExitCodeProcess','hwnd',$Process,'ptr',0) DllCall('kernel32.dll','None','TerminateProcess','hwnd',$Process,'int',$ExitC) Edited June 15, 2006 by slightly_abnormal
nfwu Posted June 15, 2006 Posted June 15, 2006 (edited) just glancing through... quick question: If the function's return type is 'None', how can it return the variable $ExitC? #) edit: Spelling Edited June 15, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
slightly_abnormal Posted June 15, 2006 Author Posted June 15, 2006 (edited) well.. heres at msdn it said void i assume it means none, or would that be ptr ?? at answeres.com it says long .. $Process = 'notepad.exe' $ExitC = DllCall('kernel32.dll','Long','GetExitCodeProcess','hwnd',$Process,'ptr',0) DllCall('kernel32.dll','ptr','TerminateProcess','hwnd',$Process,'int',$ExitC) Edited June 15, 2006 by slightly_abnormal
Richard Robertson Posted June 15, 2006 Posted June 15, 2006 (edited) What? ProcessClose() does exactly what you are doing. What is the point of a second link? BOOL TerminateProcess( HANDLE hProcess, // handle to the process UINT uExitCode // exit code for the process ); becomes int TerminateProcess( void *hProcess, unsigned int uExitCode ); and BOOL GetExitCodeProcess( HANDLE hProcess, // handle to the process LPDWORD lpExitCode // termination status ); becomes int GetExitCodeProcess( void *hProcess, unsigned long *lpExitCode ); HANDLE is not HWND. HANDLE = void* and HWND = HWND__*. Edited June 15, 2006 by Icekirby1
nfwu Posted June 15, 2006 Posted June 15, 2006 He's just trying to learn how to use DLLCall... Reinventing the wheel is a good way. #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
slightly_abnormal Posted June 15, 2006 Author Posted June 15, 2006 (edited) [edit] $Process = 'notepad.exe' $Proc = DllCall('kernel32.dll','Long','GetCurrentProcess','str',$Process) $ExitC = DllCall('kernel32.dll','Long','GetExitCodeProcess','hwnd',$Proc,'ptr',0) DllCall('kernel32.dll','ptr','TerminateProcess','hwnd',$Process,'int',$ExitC) Edited June 15, 2006 by slightly_abnormal
slightly_abnormal Posted June 15, 2006 Author Posted June 15, 2006 (edited) okay heres another try .. why isn't there any processgethandle, processgetsate funcs btw?? do i need handle? [edit] btw in the helpfile Int and long both say a 32 bit integer for whatever reason.. o.o opt('wintitlematchmode',2) $Winhandle = WinGetHandle('Untitled - Notepad') $ProcH = DllCall('kernel32.dll','int','GetCurrentProcess','hwnd',$Winhandle) $ExitC = DllCall('kernel32.dll','int','GetExitCodeProcess','hwnd',$ProcH,'ptr',0) DllCall('kernel32.dll','ptr','TerminateProcess','hwnd',$Winhandle,'int',$ExitC) Edited June 15, 2006 by slightly_abnormal
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