Jump to content

DllCall Kernel 32 need help


 Share

Recommended Posts

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?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...