Skif_off
|
Posted: Sat Sep 30, 2017 01:19 Post subject: |
|
|
Gentoo69
В продолжение этой темы, что-то не так с работой с AutoIt, вне плагина скрипт работает нормально, с плагином - AutoIt жалуется на $aMediaInfo[0] и завершается.
Сделал с $CmdLine[1], чтобы проще было повесить на кнопку (проверять с любым видео-файлом), MediaInfo.dll нужно положить рядом или поправить путь в начале
Code: | #NoTrayIcon
Local $aMediaInfoGet, $content = '', $hDLL, $iHeight, $iWidth, $sRotation
Local $aMediaInfo
$hDLL = DllOpen(@ScriptDir & '\MediaInfo.dll')
$aMediaInfo = DllCall($hDLL, 'ptr', 'MediaInfo_New')
DllCall($hDLL, 'dword', 'MediaInfo_Open', 'ptr', $aMediaInfo[0], 'wstr', $CmdLine[1])
$aMediaInfoGet = DllCall($hDLL, 'wstr', 'MediaInfo_Get', 'ptr', $aMediaInfo[0], 'int', 1, 'int', 0, 'wstr', 'Rotation', 'int', 1, 'int', 0)
$sRotation = $aMediaInfoGet[0]
If ($sRotation = '0.000') Or ($sRotation = '') Then
$aMediaInfoGet = DllCall($hDLL, 'wstr', 'MediaInfo_Get', 'ptr', $aMediaInfo[0], 'int', 1, 'int', 0, 'wstr', 'Width', 'int', 1, 'int', 0)
$iWidth = $aMediaInfoGet[0]
$aMediaInfoGet = DllCall($hDLL, 'wstr', 'MediaInfo_Get', 'ptr', $aMediaInfo[0], 'int', 1, 'int', 0, 'wstr', 'Height', 'int', 1, 'int', 0)
$iHeight = $aMediaInfoGet[0]
If $iWidth < $iHeight Then $content = 'Achtung!'
Else
$content = 'Achtung!'
EndIf
DllCall($hDLL, 'none', 'MediaInfo_Close', 'ptr', $aMediaInfo[0])
DllClose($hDLL)
MsgBox(4096, '', $content) |
Для плагина сделал так
Code: | #NoTrayIcon
Local $aMediaInfoGet, $content = '', $hDLL, $iHeight, $iWidth, $sRotation
Local $aMediaInfo
$hDLL = DllOpen(@ScriptDir & '\MediaInfo.dll')
$aMediaInfo = DllCall($hDLL, 'ptr', 'MediaInfo_New')
DllCall($hDLL, 'dword', 'MediaInfo_Open', 'ptr', $aMediaInfo[0], 'wstr', $filename)
$aMediaInfoGet = DllCall($hDLL, 'wstr', 'MediaInfo_Get', 'ptr', $aMediaInfo[0], 'int', 1, 'int', 0, 'wstr', 'Rotation', 'int', 1, 'int', 0)
$sRotation = $aMediaInfoGet[0]
If ($sRotation = '0.000') Or ($sRotation = '') Then
$aMediaInfoGet = DllCall($hDLL, 'wstr', 'MediaInfo_Get', 'ptr', $aMediaInfo[0], 'int', 1, 'int', 0, 'wstr', 'Width', 'int', 1, 'int', 0)
$iWidth = $aMediaInfoGet[0]
$aMediaInfoGet = DllCall($hDLL, 'wstr', 'MediaInfo_Get', 'ptr', $aMediaInfo[0], 'int', 1, 'int', 0, 'wstr', 'Height', 'int', 1, 'int', 0)
$iHeight = $aMediaInfoGet[0]
If $iWidth < $iHeight Then $content = 'Achtung!'
Else
$content = 'Achtung!'
EndIf
DllCall($hDLL, 'none', 'MediaInfo_Close', 'ptr', $aMediaInfo[0])
DllClose($hDLL) |
в options.ini
Code: | ...
au3=%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\Scripts\AutoIt3.exe
...
[RotationAutoIt]
Script=MediaInfo.au3
content=Rotation
extensions=3gp|asf|avc|avi|d2v|dat|divx|flv|m4v|mkv|mov|mp4|mpe|mpeg|mpg|ts|vob|webm|wmv
FoldersPaths=0 |
всё остальное по умолчанию.
P.S. Проверяю с AutoIt 3.3.8.1 |
|