Leaderboard
Popular Content
Showing content with the highest reputation on 08/05/2016 in all areas
-
MySQL UDFs using libmysql.dll functions: most functions from MySQL API all are prefixed with an underscore: _MySql... e.g.: _MySQL_Real_Query( sometimes parameters are chaged - read function descriptions in include file MySQL.au3 If you do not need the power of these UDFs and you simple want to use basic SQL commands, then have a look at not included: MySQL_Connect - This function is deprecated. Use _MySQL_Real_Connect instead. MySQL_Create_DB - This function is deprecated. Use mysql_query() to issue an SQL CREATE DATABASE statement instead. MySQL_Drop_DB - This function is deprecated. Use mysql_query() to issue an SQL DROP DATABASE statement instead. MySQL_Escape_String - You should use _mysql_real_escape_string() instead! MySQL_Kill - This function is deprecated. Use mysql_real_query() to issue an SQL KILL statement instead mysql_library_end - Called by _MySQL_EndLibrary. mysql_library_init - Called by _MySQL_InitLibrary. I included a fallback-libmysql.dll: yoou can include libMySQLDLL.au3 and set $Use_EmbeddedDLL=True when calling _MySQL_InitLibrary an example for XAMPP / cdcol is also included in ZIP. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.8.1 (beta) Author: Prog@ndy Script Function: MySQL-Plugin Demo Script #ce ---------------------------------------------------------------------------- #include <array.au3> #include "mysql.au3" ; MYSQL starten, DLL im PATH (enthält auch @ScriptDir), sont Pfad zur DLL angeben. DLL muss libmysql.dll heißen. _MySQL_InitLibrary() If @error Then Exit MsgBox(0, '', "could nit init MySQL") MsgBox(0, "DLL Version:",_MySQL_Get_Client_Version()&@CRLF& _MySQL_Get_Client_Info()) $MysqlConn = _MySQL_Init() ;Fehler Demo: MsgBox(0,"Error-demo","Error-Demo") $connected = _MySQL_Real_Connect($MysqlConn,"localhostdfdf","droot","","cdcol") If $connected = 0 Then $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"Error:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST) Endif ; XAMPP cdcol MsgBox(0, "XAMPP-Cdcol-demo", "XAMPP-Cdcol-demo") $connected = _MySQL_Real_Connect($MysqlConn, "localhost", "root", "", "cdcol") If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn)) $query = "SELECT * FROM cds" $mysql_bool = _MySQL_Real_Query($MysqlConn, $query) If $mysql_bool = $MYSQL_SUCCESS Then MsgBox(0, '', "Query OK") Else $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) EndIf $res = _MySQL_Store_Result($MysqlConn) $fields = _MySQL_Num_Fields($res) $rows = _MySQL_Num_Rows($res) MsgBox(0, "", $rows & "-" & $fields) ; Access2 1 MsgBox(0, '', "Access method 1- manual") Dim $array[$rows][$fields] For $k = 1 To $rows $mysqlrow = _MySQL_Fetch_Row($res,$fields) $lenthsStruct = _MySQL_Fetch_Lengths($res) For $i = 1 To $fields $length = DllStructGetData($lenthsStruct, 1, $i) $fieldPtr = DllStructGetData($mysqlrow, 1, $i) $data = DllStructGetData(DllStructCreate("char[" & $length & "]", $fieldPtr), 1) $array[$k - 1][$i - 1] = $data Next Next _ArrayDisplay($array) ; Access 2 MsgBox(0, '', "Access method 2 - row for row") _MySQL_Data_Seek($res, 0) ; just reset the pointer to the beginning of the result set Do $row1 = _MySQL_Fetch_Row_StringArray($res) If @error Then ExitLoop _ArrayDisplay($row1) Until @error ; Access 3 MsgBox(0, '', "Access method 3 - read whole result in 2D-Array") $array = _MySQL_Fetch_Result_StringArray($res) _ArrayDisplay($array) ; fieldinfomation MsgBox(0, '', "Access fieldinformation") Dim $arFields[$fields][3] For $i = 0 To $fields - 1 $field = _MySQL_Fetch_Field_Direct($res, $i) $arFields[$i][0] = _MySQL_Field_ReadValue($field, "name") $arFields[$i][1] = _MySQL_Field_ReadValue($field, "table") $arFields[$i][2] = _MySQL_Field_ReadValue($field, "db") Next _ArrayDisplay($arFields) ; free result _MySQL_Free_Result($res) ; Close connection _MySQL_Close($MysqlConn) ; exit MYSQL _MySQL_EndLibrary() MySQL UDf Downloads: (including x86 and x64)</array.au3>1 point
-
Wait Until Desktop is load
argumentum reacted to kosamja for a topic
maybe WinWaitActive('[CLASS:Shell_TrayWnd]', '')?1 point -
this works run("powershell start shell:AppsFolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge http://www.autoitscript.com" , "" , @SW_HIDE)1 point
-
Update (see first post) and try this: #include "OOoCalc.au3" #include <Date.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> _OOoCalc_ComErrorHandler_UserFunction(_ErrFunc) $Form1_1 = GUICreate("Notary Client Verification Form", 667, 273, 192, 132) $Date1 = GUICtrlCreateDate(_DateToDayValue, 72, 40, 257, 25, $WS_TABSTOP) $Button1 = GUICtrlCreateButton("OK", 8, 206, 649, 57) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $TheDate = GUICtrlRead($Date1) MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, "Date", $TheDate) $sFileName = @MyDocumentsDir & "\new.ods" If FileExists($sFileName) Then FileDelete($sFileName) $OOspreadsheet = _OOoCalc_BookNew() Sleep(1000) _OOoCalc_WriteCell($OOspreadsheet, $TheDate, "A1") _OOoCalc_NumberFormat($OOspreadsheet, 36, "A1") _OOoCalc_BookSaveAs($OOspreadsheet, $sFileName) _OOoCalc_BookClose($OOspreadsheet) $OOspreadsheet = _OOoCalc_BookOpen($sFileName) EndSwitch WEnd ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc1 point
-
Ah, that would do it. Thanks @Danyfirex and thanks @Xandy for the attempts. As a side note, it turns out that you cannot manually run Edge by trying to run the .exe via Windows Explorer, they don't allow it. Weird. You have to create a shortcut linking to it to be able to execute it in any fashion other than the Taskbar/Start Menu. %windir%\explorer.exe shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge Funky!1 point
-
Hello. Should be like... ShellExecute("microsoft-edge:https://google.com") Saludos1 point
-
Probably you want this. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;~ typedef struct WTA_OPTIONS { ;~ DWORD dwFlags; ;~ DWORD dwMask; ;~ } WTA_OPTIONS, *PWTA_OPTIONS; Global Const $WTNCA_NODRAWICON = 0x00000002 Global Const $WTNCA_NOSYSMENU = 0x00000004 Global Const $sTagWTA_OPTIONS = "dword dwFlags;dword dwMask;" #Region ### START Koda GUI section ### Form= Global $hGUI = GUICreate("GUI without Icon!!!", 316, 233, 192, 124) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $tWTA_OPTIONS = DllStructCreate($sTagWTA_OPTIONS) DllStructSetData($tWTA_OPTIONS, "dwFlags", BitOR($WTNCA_NODRAWICON, $WTNCA_NOSYSMENU)) DllStructSetData($tWTA_OPTIONS, "dwMask", BitOR($WTNCA_NODRAWICON, $WTNCA_NOSYSMENU)) DllCall("UxTheme.dll", "LONG", "SetWindowThemeAttribute", "HWND", $hGUI, "INT", 1, "ptr", DllStructGetPtr($tWTA_OPTIONS), "dword", DllStructGetSize($tWTA_OPTIONS)) ConsoleWrite(@error & @CRLF) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Saludos1 point
-
Dont work StdoutRead with Putty.exe
JustSomeone reacted to Jos for a topic
You are not having the correct parameter for port: change the " p " to " -P ". $iPID = Run(@ComSpec & " /C " & $puty_exe & " " & $host & " -ssh -l " & $user & " -pw " & $password & " -P " & $port , @ScriptDir,@SW_MAXIMIZE, $STDERR_CHILD + $STDOUT_CHILD + $STDIN_CHILD ) Jos1 point -
The zip contains the color constants as defined in .NET Framework. The colors matches the X11-colors. See bottom of link. NamedColors.7z1 point
-
SciLexer UDF
wuuyi123 reacted to IchBistTod for a topic
not working, this is how it ends up while 1 WEnd this is my code $DefaultText = "" $Sci = Sci_CreateEditorAu3($Form1,193, 88, 565, 377) Sci_AddLines($Sci, $DefaultText,0) Sci_AddLines($Sci, $DefaultText,2) Sci_SetAnchor($Sci,25) Sci_FoldingHideLines($Sci, 25, 35) Sci_FoldingShowLines($Sci, 25, 35) (btw it doesnt collapse) and here is code i got from another user in this thread to make an AU3 lexer with yoru newest version using def and api files #include-once #include <WindowsConstants.au3> #include <Constants.au3> #include <WinAPI.au3> #include <_SCILexer.au3> Global Const $tagCharacterRange = "long cpMin; long cpMax" Global Const $tagRangeToFormat = _ "hwnd hdc;" & _ ; // The HDC (device context) we print to "hwnd hdcTarget;" & _ ; // The HDC we use for measuring (may be same as hdc) "int rc[4];" & _ ; // Rectangle in which to print "int rcPage[4];" & _ ; // Physically printable page size "long chrg[2]" ; //CharacterRange: Range of characters to print Global Const $tagSCNotification = "hwnd hWndFrom;int IDFrom;int Code;" & _ "int position;" & _ ; // SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK "int ch;" & _ ;// SCN_CHARADDED, SCN_KEY "int modifiers;" & _ ;// SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK "int modificationType;" & _ ;// SCN_MODIFIED "ptr text;" & _ ;const char *text ;// SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION "int length;" & _ ;// SCN_MODIFIED "int linesAdded;" & _ ;// SCN_MODIFIED "int message;" & _ ;// SCN_MACRORECORD "dword wParam;" & _ ;// SCN_MACRORECORD "dword lParam;" & _ ;// SCN_MACRORECORD "int line;" & _ ;// SCN_MODIFIED, SCN_DOUBLECLICK "int foldLevelNow;" & _ ;// SCN_MODIFIED "int foldLevelPrev;" & _ ;// SCN_MODIFIED "int margin;" & _ ;// SCN_MARGINCLICK "int listType;" & _ ;// SCN_USERLISTSELECTION, SCN_AUTOCSELECTION "int x;" & _ ;// SCN_DWELLSTART, SCN_DWELLEND "int y;" ;// SCN_DWELLSTART, SCN_DWELLEND ;~ }; Global Const $SCI_DEFAULTKEYWORDDIR = @ScriptDir & "\Au3Defs\" ;"C:\Programme\AutoIt3\SciTE\Properties\" Global Const $SCI_DEFAULTCALLTIPDIR = @ScriptDir & "\Au3Defs\" ;"C:\Programme\AutoIt3\SciTE\api\" Global Const $SCI_DEFAULTABBREVDIR = @ScriptDir & "\Au3Defs\" ;@UserProfileDir Global $SCI_hlStart, $SCI_hlEnd, $SCI_sCallTip, $SCI_sCallTipFoundIndices, $SCI_sCallTipSelectedIndice, $SCI_sCallTipPos Global $SCI_sCallTip_Array[1], $SCI_AUTOCLIST[1], $SCI_ABBREVFILE Func SCI_CreateEditorAu3($hWnd, $X, $Y, $W, $H, $CalltipPath = $SCI_DEFAULTCALLTIPDIR, $KeyWordDir = $SCI_DEFAULTKEYWORDDIR, $AbbrevDir = $SCI_DEFAULTABBREVDIR, $RegisterWM_NOTIFY = True) ; The return value is the hwnd of the window, and can be used for Win.. functions Local $Sci = SCI_CreateEditor($hWnd, $X, $Y, $W, $H) If @error Then Return SetError(1, 0, 0) EndIf SCI_InitEditorAu3($Sci, $CalltipPath, $KeyWordDir, $AbbrevDir) If @error Then Return SetError(2, 0, 0) Else If $RegisterWM_NOTIFY = True Then GUIRegisterMsg(0x4E, "SCI_AU3_WM_NOTIFY") Return $Sci EndIf EndFunc ;==>SCI_CreateEditorAu3 ; Prog@ndy Func SCI_SetText($Sci,$Text) Return SendMessageString($Sci,$SCI_SETTEXT,0,$Text) EndFunc ; Prog@ndy Func SCI_GetTextLen($Sci) Local $iLen = SendMessage($Sci, $SCI_GETTEXT, 0, 0) If @error Then Return SetError(1, 0, 0) Return $iLen EndFunc ;==>SCI_GetTextLen #cs ; changed form SCI_GetLines Func SCI_GetText($Sci) Local $ret, $sText, $iLen, $sBuf $iLen = SendMessage($Sci, $SCI_GETTEXT, 0, 0) If @error Then Return SetError(1,0,"") EndIf $sBuf = DllStructCreate("byte[" & $iLen & "]") If @error Then Return SetError(2,0,"") EndIf $ret = DllCall($user32, "long", "SendMessageA", "long", $Sci, "int", $SCI_GETTEXT, "int", $iLen, "ptr", DllStructGetPtr($sBuf)) If @error Then Return SetError(3,0,"") EndIf $sText = BinaryToString(DllStructGetData($sBuf, 1)) $sBuf = 0 If @error Then Return SetError(4,0,"") Else Return $sText EndIf EndFunc #ce ; Author: Prog@ndy Func SCI_GetTextRange($Sci, $start, $end) If $start > $end Then Return SetError(1, 0, "") Local $textRange = DllStructCreate($tagCharacterRange & "; ptr TextPtr; char Text[" & $end - $start + 1 & "]") DllStructSetData($textRange, 1, $start) DllStructSetData($textRange, 2, $end) DllStructSetData($textRange, 3, DllStructGetPtr($textRange, 4)) SendMessage($Sci, $SCI_GETTEXTRANGE, 0, DllStructGetPtr($textRange)) Return DllStructGetData($textRange, "Text") EndFunc ;==>SCI_GETTEXTRANGE ; Changed by Prog@ndy Func SCI_GetCurrentWordEx($Sci, $onlyWordCharacters = 1, $CHARADDED = 0) Local $CurrentPos = SCI_GetCurrentPos($Sci) $CurrentPos -= ($CHARADDED = True) Return SCI_GetWordFromPos($Sci, $CurrentPos, $onlyWordCharacters) EndFunc ;==>SCI_GetCurrentWordEx ; Author: Prog@ndy Func SCI_GetWordPositions($Sci, $CurrentPos, $onlyWordCharacters = 1) Local $Return[2] = [-1, -1] $Return[0] = SendMessage($Sci, $SCI_WORDSTARTPOSITION, $CurrentPos, $onlyWordCharacters) $Return[1] = SendMessage($Sci, $SCI_WORDENDPOSITION, $CurrentPos, $onlyWordCharacters) Return $Return EndFunc ;==>SCI_GetWordPositions ; Author: Prog@ndy Func SCI_GetWordFromPos($Sci, $CurrentPos, $onlyWordCharacters = 1) ;~ Local $Return, $i, $Get, $char ;~ Local $CurrentPos = SCI_GetCurrentPos($Sci) ;~ $CurrentPos -= ($CHARADDED = True) Local $start = SendMessage($Sci, $SCI_WORDSTARTPOSITION, $CurrentPos, $onlyWordCharacters) Local $end = SendMessage($Sci, $SCI_WORDENDPOSITION, $CurrentPos, $onlyWordCharacters) Return SCI_GETTEXTRANGE($Sci, $start, $end) EndFunc ;==>SCI_GetWordFromPos ;modified by Prog@ndy Func SCI_InitEditorAu3($Sci, $CalltipPath = $SCI_DEFAULTCALLTIPDIR, $KeyWordDir = $SCI_DEFAULTKEYWORDDIR, $AbbrevDir = $SCI_DEFAULTABBREVDIR) If $CalltipPath = "" Or $CalltipPath = Default Or IsNumber($CalltipPath) Then $CalltipPath = $SCI_DEFAULTCALLTIPDIR If $KeyWordDir = "" Or $KeyWordDir = Default Or IsNumber($KeyWordDir) Then $KeyWordDir = $SCI_DEFAULTKEYWORDDIR If $AbbrevDir = "" Or $AbbrevDir = Default Or IsNumber($AbbrevDir) Then $AbbrevDir = $SCI_DEFAULTABBREVDIR SendMessage($Sci, $SCI_SETLEXER, $SCLEX_AU3, 0) Local $bits = SendMessage($Sci, $SCI_GETSTYLEBITSNEEDED, 0, 0) SendMessage($Sci, $SCI_SETSTYLEBITS, $bits, 0) SendMessage($Sci, $SCI_SETTABWIDTH, 4, 0) SendMessage($Sci, $SCI_SETINDENTATIONGUIDES, True, 0) ;~ SendMessage($Sci, $SCI_SETZOOM, IniRead(@ScriptDir & "\config.ini", "Settings", "Zoom", -1), 0) Global $SCI_sCallTip_Array = FileRead($CalltipPath & "\au3.api") Local $ExtraAPIs = FileFindFirstFile($CalltipPath & "\au3.*.api") Local $file While 1 $file = FileFindNextFile($ExtraAPIs) If StringRight($SCI_sCallTip_Array, 2) <> @CRLF Then $SCI_sCallTip_Array &= @CRLF $SCI_sCallTip_Array &= FileRead($CalltipPath & $file) If @error Then ExitLoop WEnd If StringRight($SCI_sCallTip_Array, 2) = @CRLF Then StringTrimRight($SCI_sCallTip_Array, 2) FileClose($ExtraAPIs) $SCI_sCallTip_Array = StringSplit($SCI_sCallTip_Array, @CRLF, 1) Global $SCI_AUTOCLIST[UBound($SCI_sCallTip_Array)] = [UBound($SCI_sCallTip_Array) - 1] Local $temp For $i = 1 To $SCI_AUTOCLIST[0] $temp = StringRegExp($SCI_sCallTip_Array[$i], "\A([#@]?\w+)", 1) If Not @error Then $SCI_AUTOCLIST[$i] = $temp[0] Next ArraySortUnique($SCI_AUTOCLIST, 0, 1) Global $SCI_ABBREVFILE = FileRead($AbbrevDir & "\abbrev.properties") Local $SciteKeyWord = FileRead($KeyWordDir & "\au3.keywords.properties") Local $tempText If StringLen($SciteKeyWord) Then $SciteKeyWord = StringRegExpReplace($SciteKeyWord, "(\w)(\r\n)", "$1 $2") $SciteKeyWord = StringSplit($SciteKeyWord, " " & @CRLF, 1) Local $PART ;~ $SCI_AUTOCLIST = "" For $i = 0 To UBound($SciteKeyWord) - 1 $PART = StringLeft($SciteKeyWord[$i], 26) Select Case StringInStr($PART, "au3.keywords.functions=", 0, 1, 1) $tempText = StringReplace(StringTrimLeft($SciteKeyWord[$i], StringLen("au3.keywords.functions=")), "\" & @CRLF, @CRLF) SendMessageString($Sci, $SCI_SETKEYWORDS, 1, $tempText) ConsoleWrite("1" & @CRLF) Case StringInStr($PART, "au3.keywords.udfs=", 0, 1, 1) $tempText = StringReplace(StringTrimLeft($SciteKeyWord[$i], StringLen("au3.keywords.udfs=")), "\" & @CRLF, @CRLF) SendMessageString($Sci, $SCI_SETKEYWORDS, 7, $tempText) ConsoleWrite("2" & @CRLF) Case StringInStr($PART, "au3.keywords.keywords=", 0, 1, 1) $tempText = StringReplace(StringTrimLeft($SciteKeyWord[$i], StringLen("au3.keywords.keywords=")), "\" & @CRLF, @CRLF) SendMessageString($Sci, $SCI_SETKEYWORDS, 0, $tempText) ConsoleWrite("3" & @CRLF) Case StringInStr($PART, "au3.keywords.macros=", 0, 1, 1) $tempText = StringReplace(StringTrimLeft($SciteKeyWord[$i], StringLen("au3.keywords.macros=")), "\" & @CRLF, @CRLF) SendMessageString($Sci, $SCI_SETKEYWORDS, 2, $tempText) ConsoleWrite("4" & @CRLF) Case StringInStr($PART, "au3.keywords.preprocessor=", 0, 1, 1) $tempText = StringReplace(StringTrimLeft($SciteKeyWord[$i], StringLen("au3.keywords.preprocessor=")), "\" & @CRLF, @CRLF) SendMessageString($Sci, $SCI_SETKEYWORDS, 4, $tempText) ConsoleWrite("5" & @CRLF) Case StringInStr($PART, "au3.keywords.special=", 0, 1, 1) $tempText = StringReplace(StringTrimLeft($SciteKeyWord[$i], StringLen("au3.keywords.special=")), "\" & @CRLF, @CRLF) SendMessageString($Sci, $SCI_SETKEYWORDS, 5, $tempText) ConsoleWrite("6" & @CRLF) Case StringInStr($PART, "au3.keywords.sendkeys=", 0, 1, 1) $tempText = StringReplace(StringTrimLeft($SciteKeyWord[$i], StringLen("au3.keywords.sendkeys=")), "\" & @CRLF, @CRLF) SendMessageString($Sci, $SCI_SETKEYWORDS, 3, $tempText) ConsoleWrite("7" & @CRLF) Case Else $tempText = Ptr(123456) EndSelect ;~ If Not IsPtr($tempText) Then $SCI_AUTOCLIST &= $tempText & " " Next EndIf $tempText = "" Local $SciteKeyWord = FileRead($KeyWordDir & "\au3.keywords.abbreviations.properties") If StringLen($SciteKeyWord) Then $SciteKeyWord = StringRegExpReplace($SciteKeyWord, "(\w)(\r\n)", "$1 $2") $SciteKeyWord = StringSplit($SciteKeyWord, " " & @CRLF, 1) For $i = 0 To UBound($SciteKeyWord) - 1 $PART = StringLeft($SciteKeyWord[$i], 26) Select Case StringInStr($PART, "au3.keywords.abbrev=", 0, 1, 1) $tempText = StringReplace(StringTrimLeft($SciteKeyWord[$i], StringLen("au3.keywords.abbrev=")), "\" & @CRLF, @CRLF) SendMessageString($Sci, $SCI_SETKEYWORDS, 6, $tempText) EndSelect Next EndIf $tempText = "" $SciteKeyWord = "" SendMessage($Sci, $SCI_SETMARGINTYPEN, $MARGIN_SCRIPT_NUMBER, $SC_MARGIN_NUMBER) SendMessage($Sci, $SCI_SETMARGINWIDTHN, $MARGIN_SCRIPT_NUMBER, SendMessageString($Sci, $SCI_TEXTWIDTH, $STYLE_LINENUMBER, "_99999")) SendMessage($Sci, $SCI_SETMARGINWIDTHN, $MARGIN_SCRIPT_ICON, 16) SendMessage($Sci, $SCI_AUTOCSETSEPARATOR, Asc(@CR), 0) SendMessage($Sci, $SCI_AUTOCSETIGNORECASE, True, 0) SetStyle($Sci, $STYLE_DEFAULT, 0x000000, 0xFFFFFF, 10, "Courier New") SendMessage($Sci, $SCI_STYLECLEARALL, 0, 0) SetStyle($Sci, $STYLE_BRACEBAD, 0x009966, 0xFFFFFF, 0, "", 0, 1) SetStyle($Sci, $SCE_AU3_DEFAULT, 0x000000, 0xFFFFFF) SetStyle($Sci, $SCE_AU3_COMMENT, 0x339900, 0xFFFFFF) SetStyle($Sci, $SCE_AU3_COMMENTBLOCK, 0x009966, 0xFFFFFF) SetStyle($Sci, $SCE_AU3_NUMBER, 0xA900AC, 0xFFFFFF, 0, "", 1) SetStyle($Sci, $SCE_AU3_FUNCTION, 0xAA0000, 0xFFFFFF, 0, "", 1, 1) SetStyle($Sci, $SCE_AU3_KEYWORD, 0xFF0000, 0xFFFFFF, 0, "", 1) SetStyle($Sci, $SCE_AU3_MACRO, 0xFF33FF, 0xFFFFFF, 0, "", 1) SetStyle($Sci, $SCE_AU3_STRING, 0xCC9999, 0xFFFFFF, 0, "", 1) SetStyle($Sci, $SCE_AU3_OPERATOR, 0x0000FF, 0xFFFFFF, 0, "", 1) SetStyle($Sci, $SCE_AU3_VARIABLE, 0x000090, 0xFFFFFF, 0, "", 1) SetStyle($Sci, $SCE_AU3_SENT, 0x0080FF, 0xFFFFFF, 0, "", 1) SetStyle($Sci, $SCE_AU3_PREPROCESSOR, 0xFF00F0, 0xFFFFFF, 0, "", 0, 0) SetStyle($Sci, $SCE_AU3_SPECIAL, 0xF00FA0, 0xFFFFFF, 0, "", 0, 1) SetStyle($Sci, $SCE_AU3_EXPAND, 0x0000FF, 0xFFFFFF, 0, "", 0, 1) SetStyle($Sci, $SCE_AU3_COMOBJ, 0xFF0000, 0xFFFFFF, 0, "", 1, 1) SetStyle($Sci, $SCE_AU3_UDF, 0xFF8000, 0xFFFFFF, 0, "", 1, 1) SetProperty($Sci, "fold", "1") SetProperty($Sci, "fold.compact", "1") SetProperty($Sci, "fold.comment", "1") SetProperty($Sci, "fold.preprocessor", "1") SendMessage($Sci, $SCI_SETMARGINWIDTHN, $MARGIN_SCRIPT_FOLD, 0); fold margin width=0 SendMessage($Sci, $SCI_MARKERDEFINE, $SC_MARKNUM_FOLDER, $SC_MARK_ARROW) SendMessage($Sci, $SCI_MARKERDEFINE, $SC_MARKNUM_FOLDEROPEN, $SC_MARK_ARROWDOWN) SendMessage($Sci, $SCI_MARKERDEFINE, $SC_MARKNUM_FOLDEREND, $SC_MARK_ARROW) SendMessage($Sci, $SCI_MARKERDEFINE, $SC_MARKNUM_FOLDERMIDTAIL, $SC_MARK_TCORNER) SendMessage($Sci, $SCI_MARKERDEFINE, $SC_MARKNUM_FOLDEROPENMID, $SC_MARK_ARROWDOWN) SendMessage($Sci, $SCI_MARKERDEFINE, $SC_MARKNUM_FOLDERSUB, $SC_MARK_VLINE) SendMessage($Sci, $SCI_MARKERDEFINE, $SC_MARKNUM_FOLDERTAIL, $SC_MARK_LCORNER) SendMessage($Sci, $SCI_SETFOLDFLAGS, 16, 0) SendMessage($Sci, $SCI_MARKERSETFORE, $SC_MARKNUM_FOLDER, 0xFFFFFF) SendMessage($Sci, $SCI_MARKERSETBACK, $SC_MARKNUM_FOLDERSUB, 0x808080) SendMessage($Sci, $SCI_MARKERSETBACK, $SC_MARKNUM_FOLDEREND, 0x808080) SendMessage($Sci, $SCI_MARKERSETFORE, $SC_MARKNUM_FOLDEREND, 0xFFFFFF) SendMessage($Sci, $SCI_MARKERSETBACK, $SC_MARKNUM_FOLDERTAIL, 0x808080) SendMessage($Sci, $SCI_MARKERSETBACK, $SC_MARKNUM_FOLDERMIDTAIL, 0x808080) SendMessage($Sci, $SCI_MARKERSETBACK, $SC_MARKNUM_FOLDER, 0x808080) SendMessage($Sci, $SCI_MARKERSETFORE, $SC_MARKNUM_FOLDEROPEN, 0xFFFFFF) SendMessage($Sci, $SCI_MARKERSETBACK, $SC_MARKNUM_FOLDEROPEN, 0x808080) SendMessage($Sci, $SCI_MARKERSETFORE, $SC_MARKNUM_FOLDEROPENMID, 0xFFFFFF) SendMessage($Sci, $SCI_MARKERSETBACK, $SC_MARKNUM_FOLDEROPENMID, 0x808080) SendMessage($Sci, $SCI_SETMARGINSENSITIVEN, $MARGIN_SCRIPT_FOLD, 1) SendMessage($Sci, $SCI_CLEARCMDKEY, BitShift($SCMOD_CTRL, -16) + 0x47, 0); Ctrl + G SendMessage($Sci, $SCI_CLEARCMDKEY, BitShift($SCMOD_CTRL, -16) + 0x4E, 0); Ctrl + N SendMessage($Sci, $SCI_CLEARCMDKEY, BitShift($SCMOD_CTRL, -16) + 0x4F, 0); Ctrl + O SendMessage($Sci, $SCI_CLEARCMDKEY, BitShift($SCMOD_CTRL, -16) + 0x53, 0); Ctrl + S SendMessage($Sci, $SCI_CLEARCMDKEY, BitShift($SCMOD_CTRL, -16) + 0x46, 0); Ctrl + F SendMessage($Sci, $SCI_MARKERDEFINE, 0, $SC_MARK_SHORTARROW) SendMessage($Sci, $SCI_MARKERDEFINE, 1, $SC_MARK_BACKGROUND) SendMessage($Sci, $SCI_MARKERDEFINE, 2, $SC_MARK_SHORTARROW) SendMessage($Sci, $SCI_MARKERSETBACK, 0, 0x0000FF); error or warning SendMessage($Sci, $SCI_MARKERSETBACK, 1, 0xE6E5FF); error or warning bg colour SendMessage($Sci, $SCI_MARKERSETBACK, 2, 0x03C724); 'mark all' in search win SendMessage($Sci, $SCI_SETMARGINSENSITIVEN, $MARGIN_SCRIPT_FOLD, 1) SendMessage($Sci, $SCI_MARKERSETBACK, 0, 0x0000FF) If @error Then Return 0 Else Return 1 EndIf EndFunc ;==>SCI_InitEditorAu3 Func SCI_AU3_WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam ;~ Local $tagNMHDR, $event; $tagSCNotification = "int;int;int;int;int;int;int;ptr;int;int;int;int;int;int;int;int;int;int;int" Local $structNMHDR = DllStructCreate("hwnd hWndFrom;int IDFrom;int Code", $lParam) ; tagNMHDR Local $sClassName = DllCall("User32.dll", "int", "GetClassName", "hwnd", DllStructGetData($structNMHDR, 1), "str", "", "int", 512) $sClassName = $sClassName[2] If $sClassName <> "Scintilla" Then Return 'GUI_RUNDEFMSG' $structNMHDR = DllStructCreate($tagSCNotification, $lParam) If @error Then Return 'GUI_RUNDEFMSG' Local $hwndFrom = DllStructGetData($structNMHDR, 1) Local $idFrom = DllStructGetData($structNMHDR, 2) Local $event = DllStructGetData($structNMHDR, 3) Local $position = DllStructGetData($structNMHDR, 4) Local $ch = DllStructGetData($structNMHDR, 5) Local $modifiers = DllStructGetData($structNMHDR, 6) Local $modificationType = DllStructGetData($structNMHDR, 7) Local $char = DllStructGetData($structNMHDR, 8) Local $length = DllStructGetData($structNMHDR, 9) Local $linesAdded = DllStructGetData($structNMHDR, 10) Local $message = DllStructGetData($structNMHDR, 11) Local $uptr_t = DllStructGetData($structNMHDR, 12) Local $sptr_t = DllStructGetData($structNMHDR, 13) Local $Line = DllStructGetData($structNMHDR, 14) Local $foldLevelNow = DllStructGetData($structNMHDR, 15) Local $foldLevelPrev = DllStructGetData($structNMHDR, 16) Local $margin = DllStructGetData($structNMHDR, 17) Local $listType = DllStructGetData($structNMHDR, 18) Local $X = DllStructGetData($structNMHDR, 19) Local $Y = DllStructGetData($structNMHDR, 20) Local $Sci = $hwndFrom If Not IsHWnd($Sci) Then $Sci = HWnd($Sci) ;~ ConsoleWrite("lll" & _WinAPI_GetClassName($Sci) & @CRLF) Local $line_number = SendMessage($Sci, $SCI_LINEFROMPOSITION, $position, 0) ;Select ;Case $hwndFrom = $Sci ;If IsHWnd($Sci) Then Local $Word, $WordPos, $CurrentLine, $PreviousLine, $Tabs, $TabsAdd, $style, $CurrentPos, $pos, $Replace, $AllVariables, $AllVariablesSplit, $AllWords, $err,$Variable Switch $event Case $SCN_CALLTIPCLICK If SendMessage($Sci, $SCI_CALLTIPACTIVE, 0, 0) Then Switch $position Case 1 If IsArray($SCI_sCallTipFoundIndices) And $SCI_sCallTipSelectedIndice > 0 Then $SCI_sCallTipSelectedIndice -= 1 $SCI_sCallTip = Chr(1) & $SCI_sCallTipSelectedIndice + 1 & "/" & UBound($SCI_sCallTipFoundIndices) & Chr(2) & $SCI_sCallTip_Array[$SCI_sCallTipFoundIndices[$SCI_sCallTipSelectedIndice]] $SCI_sCallTip = StringRegExpReplace(StringReplace($SCI_sCallTip,")",")"&@LF,1),"([.:])","$1" & @LF) SendMessageString($Sci, $SCI_CALLTIPSHOW, $SCI_sCallTipPos, $SCI_sCallTip) EndIf Case 2 If IsArray($SCI_sCallTipFoundIndices) And $SCI_sCallTipSelectedIndice < UBound($SCI_sCallTipFoundIndices) - 1 Then $SCI_sCallTipSelectedIndice += 1 $SCI_sCallTip = Chr(1) & $SCI_sCallTipSelectedIndice + 1 & "/" & UBound($SCI_sCallTipFoundIndices) & Chr(2) & $SCI_sCallTip_Array[$SCI_sCallTipFoundIndices[$SCI_sCallTipSelectedIndice]] $SCI_sCallTip = StringRegExpReplace(StringReplace($SCI_sCallTip,")",")"&@LF,1),"([.:])","$1" & @LF) SendMessageString($Sci, $SCI_CALLTIPSHOW, $SCI_sCallTipPos, $SCI_sCallTip) EndIf EndSwitch EndIf Case $SCN_CHARADDED Switch Chr($ch) Case "(" ;~ If Chr($ch) = "(" Then Local $ret, $sText, $iPos = SendMessage($Sci, $SCI_GETCURRENTPOS, 0, 0), $sFuncName Local $iLen = SendMessage($Sci, $SCI_GETCURLINE, 0, 0) Local $sBuf = DllStructCreate("byte[" & $iLen & "]") Local $ret = DllCall($user32, "long", "SendMessageA", "long", $Sci, "int", $SCI_GETCURLINE, "int", $iLen, "ptr", DllStructGetPtr($sBuf)) Local $current = $ret[0] Local $startword = $current While $startword > 0 And StringIsAlNum(Chr(DllStructGetData($sBuf, 1, $startword - 1))) Or Chr(DllStructGetData($sBuf, 1, $startword - 1)) = "_" $startword -= 1 $sFuncName = Chr(DllStructGetData($sBuf, 1, $startword)) & $sFuncName WEnd ;~ $sFuncName = _StringReverse($sFuncName) $SCI_sCallTipFoundIndices = ArraySearchAll($SCI_sCallTip_Array, $sFuncName, 0, 0, 1) $sBuf = 0 $SCI_sCallTipSelectedIndice = 0 $SCI_sCallTip = "" If IsArray($SCI_sCallTipFoundIndices) Then $SCI_sCallTip = Chr(1) & "1/" & UBound($SCI_sCallTipFoundIndices) & Chr(2) & $SCI_sCallTip_Array[$SCI_sCallTipFoundIndices[0]] $SCI_sCallTip = StringReplace(StringRegExpReplace(StringReplace($SCI_sCallTip,")",")"&@LF,1),"(.{70,110} )","$1" & @LF),@LF&@LF,@LF) $SCI_sCallTipPos = $iPos - StringLen($sFuncName) SendMessageString($Sci, $SCI_CALLTIPSHOW, $SCI_sCallTipPos, $SCI_sCallTip) $SCI_hlStart = StringInStr($SCI_sCallTip, "(") $SCI_hlEnd = StringInStr($SCI_sCallTip, ",") SendMessage($Sci, $SCI_CALLTIPSETHLT, $SCI_hlStart, $SCI_hlEnd) EndIf ;~ ElseIf Chr($ch) = "," Then Case "," If SendMessage($Sci, $SCI_CALLTIPACTIVE, 0, 0) Then $SCI_hlStart = $SCI_hlEnd Local $iTemp = StringInStr(StringTrimLeft($SCI_sCallTip, $SCI_hlStart + 1), ",") + $SCI_hlStart If StringInStr(StringTrimLeft($SCI_sCallTip, $SCI_hlStart + 1), ")") + $SCI_hlStart < $iTemp Or $iTemp - $SCI_hlStart = 0 Then $SCI_hlEnd = StringInStr(StringTrimLeft($SCI_sCallTip, $SCI_hlStart + 1), ")") + $SCI_hlStart Else $SCI_hlEnd = $iTemp EndIf SendMessage($Sci, $SCI_CALLTIPSETHLT, $SCI_hlStart, $SCI_hlEnd) EndIf ;~ ElseIf Chr($ch) = ")" Then Case ")" If SendMessage($Sci, $SCI_CALLTIPACTIVE, 0, 0) Then SendMessage($Sci, $SCI_CALLTIPCANCEL, 0, 0) ;~ ElseIf Chr($ch) = @CR Then ; if: enter is pressed / new line created Case @CR $CurrentLine = SCI_GetCurrentLine($Sci) $PreviousLine = SCI_GetLine($Sci, $CurrentLine - 1) $TabsAdd = "" $Tabs = StringSplit($PreviousLine, @TAB) For $i = 1 To $Tabs[0] $TabsAdd &= @TAB Next SCI_AddLines($Sci, $TabsAdd, $CurrentLine) $pos = SCI_GetLineEndPos($Sci, $CurrentLine - 1) SCI_SetCurrentPos($Sci, $pos) Case " " $CurrentPos = SCI_GetCurrentPos($Sci) $style = SendMessage($Sci, $SCI_GETSTYLEAT, $CurrentPos - 2, 0) If $style = $SCE_AU3_EXPAND Then $WordPos = SCI_GetWordPositions($Sci, $CurrentPos - 2) $Replace = StringRegExp($SCI_ABBREVFILE, "(?:\n|\r|\A)" & SCI_GETTEXTRANGE($Sci, $WordPos[0], $WordPos[1]) & "=(.*)", 1) If Not @error Then $Replace = StringFormat(StringRegExpReplace($Replace[0], "\r|\n", "")) SCI_SetSelection($Sci, $WordPos[0], $WordPos[1] + 1) $WordPos[0] += StringInStr($Replace, "|", 1, 1) - 1 If Not StringInStr($Replace, "|", 1, 1) Then $WordPos[0] = $WordPos[1] + 1 SendMessageString($Sci, $SCI_REPLACESEL, 0, StringReplace($Replace, "|", "", 1)) SCI_SetCurrentPos($Sci, $WordPos[0]) EndIf EndIf ;~ ConsoleWrite(SCI_GetWordFromPos($Sci,SCI_GetCurrentPos($Sci)-2) & " - " & $style &":"& $SCE_AU3_EXPAND & @CRLF) ;~ Else Case Else ;~ #CS ; Uncomment this to add autocomplete for variables $style = SendMessage($Sci, $SCI_GETSTYLEAT, SCI_GetCurrentPos($Sci), 0) If Not SendMessage($Sci, $SCI_AUTOCACTIVE, 0, 0) And _ $style <> $SCE_AU3_COMMENT And $style <> $SCE_AU3_COMMENTBLOCK _ And $style <> $SCE_AU3_STRING And $style <> $SCE_AU3_SENT Then $Word = SCI_GetCurrentWordEx($Sci, 0, 1) While $Word And Not StringRegExp($Word, "\A([@$#_]|\w)") $Word = StringTrimLeft($Word, 1) WEnd While $Word And Not StringRegExp($Word, "([@$#_]|\w)\Z") $Word = StringTrimRight($Word, 1) WEnd ;~ ConsoleWrite($Word & @CRLF) If $Word And StringLeft($Word, 1) = "{:content:}quot; Then $AllWords = StringSplit(SCI_GetText($Sci), " []()-+*=/<>," & @CRLF & @TAB) $AllVariables = @CR For $i = 1 To $AllWords[0] ; Get all variables from the script and trim them $Variable = $AllWords[$i] If StringLeft($Variable, 1) = "{:content:}quot; Then If Not StringInStr($AllVariables, @CR & $Variable & @CR) And Not ($Variable = $Word) Then $AllVariables &= $Variable & @CR EndIf EndIf Next $AllVariables = StringTrimLeft($AllVariables, 1) ; remove the first CR $AllVariables = StringTrimRight($AllVariables, 1) ; remove the last CR $AllVariablesSplit = StringSplit($AllVariables, @CR) _ArraySort($AllVariablesSplit, 0, 1) $AllVariables = _ArrayToString($AllVariablesSplit, @CR, 1) SendMessageString($Sci, $SCI_AUTOCSHOW, StringLen($Word), $AllVariables) ElseIf StringLen($Word) Then ;~ If Not SendMessage($Sci, $SCI_AUTOCACTIVE, 0,0) Then ;~ ConsoleWrite($Word & @CRLF) If StringRegExp($Word, "\A[A-Za-z0-9_@#]+\Z") Then ;And StringInStr(@CR & $SCI_AUTOCLIST,@CR & $Word,0) Then Local $pos = ArraySearchAll($SCI_AUTOCLIST, $Word, 1, 0, 1) If $pos = -1 Then Return 'GUI_RUNDEFMSG' ;~ _ArraySort($SCI_AUTOCLIST,0,1) $AllVariables = _ArrayToString($SCI_AUTOCLIST, @CR, $pos[0], $pos[UBound($pos) - 1]) ;~ $AllVariables = _ArrayToString($SCI_AUTOCLIST, @CR,1) ;~ ConsoleWrite($AllVariables & @CRLF) $err = SendMessageString($Sci, $SCI_AUTOCSHOW, StringLen($Word), $AllVariables) ;~ ConsoleWrite($err & @CRLF) EndIf ;~ EndIf EndIf EndIf ;~ #CE ;~ EndIf EndSwitch Case $SCN_MARGINCLICK SendMessage($Sci, $SCI_TOGGLEFOLD, $line_number, 0) Case $SCN_SAVEPOINTREACHED Case $SCN_SAVEPOINTLEFT EndSwitch ;EndIf ;EndSelect $structNMHDR = 0 $event = 0 $lParam = 0 Return 'GUI_RUNDEFMSG' EndFunc ;==>SCI_AU3_WM_NOTIFY ;Prog@ndy, modified _ArraySearch Func ArraySearchAll(Const ByRef $avArray, $vValue, $iStart = 0, $iEnd = 0, $iPartialfromBeginning = 0, $iForward = 1, $iSubItem = 0) If Not IsArray($avArray) Then Return SetError(1, 0, -1) Local $iUBound = UBound($avArray) - 1 ; Bounds checking If $iEnd < 1 Or $iEnd > $iUBound Then $iEnd = $iUBound If $iStart < 0 Then $iStart = 0 If $iStart > $iEnd Then Return SetError(4, 0, -1) If $vValue = "" And $iPartialfromBeginning = True Then Return SetError(8, 0, -1) ; Direction (flip if $iForward = 0) Local $iStep = 1 If Not $iForward Then Local $iTmp = $iStart $iStart = $iEnd $iEnd = $iTmp $iStep = -1 EndIf Local $ResultsArray[$iUBound + 1], $ResultIndex = 0 Local $iLenValue = StringLen($vValue) ; Search Switch UBound($avArray, 0) Case 1 ; 1D array search If Not $iPartialfromBeginning Then For $i = $iStart To $iEnd Step $iStep If $avArray[$i] = $vValue Then $ResultsArray[$ResultIndex] = $i $ResultIndex += 1 EndIf Next Else For $i = $iStart To $iEnd Step $iStep If StringLeft($avArray[$i], $iLenValue) = $vValue Then $ResultsArray[$ResultIndex] = $i $ResultIndex += 1 EndIf Next EndIf Case 2 ; 2D array search Local $iUBoundSub = UBound($avArray, 2) - 1 If $iSubItem < 0 Then $iSubItem = 0 If $iSubItem > $iUBoundSub Then $iSubItem = $iUBoundSub If Not $iPartialfromBeginning Then For $i = $iStart To $iEnd Step $iStep If $avArray[$i][$iSubItem] = $vValue Then $ResultsArray[$ResultIndex] = $i $ResultIndex += 1 EndIf Next Else For $i = $iStart To $iEnd Step $iStep If StringLeft($avArray[$i][$iSubItem], $iLenValue) = $vValue Then $ResultsArray[$ResultIndex] = $i $ResultIndex += 1 EndIf Next EndIf Case Else Return SetError(7, 0, -1) EndSwitch If $ResultIndex = 0 Then Return SetError(6, 0, -1) ReDim $ResultsArray[$ResultIndex] Return $ResultsArray EndFunc ;==>ArraySearchAll ; Author: Prog@ndy ; If the equal entries are one after the other, delete them :) Func ArraySortUnique(ByRef $avArray, $iDescending = 0, $iStart = 0, $iEnd = 0, $iSubItem = 0) Local $ret = _ArraySort($avArray, $iDescending, $iStart, $iEnd, $iSubItem) If @error Then Return SetError(@error, 0, $ret) Local $ResultIndex = 1, $ResultArray[UBound($avArray)] $ResultArray[0] = $avArray[0] For $i = 1 To UBound($avArray) - 1 If Not ($avArray[$i] = $avArray[$i - 1]) Then $ResultArray[$ResultIndex] = $avArray[$i] $ResultIndex += 1 EndIf Next ReDim $ResultArray[$ResultIndex] $avArray = $ResultArray Return 1 EndFunc ;==>ArraySortUnique any suggestions on something i need to change or add? also if i read your above post correctly i need to make some sort of conditional statement in the while loop using the last word entered? how would i detect the last word entered?1 point