S
sh01u
Гость
Здравствуйте, в autoit я не бум - бум, как получить lpDirectory в строковом виде, а не ptr?
Код:
Local $stINFO,$stVerb,$stPath,$stArgs,$stWDir,$aRet, $hWnd = 0, $iState = @SW_SHOWNORMAL
$stVerb = DllStructCreate("wchar[255]")
$stPath = DllStructCreate("wchar[" & (StringLen("notepad.exe")+1)& "]")
$stArgs = DllStructCreate("wchar[255)]")
$stWDir = DllStructCreate("wchar[255]")
DllStructSetData($stVerb, 1, "")
DllStructSetData($stPath, 1, "notepad.exe")
DllStructSetData($stWDir, 1, "")
DllStructSetData($stArgs, 1, "")
Local $stINFO = DllStructCreate("ulong;ulong;long;ptr;ptr;ptr;ptr;long;long;ptr;ptr;long;ulong;long;long")
DllStructSetData($stINFO, 1, DllStructGetSize($stINFO))
DllStructSetData($stINFO, 2, BitOR(0x40,0x400))
DllStructSetData($stINFO, 3, $hWnd) ; Is this supposed to *receive* instead of send? I have yet to get clarity on this.
DllStructSetData($stINFO, 4, DllStructGetPtr($stVerb)) ; lpVerb: pointer to the verb string
DllStructSetData($stINFO, 5, DllStructGetPtr($stPath)) ; lpFile: pointer to the $cmd string
DllStructSetData($stINFO, 6, DllStructGetPtr($stArgs)) ; lpParameters: pointer to the parameters/arguments string
DllStructSetData($stINFO, 7, DllStructGetPtr($stWDir)) ; lpDirectory: pointer to working directory string
DllStructSetData($stINFO, 8, $iState)
$aRet = DllCall("shell32.dll", "int", "ShellExecuteExW", "struct*", DllStructGetPtr($stINFO))
MsgBox(0,0,DllStructGetData($stINFO,7))