Jump to content

First dll call


Recommended Posts

Dim $tBuff = DllStructCreate('wchar[' & StringLen('Text') & '];wchar[' & StringLen('String') & ']')
                             
 DllStructSetData($tBuff, 1, 'Text')
 DllStructSetData($tBuff, 2, 'String')

Dim $Ret = DllCall('user32.dll', 'ptr', 'CreateDesktopW', 'wstr', DllStructGetPtr($tBuff, 1), 'wstr', _
             DllStructGetPtr($tBuff, 2), 'uint', 1, 'uint', 1, 'ptr', 0)

The ANSI version is simpler, just use 'str' as the type and pass the string or it's pointer what ever you like.

Edit: Stupid mistake, remove the string concatenation operator '&' in the dll call. Use only the underscore instead.

Edited by Authenticity
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...