;-- TIME_STAMP 2021-11-26 17:22:14 v 0.1 #cs File: call.alternate.help.au3 compile as: call.alternate.help.exe Settings in your "alternate.help.properties": # Commands to for Help F1 command.help.$(au3)="FULL_PATH\call.alternate.help.exe" "FULL_PATH\alternate.help.lua" command.help.subsystem.$(au3)=2 #ce Global $g_SciTECmd GUIRegisterMsg(74, "MY_WM_COPYDATA") ; $WM_COPYDATA = 74 Global $sCmd, $au3, $param, $pos, $PID, $aWin, $hWnd, $last_hh = 0 If Not $CmdLine[0] Then ShellExecute(StringTrimRight(@AutoItExe, 11) & 'Autoit3Help.exe') Else $sCmd = _GetCmdLine($CmdLine[1]) If StringInStr($sCmd, '" "') Then $pos = StringInStr($sCmd, ' ', 0, -1) $au3 = StringLeft($sCmd, $pos -1) $param = StringTrimLeft($sCmd, $pos) ShellExecute($au3, $param) Else SendSciTE_Command("askproperty:hh.pid", 1) $last_hh = Number($g_SciTECmd) If ProcessExists($last_hh) Then ProcessClose($last_hh) $PID = ShellExecute(@WindowsDir & '\hh.exe', $sCmd) SendSciTE_Command("extender:dostring props['hh.pid'] = " & $PID) $aWin = WinList('[CLASS:HH Parent]') If $aWin[0][0] > 0 Then For $i = 1 To $aWin[0][0] If WinGetProcess($aWin[$i][0]) = $PID Then $hWnd = $aWin[$i][1] ExitLoop EndIf Next WinSetState($hWnd, '', @SW_MAXIMIZE) EndIf EndIf EndIf ; test results: ; "C:\Program Files (x86)\AutoIt3\Autoit3Help.exe" "ConsoleWrite" ; mk:@MSITStore:C:\CODE\AutoIt\helpfiles\OutlookEX.CHM::/funcs/_OL_ErrorNotify.htm ; mk:@MSITStore:C:\CODE\AutoIt\helpfiles\AD.chm::/funcs/_AD_DisableObject.htm Func _GetCmdLine($_sLuaFile) SendSciTE_Command("extender:dostring do dofile '" & StringReplace($_sLuaFile, '\', '/') & "' end", 1) SendSciTE_Command("askproperty:extender.result", 1) Return StringReplace($g_SciTECmd, '\\', '\') EndFunc ; by BugFix Func _GetHwndDirectorExtension() Local $hActive = WinGetHandle('[ACTIVE]') Local $PIDActive = WinGetProcess($hActive) Local $aExtension = WinList("DirectorExtension") Local $PIDExt For $i = 1 To $aExtension[0][0] $PIDExt = WinGetProcess($aExtension[$i][1]) If $PIDExt = $PIDActive Then Return $aExtension[$i][1] Next EndFunc ;==>_GetHwndDirectorExtension ; by Jos Func SendSciTE_Command($_sCmd, $Wait_For_Return_Info = 0) Local Static $My_Hwnd = GUICreate("AutoIt3-SciTE interface") ; Create GUI to receive SciTE info Local Static $My_Dec_Hwnd = Dec(StringTrimLeft($My_Hwnd, 2)) ; Convert my Gui Handle to decimal Local Const $SCI_GETLINE = 0x0869 ; 2153 Local Const $WM_COPYDATA = 0x004A ; 74 Local Const $WM_GETTEXT = 0x000D ; 13 Local Const $WM_GETTEXTLENGTH = 0xE224 ; 57892 ;~ Local $Scite_hwnd = WinGetHandle("DirectorExtension") ; Get SciTE DIrector Handle Local $Scite_hwnd = _GetHwndDirectorExtension() ; Get SciTE DIrector Handle $_sCmd = ":" & $My_Dec_Hwnd & ":" & $_sCmd ; Add dec my gui handle to commandline to tell SciTE where to send the return info Local $CmdStruct = DllStructCreate('CHAR[' & StringLen($_sCmd) + 1 & ']') DllStructSetData($CmdStruct, 1, $_sCmd) Local $COPYDATA = DllStructCreate('ULONG_PTR;DWORD;PTR') DllStructSetData($COPYDATA, 1, 1) DllStructSetData($COPYDATA, 2, StringLen($_sCmd) + 1) DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct)) $g_SciTECmd = "" DllCall('User32.dll', 'None', 'SendMessage', _ 'HWnd', $Scite_hwnd, _ 'Int', $WM_COPYDATA, _ 'HWnd', $My_Hwnd, _ 'Ptr', DllStructGetPtr($COPYDATA)) ;~ GUIDelete($My_Hwnd) If $Wait_For_Return_Info Then For $x = 1 To 10 If $g_SciTECmd <> "" Then ExitLoop Sleep(20) Next $g_SciTECmd = StringTrimLeft($g_SciTECmd, StringLen(":" & $My_Dec_Hwnd & ":")) $g_SciTECmd = StringReplace($g_SciTECmd, "macro:stringinfo:", "") Return $g_SciTECmd EndIf EndFunc ;==>SendSciTE_Command Func MY_WM_COPYDATA($hWnd, $msg, $wParam, $lParam) Local $COPYDATA = DllStructCreate('ULONG_PTR;DWORD;PTR', $lParam) Local $SciTECmdLen = DllStructGetData($COPYDATA, 2) Local $CmdStruct = DllStructCreate('CHAR[255]', DllStructGetData($COPYDATA, 3)) $g_SciTECmd = StringLeft(DllStructGetData($CmdStruct, 1), $SciTECmdLen) EndFunc ;==>MY_WM_COPYDATA