0

Hey guys,

i found this awesome example on the internet written using autoit 3 script, i was wondering how this would translate in c++ so i can use this for one of my projects, any ideas would be awesome, thanks once again...

$sUserName = "username"
$sPicPath = "usertile.png"

; call CoInitialize
DLLCall("ole32.dll","int","CoInitialize","ptr",0)

$hPicPath = DLLStructCreate("wchar[128]")
DllStructSetData($hPicPath, 1, $sPicPath)

$hUserName = DLLStructCreate("wchar[128]")
DllStructSetData($hUserName, 1, $sUserName)

$aRet = DllCall(@SystemDir & "\shell32.dll", "long", 262, "ptr", DllStructGetPtr($hUserName), "int", 0, "ptr", DllStructGetPtr($hPicPath))

MsgBox(4096, "SetUserTile", $aRet[0])

Best Wishes,
Nathaniel Blackburn

Edited by nblackburn: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by raptr_dflo
0

Since the functions and objects defined in .dlls can be used directly in a C++ program simply by linking against them, e.g. g++ myobj.o -o myprog -lole32 (or just adding the OLE library to your VS project), the notation in C++ should be much simpler. I have no actual experience doing this, I'm afraid, but found a sample C/C++ snippet here: http://www.relisoft.com/win32/olerant.html -- hope that gets you going!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.