Hollowyearz

ThrowStringtoSciTE

Dec 11th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.34 KB | None | 0 0
  1. ;  http://www.autoitscript.com/forum/topic/154967-simple-example-of-output-to-scite-from-tool/?hl=%2Bscite#entry1135448
  2.  
  3. #include <Constants.au3>
  4. #include <GUIConstantsEx.au3>
  5. #include <WinAPI.au3>
  6. #include <WindowsConstants.au3>
  7. $sString = "teeeessssstttt"
  8. _SciTE_InsertText($sString)
  9. Func _SciTE_InsertText($sString)
  10.     Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), "insert:" & $sString)
  11. EndFunc   ;==>_SciTE_InsertText
  12. Func _SciTE_Send_Command($hHandle, $hSciTE, $sString)
  13.     Local $ilParam, $tData
  14.     If StringStripWS($sString, 8) = "" Then
  15.         Return SetError(2, 0, 0) ; String is blank.
  16.     EndIf
  17.     $sString = ":" & Dec(StringTrimLeft($hHandle, 2)) & ":" & $sString
  18.     ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sString = ' & $sString & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
  19.     $tData = DllStructCreate("char[" & StringLen($sString) + 1 & "]") ; wchar
  20.     DllStructSetData($tData, 1, $sString)
  21.     $ilParam = DllStructCreate("ptr;dword;ptr") ; ulong_ptr;dword;ptr
  22.     DllStructSetData($ilParam, 1, 1) ; $ilParam, 1, 1
  23.     DllStructSetData($ilParam, 2, DllStructGetSize($tData))
  24.     DllStructSetData($ilParam, 3, DllStructGetPtr($tData))
  25.     _SendMessage($hSciTE, $WM_COPYDATA, $hHandle, DllStructGetPtr($ilParam))
  26.     Return Number(Not @error)
  27. EndFunc   ;==>_SciTE_Send_Command
Advertisement
Add Comment
Please, Sign In to add comment