Sign in to follow this  
Followers 0
geofromalimos

Dllcall issues...

4 posts in this topic

Good morning devs. This is my first time trying to deal with DLLs and I've found some threads on this subject.

Here is the documentation for a dll function:

GetApiVersion()

Function Prototype

WORD GetApiVersion( LPWORD Version );

Parameter Description

Version Returns version of API.

Return Values

RESULT_SUCCESSFUL 0

Successfully returned version.

Functional Description

Returns the API version

I try with the below autoit code:

Local $version
$out = DllCall("core.dll","dword","GetApiVersion","dword",$version)
consolewrite("Version of the API is : "& $out)

I always get 0 as output but i can't get the Version! Any help is really appreciated.

Share this post


Link to post
Share on other sites



i cant found the documentation :S if you have the http link please post it

Share this post


Link to post
Share on other sites

1. Not sure where you got "dword" for either of those.

2. DllCall returns an array.


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

#4 ·  Posted (edited)

MessageBox Result. Return Array[0],[1],[2],[3] and [4]. Quesion - Answer. Yes, No, Ok, Cancel and other.

If use array 0 Return ID Button

If use array 1 Return Hex code

If use array 2 Return Text

If use array 3 Return Title

If use array 4 Return Flag

$sTitle = 'MsgBox Result Sample'
$sText = 'Do you wanted test click button?'
$Msg_Yes = 'You clicked..Yes'
$Msg_NO = 'You clicked..No'
While 1
$btn = DllCall("user32.dll", "int", "MessageBox", "hwnd", 0, "str", $sText, "str", $sTitle, "int", 36) ;36 is flag
Select
    Case $btn[0] = 6 ;id button..yes
        MsgBox(64, "", $Msg_Yes)
    Case $btn[0] = 7 ;id button..no
        MsgBox(64, "", $Msg_No)
        ExitLoop
EndSelect
WEnd
Edited by newsak2005

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  
Followers 0