Jump to content
Sign in to follow this  
clearguy

DllCall Kernel 32 need help

Recommended Posts

clearguy

Hi all,

it's the first time I try to call a dll.I want to use GetProcessTimes function from Kernel32.dll.

So far I understand I got this:

#include <Array.au3>
$hProcess = WinGetHandle("PeerGuardian 2")
$lpCreationTime=DllStructCreate ( "dword;dword" )
$lpExitTime=DllStructCreate ( "dword;dword" )
$lpKernelTime=DllStructCreate ( "dword;dword" )
$lpUserTime =DllStructCreate ( "dword;dword" )
$result = DllCall("Kernel32.dll", "none", "GetProcessTimes", "hwnd", $hProcess, "ptr", DllStructGetPtr ($lpCreationTime), "ptr", DllStructGetPtr ($lpExitTime) , "ptr",DllStructGetPtr ($lpKernelTime),"ptr",DllStructGetPtr ($lpUserTime)  )
;                                                          hProcess
if Not $result[0] Then
    MsgBox(0,"DllCall Error","DllCall Failed : "&$hProcess)
    exit
EndIf
MsgBox(0,'DllCall',DllStructGetData($lpKernelTime,2))
;~ _ArrayDisplay($result,1)

But I get always an error.

Some helpful guy in here?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.