MrCreatoR

AutoIt Syntax Highlight

31 posts in this topic

#1 ·  Posted (edited)

This UDF allows to highlight AutoIt v3 syntax code to html/bbcode format.

Note: As strange as it might sound, this UDF written on pure AutoIt (even includes are not used), and since this UDF uses a lot of RegExp, i had to add a RegExp debugging system.
To enable this system you should set «1» for the following variables in library file (AutoItSyntaxHighlight.au3) under the #Region Global Variables:
 

Global $fAu3SH_Debug_RE_Patterns = True ; Enable regular expression debugging system
Global $fAu3SH_Debug_RE_WriteLog = True ; Will write a log-file for debugging data (at the end of each syntax highlighting process)

There is also a Global option to define if the functions/keywords should be linked to online documentation:

$iAu3SH_AddURLs = 1 ; Will add links to highlighted Functions/Keywords

Example:


#include <Au3SyntaxHighlight.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

$iAu3SH_AddURLs = 1

$sInitDir = ''
$sFilter = '*.au3'

$sMRUList = RegRead('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\au3', 'MRUList')
$sLastFileOpenPath = RegRead('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\au3', StringLeft($sMRUList, 1))

If Not FileExists($sLastFileOpenPath) Then
    $sInitDir = @ScriptDir
    $sFilter = 'Test Script.au3'
EndIf

$sFile = FileOpenDialog('Open Au3 Script File', $sInitDir, 'AutoIt Script (' & $sFilter & ')')
If @error Then Exit

$sAu3Code = FileRead($sFile)
$sAu3Syntax_HighlightedCode = _Au3_SyntaxHighlight_Proc($sAu3Code, 0)

$sTmp_File = @TempDir & '\Au3_HighlightSyntax.htm'

$hFile = FileOpen($sTmp_File, 2)
FileWrite($hFile, $sAu3Syntax_HighlightedCode)
FileClose($hFile)

Execute('_IEErrorHandlerRegister()')

$oIE = _IECreateEmbedded()

$iGUI_Width = @DesktopWidth - 40
$iGUI_Height = @DesktopHeight - 150

$hGUI = GUICreate('AutoIt Syntax Highlighter [' & $sFile & ']', $iGUI_Width, $iGUI_Height, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
GUICtrlCreateObj($oIE, 10, 20, $iGUI_Width - 20, $iGUI_Height - 70)
$iBack_Bttn = GUICtrlCreateButton('Back', 10, $iGUI_Height - 40, 100, 30)
$iForward_Bttn = GUICtrlCreateButton('Forward', 120, $iGUI_Height - 40, 100, 30)
$iHome_Bttn = GUICtrlCreateButton('Home', 230, $iGUI_Height - 40, 100, 30)
$iStop_Bttn = GUICtrlCreateButton('Stop', 340, $iGUI_Height - 40, 100, 30)

GUISetState(@SW_SHOW, $hGUI)

_IENavigate($oIE, $sTmp_File)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            GUIDelete($hGUI)
            Exit
        Case $iHome_Bttn
            _IENavigate($oIE, $sTmp_File)
        Case $iBack_Bttn
            _IEAction($oIE, 'back')
        Case $iForward_Bttn
            _IEAction($oIE, 'forward')
        Case $iStop_Bttn
            _IEAction($oIE, 'stop')
    EndSwitch
WEnd



UDF Header:

; #FUNCTION# ====================================================================================================
; Name...........: _Au3_SyntaxHighlight_Proc
; Description....: Allows to highlight AutoIt v3 syntax to html/bbcode format.
; Syntax.........: _Au3_SyntaxHighlight_Proc($sAu3Code, $iOutput = -1)
; Parameters.....: $sAu3Code - AutoIt v3 plain code.
; $iOutput - [Optional] Sets the output format:
; -1 - (Default) Return CSS classes header and the AutoIt Syntax Highlighted code as string (wrapped with code tags)
; 1 - Return CSS classes header and AutoIt Syntax Highlighted code as array, where...
; [0] = CSS styles.
; [1] = AutoIt Syntax Highlighted code.
; 2 - Return the result as Html formatted string.
; 3 - Return the result as BBCode formatted string (html tags replaced with bbcode tags).
;
; Return values..: Success - Returns AutoIt Syntax Highlighted code (see $iOutput parameter above for more details).
; Failure - Sets @error to:
; 1 - The $sAu3Code is empty string.
; -1 - The process is aborted by global parameter $iAu3SH_AbortHighlight, and the return value is the original $sAu3Code.
; 2 - Keywords or styles file not found (check the @ScriptDir & "Resources").
;
; Author.........: G.Sandler (a.k.a (Mr)CreatoR), www.creator-lab.ucoz.ru, www.autoit-script.ru
; Modified.......:
; Remarks........: *Idea* based on similar old project: http://www.autoitscript.com/forum/index.php?showtopic=34236
; Related........:
; Link...........:
; Example........: Yes (see #Region Header).
; ===============================================================================================================



Current Library Version: 1.0
AutoIt Support Version: v3.3+, Developed/Tested on Win XP Rus (Service Pack 3) / Win 7 Rus

Screenshot:


Credits:

amel27



Change Log:



Attachments:
AutoItSyntaxHighlight_1.0.zip
AutoItSyntaxHighlight_0.9.zip
AutoItSyntaxHighlight_0.8.zip
AutoItSyntaxHighlight_0.7.zip
AutoItSyntaxHighlight_0.6.zip
AutoItSyntaxHighlight_0.5.zip
AutoItSyntaxHighlight_0.4.zip
AutoItSyntaxHighlight_0.3.zip
AutoItSyntaxHighlight_0.2.zip
AutoItSyntaxHighlight_0.2.zip
AutoItSyntaxHighlight.zip

AutoItSyntaxHighlight.zip

AutoItSyntaxHighlight_0.2.zip

AutoItSyntaxHighlight_0.2.zip

AutoItSyntaxHighlight_0.3.zip

AutoItSyntaxHighlight_0.4.zip

AutoItSyntaxHighlight_0.5.zip

AutoItSyntaxHighlight_0.6.zip

AutoItSyntaxHighlight_0.7.zip

AutoItSyntaxHighlight_0.8.zip

AutoItSyntaxHighlight_0.9.zip

AutoItSyntaxHighlight_1.0.zip

post-20477-0-30772400-1428952793_thumb.p

Edited by MrCreatoR

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites



Magnificent! Keep up the good work.


[Not using this account any more. Using "iShafayet" instead]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

New version...

[0.2]

+ Added Global parameter ($iAu3SH_AbortHighlight) to abort the highlighting process (break the function execution).

If this variable set to 1, the function will return the original Au3 Code and set @error to -1.

+ Added "#White space" style support (now you can set it in the au3.styles.properties file).

+ Added "#Background" style support, used only for highlighting with Html tags mode (now you can set it in the au3.styles.properties file).

* Styles header classes renamed with "au3_" prefix.

* Fixed bug with highlighting COM objects.

* Fixed bug with highlighting keywords inside variables.

* Fixed bug with highlighting more than one preprocessor when instead of <Include.au3> used double/single qoutes ("Include.au3").

* Fixed bug with highlighting commented lines/comment blocks inside literal strings.

* Fixed bug with not (properly) highlighting commented lines.

* Fixed issue with converting to BBCode format.

* Now the PreProcessor and Special keywords are correctly highlighted (all included tags removed).

Please check the first post. Edited by MrCreatoR

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

And one more update:

v0.3

* Fixed bug when strings and send keys was highlighted inside commented lines.

* Few optimizations to the code.


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Very usefull UDF. :blink:

Thanks for sharing with us.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Update:

[0.4]

* Fixed bug with (re)highlighting keywords and functions inside COM object methods.

* Docs updated.


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Awesome little program!!!

Share this post


Link to post
Share on other sites

You know what would make this more interesting? Would be to set it so that you load it into a rich editbox and it does all of the highlighting in there (without writing to the file), instead of being saved as an html file. What do you think? or do you think that it would be too slow?

Share this post


Link to post
Share on other sites

This is great! except its turning things like Global $iAu3SH_MDV_Opt = Opt("MustDeclareVars", 1) into Global $iAu3SH_MDV_Opt = Opt(%@~@%28036.3157074722, 1)

how do I fix that?


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

Update.

[0.5]

* Fixed bug with highlighting literal strings inside comment blocks.

* Fixed few issues with highlighting special keywords.


Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Hi Mate I love this work.

I got a Wrong output with this code.

Normal

#cs -------------------------------------------------------
AutoIt Version: 3.3.8.1
Author..........: dany
Script Function...: Dir "Retorna la Ruta sin el nombre del Archivo
Uso..............: Dir("C:\Windows\System32\Dismes-ESMsiProvider.dll.mui") Retorna "C:\Windows\System32\Dismes-ES"
#ce -------------------------------------------------------

;Ejemplo
$ruta="C:\Windows\System32\Dismes-ESMsiProvider.dll.mui"
msgbox(0,"C:\Windows\System32\Dismes-ES",Dir($ruta))

;Funcion Dir
func Dir($path)
local $delimiter=""
$array =StringSplit($path,$delimiter)
$len=UBound($array)-1
$numero= $len-1
$num=StringInStr($path,$delimiter,0,$numero)
$dir=StringMid($path,1,$num)
return $dir
EndFunc

With your software change my variable $delimiter

#cs -------------------------------------------------------

AutoIt Version: 3.3.8.1

Author..........: dany

Script Function...: Dir "Retorna la Ruta sin el nombre del Archivo

Uso..............: Dir("C:\Windows\System32\Dismes-ESMsiProvider.dll.mui") Retorna "C:\Windows\System32\Dismes-ES"

#ce -------------------------------------------------------

;Ejemplo

$ruta="C:\Windows\System32\Dismes-ESMsiProvider.dll.mui"

msgbox(0,"C:\Windows\System32\Dismes-ES",Dir($ruta))

;Funcion Dir

func Dir($path)

local $delimiter="C:\Windows\System32\Dismes-ESMsiProvider.dll.mui"

$array =StringSplit($path,$delimiter)

$len=UBound($array)-1

$numero= $len-1

$num=StringInStr($path,$delimiter,0,$numero)

$dir=StringMid($path,1,$num)

return $dir

EndFunc

Edited by Danyfirex

Share this post


Link to post
Share on other sites

I got a Wrong output with this code.

Fixed, please check the first post :)

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Fixed, please check the first post :)

Simply Amazing MrCreatoR thank you so much

Share this post


Link to post
Share on other sites

Simply Amazing MrCreatoR thank you so much

And thank you for revealing this bug, it is strange that this haven't been noticed before by others.

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

hi mate it's me again reporting another bug when I use in this code.

I use so much you usefull tool :thumbsup:

where my registry keys are, I put some comment line with the problem.

maybe for next version you can add size-type font. it's only a suggestion.

Thank you Again for you great tool MrCreatoR

#cs -------------------------------------------------------
AutoIt Version: 3.3.8.1
Author..........: Danyfirex
Script Function...: ListarRun
Uso..............: $Listar=listarRun()
Retorna : Lista las Claves Run en un Array

#ce -------------------------------------------------------


;Ejemplo

#include

$Listar=listarRun()

_ArrayDisplay($Listar,"Funcion Listar Runs")


Func listarRun()
local $valor


Select
Case @OSArch="X64"

Local $clave[3]
local $Array
Local $split
local $XD =1
$clave[0]="HKLM64SoftwareMicrosoftWindowsCurrentVersion Run";here Make me one space in my string "Run"
$clave[1]="HKLMSoftwareMicrosoftWindowsCurrentVersionRu n";here Make me one space in my string"Run"
$clave[2]="HKCUSoftwareMicrosoftWindowsCurrentVersionRu n";here Make me one space in my string "Run"

for $a=0 to 2
For $i = 1 To $XD

Local $var = RegEnumVal($clave[$a], $i)
if _RegExist($clave[$a],$var) Then
$valor=RegRead($clave[$a],$var)
$clavereg=StringSplit($clave[$a],"")



$Array&=($clavereg[1] & " - Run: " &"[" & $var& "] - " & $valor)&@CR
$XD+=1
EndIf

Next

next

$split=stringsplit($Array,@CRLF)
ReDim $split[UBound($split)-1]
return $split



Case @OSArch="X86"
local $clave2[2]
local $Array
local $split
local $XD =1
$clave2[0]="HKLMSoftwareMicrosoftWindowsCurrentVersionRu n" ;here Make me one space in my string "Run"
$clave2[1]="HKCUSoftwareMicrosoftWindowsCurrentVersionRu n" ;here Make me one space in my string "Run"

for $a=0 to 1
For $i = 1 To $XD

Local $var = RegEnumVal($clave2[$a], $i)
if _RegExist($clave2[$a],$var) Then
$valor=RegRead($clave2[$a],$var)
$clavereg=StringSplit($clave2[$a],"")
$Array&=($clavereg[1] & " - Run: " &"[" & $var& "] - " & $valor)&@CR
$XD+=1
EndIf

Next

next

$split=stringsplit($Array,@CRLF)
ReDim $split[UBound($split)-1]
return $split

EndSelect

EndFunc


Func _RegExist($sKeyName, $sValueName)
RegRead($sKeyName, $sValueName)
Return @error = 0
EndFunc
Edited by Danyfirex

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

I am not sure that i understand the bug...

Edited by MrCreatoR

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

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