Jump to content
Sign in to follow this  

SciTE Extension Question

Recommended Posts

I am looking to write a wrapper for a piece of software that I want to be able to build functionality into the SciTE enditor. What I would ultimately like to do is add a tab to the compile dialog window like the CVSwrapper extension does.

How can I add this tab to the editor?

Share this post

Link to post
Share on other sites

Ok then. How about the ability to call a LUA function with your script. For instance, this is how I call it with the "Tools" menu command interface:

# 45 RobDBG Console Only
command.45.$(au3)=InvokeTool RobAutoItTools.RobDebugConsoleWriteAdd
command.name.45.$(au3)=RobDBG - Display to Console Only

basically, i want the ability to completely extend the 'Alt+D' functionality for my own purposes, but I can seem to figure that out without using the "Tools" menu, which isn't as efficient as I would like to. Any Ideas?

Edited by scardlife

Share this post

Link to post
Share on other sites

Not totally sure what you want to accomplish but you could start the described LUA script by executing the defined command.45:

Opt("WinSearchChildren", 1)
Global $WM_COPYDATA = 74
; Get SciTE DirectorHandle
$Scite_hwnd = WinGetHandle("DirectorExtension")
; Get My GUI Handle
Global $My_Hwnd = GUICreate("AutoIt3-SciTE interface")
;Register COPYDATA message.
;~ SendSciTE_Command($My_Hwnd, $Scite_hwnd, "askproperty:buffers")  ; request value
;~ SendSciTE_Command($My_Hwnd, $Scite_hwnd, "askfilename:")      ; request current buffers filename
SendSciTE_Command($My_Hwnd, $Scite_hwnd, "menucommand:1145")     ; Runs command.45
; Send command to SciTE
Func SendSciTE_Command($My_Hwnd, $Scite_hwnd, $sCmd)
Local $My_Dec_Hwnd = Dec(StringRight($My_Hwnd, 8))
$sCmd = ":" & $My_Dec_Hwnd & ":" & $sCmd
ConsoleWrite('-->' & $sCmd & @LF)
Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
DllStructSetData($CmdStruct, 1, $sCmd)
Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr')
DllStructSetData($COPYDATA, 1, 1)
DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1)
DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct))
DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $Scite_hwnd, _
   'Int', $WM_COPYDATA, 'HWnd', $My_Hwnd, _
   'Ptr', DllStructGetPtr($COPYDATA))
EndFunc   ;==>SendSciTE_Command
; Received Data from SciTE
Func MY_WM_COPYDATA($hWnd, $msg, $wParam, $lParam)
Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr', $lParam)
$SciTECmdLen = DllStructGetData($COPYDATA, 2)
Local $CmdStruct = DllStructCreate('Char[' & $SciTECmdLen + 1 & ']', DllStructGetData($COPYDATA, 3))
$SciTECmd = StringLeft(DllStructGetData($CmdStruct, 1), $SciTECmdLen)
ConsoleWrite('<--' & $SciTECmd & @LF)
EndFunc   ;==>MY_WM_COPYDATA

Hope that helps


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...