Sign in to follow this  
Followers 0
friends

DllCall() Questions & Doubts

4 posts in this topic

I know that DllCall() function is a very useful command available in AutoIT3.

However, until today I still don't understand the usage of this, as I haven't

touched on this feature yet.

Thus, I hope someone here is willing to explain in more details info about

this DllCall(). I have gone thru the HELPFILE, however, still have many

parts / points I don't get.

As what I get from the forums, these are some examples. Hope DllCall()

experts will explain this :

Example 1 : This waits for a left mouse click

While Not DllCall("user32.dll", "GetAsyncKeyState", "int", "int", 0x1)

Sleep(5)

Wend

MsgBox(4096,"","Click")

Example 2 :

DllCall("user32.dll", "SystemParametersInfo", "int", "int", 20, "int", 0, "str", "c:\windows\web\wallpaper\bliss.bmp", "int", 1)

Remark : Examples taken from Larry's posts, may be out-dated example in

terms of the DllCall() syntax

Q1: How would I know which .dll file to be used ?

Q2: Is it only Window's .dll files can be called ?

Q3: When to use "user32.dll", "kernel32.dll" or other .dll files ? How can

I which .dll files to be used ?

Q4: "GetAsyncKeyState", "SystemParametersInfo", all these are not included

in HELPFILE, where can I obtain it ? And, when to use it ?

Q5: How I know the "return type" is "ptr", "hwnd", "int" and etc. ??

Sorry for one shot asking so many questions, as I'm a noob abou this DllCall().

I really want to learn this DllCall() as I think it would be very useful for me.

I hope somehow from here, I start learning the usage of it.

Really big thanks for all of you.

Share this post


Link to post
Share on other sites



Q1: How would I know which .dll file to be used ?

Every .dll have its own commands. You have to use the one have what you need. Check: http://www.allapi.net

Q2: Is it only Window's .dll files can be called ?

No.

Q3: When to use "user32.dll", "kernel32.dll" or other .dll files ? How can

I which .dll files to be used ?

See Q1.

Q4: "GetAsyncKeyState", "SystemParametersInfo", all these are not included

in HELPFILE, where can I obtain it ? And, when to use it ?

Of course those dll are not part of autoit so they can not be found in its helpfile.

Q5: How I know the "return type" is "ptr", "hwnd", "int" and etc. ??

It depends of what the calls do. E.g. if it returns a filename will be a string, if it returns a value it will be a int and so go on.

Share this post


Link to post
Share on other sites

Thanks ezzetabi....

ok... let's focus only on the Windows' .dll files. Where can I obtain

information on which "return type" to be used ? Is there any website ?

Is it MSDN ? and which part of the MSDN ?

Million thanks....

Q1: How would I know which .dll file to be used ?

Every .dll have its own commands. You have to use the one have what you need. Check: http://www.allapi.net

Q2: Is it only Window's .dll files can be called ?

No.

Q3: When to use "user32.dll", "kernel32.dll" or other .dll files ? How can

I which .dll files to be used ?

See Q1.

Q4: "GetAsyncKeyState", "SystemParametersInfo", all these are not included

in HELPFILE, where can I obtain it ? And, when to use it ?

Of course those dll are not part of autoit so they can not be found in its helpfile.

Q5: How I know the "return type" is "ptr", "hwnd", "int" and etc. ??

It depends of what the calls do. E.g. if it returns a filename will be a string, if it returns a value it will be a int and so go on.

<{POST_SNAPBACK}>

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