_SciTE_ErrorFix()
; Создаём ошибку
Global Const $SWP_SHOWWINDOW = 0x0040
#include <AutoItConstants.au3>
Func _SciTE_ErrorFix()
If @Compiled Then
Return
EndIf
Local $sScript = _
'#NoTrayIcon' & @CRLF & _
'While ProcessExists(' & @AutoItPID & ')' & @CRLF & _
' Sleep(10)' & @CRLF & _
'WEnd' & @CRLF & _
'$iTimer = TimerInit()' & @CRLF & _
'Do' & @CRLF & _
' $sText = ControlGetText("[CLASS:SciTEWindow]", "", "[CLASS:Scintilla; INSTANCE:2]")' & @CRLF & _
' If TimerDiff($iTimer) > 2000 Then Exit' & @CRLF & _
'Until StringRegExp($sText, """.*?"" ?\(\d+\) : ==>")' & @CRLF & _
'$sCmd = "extender:dostring scite.MenuCommand(IDM_CLEAROUTPUT)"' & @CRLF & _
'$stCmd = DllStructCreate("char[" & StringLen($sCmd) + 1 & "]")' & @CRLF & _
'DllStructSetData($stCmd, 1, $sCmd)' & @CRLF & _
'$stCOPYDATA = DllStructCreate("ptr;dword;ptr")' & @CRLF & _
'DllStructSetData($stCOPYDATA, 2, StringLen($sCmd) + 1)' & @CRLF & _
'DllStructSetData($stCOPYDATA, 3, DllStructGetPtr($stCmd))' & @CRLF & _
'DllCall("User32.dll", "None", "SendMessage", "HWnd", WinGetHandle("[CLASS:DirectorExtension;TITLE:DirectorExtension]"), "Int", 74, "HWnd", 0, "Ptr", DllStructGetPtr($stCOPYDATA))' & @CRLF & _
'$sText = StringRegExpReplace($sText, """(.*?)""( \(\d+\) : ==>)", "\1\2")' & @CRLF & _
'$sText = "output:" & StringRegExpReplace(StringReplace(StringReplace($sText, "\", "\\"), @TAB, "\t"), "[\r\n]+", "\\r\\n")' & @CRLF & _
'$stCmd = DllStructCreate("char[" & StringLen($sText) + 1 & "]")' & @CRLF & _
'DllStructSetData($stCmd, 1, $sText)' & @CRLF & _
'$stCOPYDATA = DllStructCreate("ptr;dword;ptr")' & @CRLF & _
'DllStructSetData($stCOPYDATA, 2, StringLen($sText) + 1)' & @CRLF & _
'DllStructSetData($stCOPYDATA, 3, DllStructGetPtr($stCmd))' & @CRLF & _
'DllCall("User32.dll", "None", "SendMessage", "HWnd", WinGetHandle("[CLASS:DirectorExtension;TITLE:DirectorExtension]"), "Int", 74, "HWnd", 0, "Ptr", DllStructGetPtr($stCOPYDATA))'
Local $sTmp = @TempDir & '\SciTE_ErrorFix.tmp'
Local $hFile = FileOpen($sTmp, 2)
FileWrite($hFile, $sScript)
FileClose($hFile)
Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & $sTmp & '"')
Sleep(200)
FileDelete($sTmp)
EndFunc