Jump to content

Recommended Posts

please show a script example.... please.... pretty please...



$STD_OUTPUT = -Dec("11")

$Yo = DLLOpen("C:\Windows\System\Kernel32.dll")
$hOutput = DLLCall($Yo,"LONG","GetStdHandle","LONG",$STD_OUTPUT)
DLLCall($Yo, "LONG","WriteConsole","LONG",$hOutput,"STRING","Hello","LONG",StringLen("Hello"),"","","","")
Edited by myredeemerlives
Link to post
Share on other sites

DLLCall($Yo, "LONG","WriteConsole","LONG",$hOutput,"STRING","Hello","LONG",StringLen("Hello"),"","","","")

i am sure the above is incorrect as it does not describe the last four pams... "","","","" cannot be correct.



I already tried using all the possible param types for the last 4 and 0 as the paramaters but it didn't work.

The function either fails, or it suceeds and causes and illegal operation.

I was doing this type of thing in VB6 just before so I know what Im doing with these functions it is just that I need AutoIt to be able to pass null paramaters.

Link to post
Share on other sites

I thought that GetStdHandle returns a long no?

What the.....?

Well, I will try it.


The functions didn't work at all, and I mean at all, when I changed the types.

AllocConsole returns a long, according to my WinAPI viewer.

When I used bool, it wouldn't even open a console window.

hmmm. This is weird.

Edit: The function refuses to work under any circumstances.

Edited by myredeemerlives
Link to post
Share on other sites
  • Administrators

From the Sticky post in the Dev forum:

Windows Datatype = DllCall Type

BOOL = "int"

COLORREF = "int"

DWORD = "int"

HANDLE = "ptr"

HDC = "ptr"

HFILE = "int"

HFONT = "ptr"

HICON = "ptr"


HKEY = "ptr"

HMENU = "ptr"

HMODILE = "ptr"

HWND = "hwnd"

INT = "int"

LONG = "long"

LPARAM = "long"

LPCTSTR = "str" ("wstr" if a UNICODE function)

LPINT = "int_ptr"

LPLONG = "long_ptr"

UINT = "int"

ULONG = "long"

WPARAM = "int"

HANDLE and BOOL are listed. Try that.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...