Jump to content
Sign in to follow this  
clearguy

DllCall Kernel 32 need help

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?

Share this post


Link to post
Share on other sites

If you follow through here, you should be able to get it easy enough:

http://www.autoitscript.com/forum/index.ph...st&p=288692


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  

×
×
  • Create New...