Astormooke Posted February 20, 2009 Share Posted February 20, 2009 Hi I have never made a dll call... and I would like to start with this dll I was hoping someone could help me out of this predicament... User32.dll CreateDesktopW (Unicode) and CreateDesktopA (ANSI) the autoit help doesnt make sense to me... Link to comment Share on other sites More sharing options...
Authenticity Posted February 20, 2009 Share Posted February 20, 2009 (edited) 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 February 20, 2009 by Authenticity Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now