Jump to content

Recommended Posts

  • Developers
Posted

One piece of advice here: Don;t change anything in SciTEGlobal.properties, but only override those values but adding a copy into ScITEUSer.properties.

Reason is that SciTEglobal.properties will be overridden during the next upgrade when running the installer and you loose all modification made.

Jos

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.
  :)

Posted

One piece of advice here: Don;t change anything in SciTEGlobal.properties, but only override those values but adding a copy into ScITEUSer.properties.

Reason is that SciTEglobal.properties will be overridden during the next upgrade when running the installer and you loose all modification made.

Since I changed my theme, the bar on the right of the line numbers has changed to a dark grey and looks stupid now that I've changed my theme to a lighter on.

Any advice?

  • 3 weeks later...
Posted

UnCognitive is a different approach to syntax highlighting. In fact, it's the opposite as it aims to remove as much colour as possible, leaving only what you need to be able to differentiate left coloured. The idea is fuelled from a discussion in the MVP forum about the GeSHi highlighting we use on the forum currently and an article; A case against syntax highlighting. Most specifically this quote:

Syntax highlighting doesn't improve legibility. It encourages you to skim through code rather than understand it. It makes you focus on syntax errors rather than real bugs, and it gets in the way of your learning.

Although I like highlighting, the quote, excuse the pun, highlights the most critical problem with colour coding, it makes you focus on syntax errors rather than real bugs.

I've been using this configuration file for an hour now and it actually seems to not be bothering too much. The only code which is highlighted are comments and operators. The reasons?

The first one concerns multi-line comments. If you're jumping around in a source code file, perhaps as part of an interactive search-and-replace operation, you might end up in the middle of a large block of commented-out code. You begin reading it as code, and after a while you run into an end-of-comment token, and realize that you've been reading a comment all along. In this case, rendering all comments in a different colour would have prevented the mistake.

And,

Syntax highlighting doesn't improve legibility. It encourages you to skim through code rather than understand it. It makes you focus on syntax errors rather than real bugs, and it gets in the way of your learning. Arguably, it even encourages you to procrastinate the removal of commented-out code blocks. And current implementations of it fail to differentiate between "=" and "==", the only situation in which it would have been useful.

Although this configuration file doesn't take notice of double operators and such, but it makes it easier to differentiate when you're outside of a string/comment and using them in mathematical/operational terms.

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# START: DO NOT CHANGE ANYTHING AFTER THIS LINE     #-#-#-#-#
# UnCognitive by JamesBrooks 2010
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
font.base=font:Verdana,size:10,$(font.override)
font.monospace=font:Courier New,size:10
proper.case=1
check.updates.scite4autoit3=0
use.tabs=1
indent.size=4
indent.size.*.au3=4
tabsize=4
#Background
style.au3.32=style.*.32=$(font.base),back:#F0F4F9
#CaretLineBackground
caret.line.back=#FFFED8
# Brace highlight
style.au3.34=fore:#0000FF,back:#F0F4F9
# Brace incomplete highlight
style.au3.35=fore:#009933,back:#F0F4F9
#White space
style.au3.0=fore:#000000,back:#F0F4F9
#Comment line
style.au3.1=fore:#009933,back:#F0F4F9
#Comment block
style.au3.2=fore:#669900,back:#F0F4F9
#Number
style.au3.3=fore:#000000,back:#F0F4F9
#Function
style.au3.4=fore:#000000,back:#F0F4F9
#Keyword
style.au3.5=fore:#000000,back:#F0F4F9
#Macro
style.au3.6=fore:#000000,back:#F0F4F9
#String
style.au3.7=fore:#000000,back:#F0F4F9
#Operator
style.au3.8=fore:#FF0000,back:#F0F4F9
#Variable
style.au3.9=fore:#000000,back:#F0F4F9
#Sent keys
style.au3.10=fore:#000000,back:#F0F4F9
#Pre-Processor
style.au3.11=fore:#000000,back:#F0F4F9
#Special
style.au3.12=fore:#000000,back:#F0F4F9
#Abbrev-Expand
style.au3.13=fore:#000000,back:#F0F4F9
#Com Objects
style.au3.14=fore:#0000FF,bold,back:#F0F4F9
#Standard UDF's
style.au3.15=fore:#000000,back:#F0F4F9
# END => DO NOT CHANGE ANYTHING BEFORE THIS LINE  #-#-#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

Enjoy.

James

Posted (edited)

But wait... Isn't finding syntax errors a good thing?

My approach is simple. I use Blue for internal bits (functions, operators, keywords). Green for any non-running bits (Comments, anything beginning with #). And red for any strings and numbers. Everything else is a shade of grey (Abbrev-Expand is pink though). I use a different shade for everything though, so the effect is that you won't really notice much until you look carefully at the code. Other tweaks include a pale red background for strings, just helps IMO, and a clearer caret line background (I held on to that from my days with PSPad). I also added the snippet for changing the selection colour, as it really annoyed me not being able to see where the selection was. I wish this was in SciTEConfig.

I like it, it's taken a while to get it how I wanted it to be, tweaking bits gradually over time.

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# START: DO NOT CHANGE ANYTHING AFTER THIS LINE     #-#-#-#-#
# Shades by Mat
#------------------------------------------------------------
font.base=font:Verdana,size:10,$(font.override)
font.monospace=font:Courier New,size:10
proper.case=1
check.updates.scite4autoit3=0
use.tabs=1
indent.size=4
indent.size.*.au3=4
tabsize=4
#Selection
selection.alpha=100
selection.back=#0077DD
selection.fore=#000000
#Background
style.au3.32=style.*.32=$(font.base),back:#F0F4F9
#CaretLineBackground
caret.line.back=#FFFC88
# Brace highlight
style.au3.34=fore:#0000FF,back:#F0F4F9
# Brace incomplete highlight
style.au3.35=fore:#00822B,back:#F0F4F9
#White space
style.au3.0=fore:#2A2A2A,back:#F0F4F9
#Comment line
style.au3.1=fore:#00822B,back:#F0F4F9
#Comment block
style.au3.2=fore:#669900,back:#F0F4F9
#Number
style.au3.3=fore:#B00F13,back:#F0F4F9
#Function
style.au3.4=fore:#000080,back:#F0F4F9
#Keyword
style.au3.5=fore:#0000FF,back:#F0F4F9
#Macro
style.au3.6=fore:#800000,back:#F0F4F9
#String
style.au3.7=fore:#96011C,back:#EFD1D1
#Operator
style.au3.8=fore:#17255E,bold,back:#F0F4F9
#Variable
style.au3.9=fore:#454545,italics,back:#F0F4F9
#Sent keys
style.au3.10=fore:#AF3501,back:#F0F4F9
#Pre-Processor
style.au3.11=fore:#067900,back:#F0F4F9
#Special
style.au3.12=fore:#135E00,back:#F0F4F9
#Abbrev-Expand
style.au3.13=fore:#BE0198,back:#F0F4F9
#Com Objects
style.au3.14=fore:#000080,back:#F0F4F9
#Standard UDF's
style.au3.15=fore:#004E9B,back:#F0F4F9
# END => DO NOT CHANGE ANYTHING BEFORE THIS LINE  #-#-#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#

Edit: Speelign

Edited by Mat
Posted

In your global options file i think if you change edge.mode=0 that will take away the line

nope, i still got a white line. (sigh)

Posted

nope, i still got a white line. (sigh)

Which theme are you using? If it's one of the themes that I have modified then try it again because I have posted several revisions.

@JamesBrooks, I like that theme and the theory behind it. It should definately be included in the available themes.

Posted

Which theme are you using? If it's one of the themes that I have modified then try it again because I have posted several revisions.

this un. its modified (only by color and font) of the one you had.

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
Created by SciTEConfig
# 11/26/2010
font.base=font:Verdana,size:11,$(font.override)
font.monospace=font:Andale Mono,size:11
font.small=font:Andale Mono,size:9

strip.trailing.spaces=1
ensure.final.line.end=1
ensure.consistent.line.ends=1
find.replace.advanced=1
find.close.on.find=0
two.phase.draw=1
proper.case=1
check.updates.scite4autoit3=1
use.tabs=1
tabsize=4
toolbar.visible=0
save.on.deactivate=1
save.all.for.build=1
save.session=1
reload.preserves.undo=1
full.screen.hides.menu=1
tabbar.hide.one=1
indent.size.au3=4
view.indentation.guides=0
view.indentation.whitespace=0
are.you.sure=0
edge.mode=1
title.full.path=2

# Editor ======================================================
# Background
style.au3.32=back:#000000

# Brace
style.au3.34=fore:#F3DB2E,bold # Matching
style.au3.35=fore:#FB0000,bold # Non-Matching

# Caret
caret.width=3
caret.period=300
caret.fore=#C1CBD2
caret.line.back=#000000
caret.line.back.alpha=75

# Selection
selection.fore=#FF8000
selection.back=#000000
selection.alpha=75

# White space
style.au3.0=fore:#E0E2E4,bold
# Comment line
style.au3.1=fore:#80FF80,bold
# Comment block
style.au3.2=fore:#80FF80,bold
# Number
style.au3.3=fore:#FFCD22,bold
# Function
style.au3.4=fore:#A65300,italics,bold
# Keyword
style.au3.5=fore:#FF8000,bold
# Macro
style.au3.6=fore:#FF00FF,italics
# String
style.au3.7=fore:#9B9B9B,bold
# Operator
style.au3.8=fore:#FFB164,bold
# Variable
style.au3.9=fore:#B00000,bold
# Sent keys
style.au3.10=fore:#E0E2E4,bold
# Pre-Processor
style.au3.11=fore:#FF7979,bold
# Special
style.au3.12=fore:#E0E2E4,italics,bold
# Abbrev-Expand
style.au3.13=fore:#E0E2E4,bold
# Com Objects
style.au3.14=fore:#E0E2E4,bold
# Standard UDFs
style.au3.15=fore:#0080FF,bold
# =============================================================

# Margins =====================================================
# Fold Margin
fold.symbols=2
fold.margin.colour=#000000
fold.margin.highlight.colour=#000000
fold.compact=0
fold.margin.width=12

# Line Number Margin
style.au3.33=$(font.monospaced),fore:#FF8000,back:#000000
line.margin.visible=1
line.margin.width=1+

# Selection Margin
margin.width=10
# =============================================================

# Console =====================================================
output.initial.hide=1

error.marker.fore=#DADADA
error.marker.back=#000000

# Console Background
style.errorlist.32=$(font.monospace),back:#000000

# Error Output
style.errorlist.0=fore:#FF0000

# Program Output
style.errorlist.1=fore:#FF8000

# Error Line
style.errorlist.3=fore:#FF0000

# command or return status
style.errorlist.4=fore:#FFF000

# Diff changed !
style.errorlist.10=fore:#FF8000

# Diff addition +
style.errorlist.11=fore:#FF8000

# Diff deletion -
style.errorlist.12=fore:#FF00FF

# unused?
# gcc Error
style.errorlist.2=fore:#0000FF
# Borland error and warning messages
style.errorlist.5=fore:#0000FF
# perl error and warning messages
style.errorlist.6=fore:#0000FF
# .NET tracebacks
style.errorlist.7=fore:#0000FF
# Lua error and warning messages
style.errorlist.8=fore:#0000FF
# ctags
style.errorlist.9=fore:#0000FF
# diff message ---
style.errorlist.13=fore:#DADADA
# PHP error
style.errorlist.14=fore:#0000FF
# Essential Lahey Fortran 90 error
style.errorlist.15=fore:#0000FF
# Intel Fortran Compiler error
style.errorlist.16=fore:#0000FF
# Intel Fortran Compiler v8.0 error/warning
style.errorlist.17=fore:#0000FF
# Absoft Pro Fortran 90/95 v8.2 error or warning
style.errorlist.18=fore:#0000FF
# HTML Tidy
style.errorlist.19=fore:#0000FF
# Java runtime stack trace
style.errorlist.20=fore:#0000FF
# Text matched with find in files and message part of GCC errors
style.errorlist.21=fore:#0000FF

# The following are unknown to me.  If you have any information please let me know.
style.errorlist.22=fore:#0000FF # ???
style.errorlist.23=fore:#0000FF # ???
style.errorlist.24=fore:#0000FF # ???
style.errorlist.25=fore:#0000FF # ???
style.errorlist.26=fore:#0000FF # ???
style.errorlist.27=fore:#0000FF # ???
style.errorlist.28=fore:#0000FF # ???
style.errorlist.29=fore:#0000FF # ???
style.errorlist.30=fore:#0000FF # ???
style.errorlist.31=fore:#0000FF # ???
# =============================================================

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
Posted

This is a slightly modified UnCognitive theme. Still working on it, but suggestions welcome!

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# START: DO NOT CHANGE ANYTHING AFTER THIS LINE     #-#-#-#-#
# UnCognitive by JamesBrooks 2010
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
font.base=font:Verdana,size:10,$(font.override)
font.monospace=font:Courier New,size:10
proper.case=1
check.updates.scite4autoit3=0
use.tabs=1
indent.size=4
indent.size.*.au3=4
tabsize=4
#Background
style.au3.32=style.*.32=$(font.base),back:#F0F4F9
#CaretLineBackground
caret.line.back=#FFFED8
# Brace highlight
style.au3.34=fore:#0000FF,back:#F0F4F9
# Brace incomplete highlight
style.au3.35=fore:#009933,back:#F0F4F9
#White space
style.au3.0=fore:#000000,back:#F0F4F9
#Comment line
style.au3.1=fore:#009933,back:#F0F4F9
#Comment block
style.au3.2=fore:#009933,back:#F0F4F9
#Number
style.au3.3=fore:#000000,back:#F0F4F9
#Function
style.au3.4=fore:#000000,back:#F0F4F9
#Keyword
style.au3.5=fore:#000000,bold,back:#F0F4F9
#Macro
style.au3.6=fore:#000000,back:#F0F4F9
#String
style.au3.7=fore:#000000,back:#F0F4F9
#Operator
style.au3.8=fore:#CC3300,back:#F0F4F9
#Variable
style.au3.9=fore:#000000,back:#F0F4F9
#Sent keys
style.au3.10=fore:#000000,back:#F0F4F9
#Pre-Processor
style.au3.11=fore:#000000,back:#F0F4F9
#Special
style.au3.12=fore:#000000,back:#F0F4F9
#Abbrev-Expand
style.au3.13=fore:#000000,back:#F0F4F9
#Com Objects
style.au3.14=fore:#5c5c5c,back:#F0F4F9
#Standard UDF's
style.au3.15=fore:#000000,back:#F0F4F9
# END => DO NOT CHANGE ANYTHING BEFORE THIS LINE  #-#-#-#-#-#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
Posted

nope, i still got a white line. (sigh)

Try setting the edge.column to something that you'll not likely see very often. I have mine set to 10,000. The edge.mode setting doesn't seem to work as intended. This will cause the EOL indicator to be at column position 10000 and unless you have some seriously long lines, it's doubtful many will ever see it.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

it is apparently still there. :\

Posted

I found out that there's a Lua script that gets called when SciTE starts that overrides the edge.mode setting. It's called EdgeMode.lua, and you can disable running it by opening the Scitestartup.lua file and commenting out line 34 (in my copy of it) which loads the EdgeMode.lua script at Scite start up.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

  • 5 months later...
Posted (edited)

TEST

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=SciTEConfig.ico
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=Configure SciTE settings For AutoIt3
#AutoIt3Wrapper_Res_Description=Configure SciTE settings For AutoIt3
#AutoIt3Wrapper_Res_Fileversion=1.6.7.6
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=Copyright © 2009 Jos van der Zande
://////=__=
://////=__=
://////=__=
://////=__=
#AutoIt3Wrapper_Run_After=copy "%in%" "..\..\Programs_Updates\SciTEConfig\*.*"
#AutoIt3Wrapper_Run_After=copy "%out%" "..\..\Programs_Updates\SciTEConfig\*.*"
#AutoIt3Wrapper_Run_After=copy "%out%" "C:\Program Files (x86)\AutoIt3\SciTE\SciTEConfig\*.*"
#AutoIt3Wrapper_Run_After=copy "%in%" "C:\Program Files (x86)\AutoIt3\SciTE\SciTEConfig\*.*"
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=0 /cn=0 /cf=0 /cv=0 /sf=1
#AutoIt3Wrapper_Run_cvsWrapper=v
#AutoIt3Wrapper_cvsWrapper_Parameters=/Comments %fileversion%
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
;
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <Date.au3>
#include <file.au3>

#include <Array.au3>
;
Global $AutoIT3_Dir = ""
#region Commandline lexing
; retrieve commandline parameters
;-------------------------------------------------------------------------------------------
For $x = 1 To $CMDLINE[0]
    $T_Var = StringLower($CMDLINE[$x])
    Select
        Case $T_Var = "/Autoit3Dir"
            $x = $x + 1
            If FileExists($CMDLINE[$x]) Then $AutoIT3_Dir = $CMDLINE[$x]
    EndSelect
Next
#endregion Commandline lexing
;
; determine the SciTE and AutoIt3 Directories
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $AutoIT3_Dir = ' & $AutoIT3_Dir & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
If $AutoIT3_Dir = "" Or Not FileExists($AutoIT3_Dir) Then
    ; save current dir
    $S_CurDir = @WorkingDir
    ; set directory to obfuscator directory
    FileChangeDir(@ScriptDir)
    If FileExists(@ScriptDir & "\Autoit3.exe") Then
        $AutoIT3_Dir = @ScriptDir
    Else
        FileChangeDir("..")
        If FileExists("Autoit3.exe") Then
            $AutoIT3_Dir = @WorkingDir
        Else
            FileChangeDir("..")
            If FileExists("Autoit3.exe") Then
                $AutoIT3_Dir = @WorkingDir
            Else
                $AutoIT3_Dir = RegRead("HKLM\Software\AutoIt v3\Autoit", 'InstallDir')
            EndIf
        EndIf
    EndIf
    ; Restore saved current directory
    FileChangeDir($S_CurDir)
EndIf
;
;
; Find SciTE Directory
Global $SciTE_Dir = ""
If FileExists(@ScriptDir & "\SciTE.exe") Then
    $SciTE_Dir = @ScriptDir
Else
    ; save current dir
    $S_CurDir = @WorkingDir
    FileChangeDir(@ScriptDir & "\..")
    If FileExists("SciTE.exe") Then
        $SciTE_Dir = @WorkingDir
    Else
        $SciTE_Dir = RegRead('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\SciTE.exe', '')
        $SciTE_Dir = StringLeft($SciTE_Dir, StringInStr($SciTE_Dir, "\", '', -1) - 1)
    EndIf
    ; Restore saved current directory
    FileChangeDir($S_CurDir)
EndIf
;
If Not FileExists($SciTE_Dir) Then
    MsgBox(0 + 16 + 262144, "SciTEConfig", "Stopping SciTEConfig because cannot find SciTE.exe.")
    Exit
EndIf
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $AutoIT3_Dir = ' & $AutoIT3_Dir & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $SciTE_Dir = ' & $SciTE_Dir & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
;
;

Global $VERSION = FileGetVersion(@ScriptFullPath)
$VERSION = StringLeft($VERSION, StringInStr($VERSION, ".", 0, -1) - 1)
;$VERSION = "1.3.0"
; Check if updates are available...
If StringInStr($cmdlineraw, "/CheckUpdates") Then
    CheckForUpdates(1)
    Exit
EndIf
;
; Get SciTE DirectorHandle
Opt("WinSearchChildren", 1)
;Global $WM_COPYDATA = 74
Global $SciTECmd
Global $SciTE_hwnd = WinGetHandle("DirectorExtension")
If @error Then
    MsgBox(0 + 16 + 262144, "SciTEConfig", "Stopping SciTEConfig because SciTE isn't running.")
    Exit ;exit when Scite isn't running
EndIf
; Get My GUI Handle numeric
Global $My_Hwnd = GUICreate("SciTE interface", 300, 620, Default, Default, Default, $WS_EX_TOPMOST)
$list = GUICtrlCreateEdit("", 1, 1, 290, 590)
$My_Dec_Hwnd = Dec(StringTrimLeft($My_Hwnd, 2))
;Register COPYDATA message.
GUIRegisterMsg($WM_COPYDATA, "MY_WM_COPYDATA")
;
FileChangeDir($AutoIT3_Dir)
;
AutoItWinSetTitle("SciTE_Config_Window")
$Ahnd = WinGetHandle(AutoItWinGetTitle())
;WinShow(AutoItWinGetTitle(),"",@SW_RESTORE)
; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------
$FontType = '"Courier New"'
$FontSize = "10"
Opt("GUICoordMode", 1)
GUICreate("SciTE Config for AutoIt3. ver:" & $VERSION, 410, 690, Default, Default, Default, $WS_EX_TOPMOST)
Global $Background_Color = ""
Global $CaretLine_Color = ""
Global $Console_BGColor = ""
Global $ErrorOutput_Color = ""
Global $ProgramOutput_Color = ""
Global $ErrorLine_Color = ""
Global $Diff_excl_Color = ""
Global $Diff_plus_Color = ""
Global $Diff_minus_Color = ""
Global $Backups = 0
Global $ProperCase = 1
Global $CheckuUpdatesSciTE4AutoIt3 = 0
Global $Use_Tabs = 1
Global $Tab_Size = 4
Global $Syn_Label[25]
Global $Syn_bColor[25]
Global $Syn_bColor_Default[25]
Global $Syn_fColor[25]
Global $Syn_Bold[25]
Global $Syn_Italic[25]
Global $Syn_Underline[25]
Global $H_ProperCase
Global $H_CheckUpdatesSciTE4AutoIt3
Global $H_Use_Tabs
Global $H_Tab_Size
Global $H_Syn_Label[25]
Global $H_Syn_bColor[25]
Global $H_Syn_bColor_Standard[25]
Global $H_Syn_fColor[25]
Global $H_Syn_Bold[25]
Global $H_Syn_Italic[25]
Global $H_Syn_Underline[25]
Dim $x

Global Const $errorlist[7] = [0, 1, 3, 4, 10, 11, 12]
Global $i = 0

;
$BaseX = 30
$BaseY = 40
$h_tab = GUICtrlCreateTab(10, 10, 390, 645)
$h_tab0 = GUICtrlCreateTabItem("General Settings")
GUICtrlCreateGroup("Explorer AU3 File setting.", $BaseX, $BaseY, 340, 55)
GUICtrlCreateLabel('Choose Default action for Au3 files:', $BaseX + 10, $BaseY + 15)
$h_Edit = GUICtrlCreateRadio('Edit', $BaseX + 190, $BaseY + 15, 50, 15)
$h_Run = GUICtrlCreateRadio('Run', $BaseX + 190, $BaseY + 35, 50, 15)
$read = RegRead('HKEY_CLASSES_ROOT\AutoIt3Script\Shell', '')
If $read = 'Edit' Or $read = 'Open' Then
    GUICtrlSetState($h_Edit, $GUI_CHECKED)
Else
    GUICtrlSetState($h_Run, $GUI_CHECKED)
EndIf
$SYN_Font_Mono_ON = 1
$SYN_Font_Mono_Size = 8
$SYN_Font_Mono_Type = "Courier New"
$SYN_Font_Prop_Size = 8
$SYN_Font_Prop_Type = "Arial"
Get_Current_config()
;
$BaseY = 105
GUICtrlCreateGroup("General settings", $BaseX, $BaseY, 340, 80)
GUICtrlCreateLabel("Keep n BAK versions of the edited file (0=None):", $BaseX + 10, $BaseY + 15, 230, 20)
$h_Backups = GUICtrlCreateInput($Backups, $BaseX + 245, $BaseY + 12, 25, 20)
$H_ProperCase = GUICtrlCreateCheckbox("Auto Propercase Functions and Keywords.", $BaseX + 10, $BaseY + 30)
$H_CheckUpdatesSciTE4AutoIt3 = GUICtrlCreateCheckbox("Check daily for Updates of SciTE4AutoIT3.", $BaseX + 10, $BaseY + 50)
;
$BaseY = 195
GUICtrlCreateGroup("Loaded AutoIt3 definitions:", $BaseX, $BaseY, 340, 60)
$Pver = IniRead($SciTE_Dir & "\defs\versioninfo.ini", "Version", "Production", "?")
$h_PLoaded = GUICtrlCreateRadio('Production: ' & $Pver & "", $BaseX + 10, $BaseY + 15, 250, 15)
$Bver = IniRead($SciTE_Dir & "\defs\versioninfo.ini", "Version", "Beta", "?")
$h_BLoaded = GUICtrlCreateRadio('BETA: ' & $Bver & "", $BaseX + 10, $BaseY + 35, 250, 15)
If FileGetSize($SciTE_Dir & "\properties\au3.keywords.properties") = FileGetSize($SciTE_Dir & "\Defs\Production\au3.keywords.properties") Then
    GUICtrlSetState($h_PLoaded, $GUI_CHECKED)
Else
    GUICtrlSetState($h_BLoaded, $GUI_CHECKED)
EndIf
;
$BaseY = 265
GUICtrlCreateGroup("AutoIt3 Directory settings:", $BaseX, $BaseY, 340, 80)
GUICtrlCreateLabel("AutoIt3Dir=" & $AutoIT3_Dir, $BaseX + 10, $BaseY + 18, 300, 20)
$UserIncludeDirectory = RegRead("HKEY_CURRENT_USER\SOFTWARE\AutoIt v3\AutoIt", "Include")
If $UserIncludeDirectory = "" Then $UserIncludeDirectory = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Include")
GUICtrlCreateLabel("User Include Dir:", $BaseX + 10, $BaseY + 35, 80, 20)
$h_UserIncludeDirectory = GUICtrlCreateInput($UserIncludeDirectory, $BaseX + 10, $BaseY + 50, 300, 20)
$h_UserIncludeDirectory_Button = GUICtrlCreateButton("...", $BaseX + 315, $BaseY + 50, 20, 20)
;
$BaseY = 350
GUICtrlCreateGroup("AU3 Font settings", $BaseX, $BaseY, 340, 100)
$H_Syn_Mono_Change = GUICtrlCreateButton("Change", $BaseX + 10, $BaseY + 15, 50, 20)
$H_Syn_Mono = GUICtrlCreateCheckbox("Monospace Font:" & $SYN_Font_Mono_Type, $BaseX + 70, $BaseY + 15, 220, 20)
$H_Syn_Mono_Size = GUICtrlCreateLabel("Size:" & $SYN_Font_Mono_Size, $BaseX + 290, $BaseY + 17, 40, 20)
$H_Syn_Prop_Change = GUICtrlCreateButton("Change", $BaseX + 10, $BaseY + 45, 50, 20)
$H_Syn_Prop = GUICtrlCreateCheckbox("Proportional Font:" & $SYN_Font_Prop_Type, $BaseX + 70, $BaseY + 45, 220, 20)
$H_Syn_Prop_Size = GUICtrlCreateLabel("Size:" & $SYN_Font_Prop_Size, $BaseX + 290, $BaseY + 47, 40, 20)
If $SYN_Font_Mono_ON = 1 Then
    GUICtrlSetState($H_Syn_Mono, 1)
    GUICtrlSetState($H_Syn_Prop, 4)
    $SYN_Font_Type = $SYN_Font_Mono_Type
    $SYN_Font_Size = $SYN_Font_Mono_Size
Else
    GUICtrlSetState($H_Syn_Mono, 4)
    GUICtrlSetState($H_Syn_Prop, 1)
    $SYN_Font_Type = $SYN_Font_Prop_Type
    $SYN_Font_Size = $SYN_Font_Prop_Size
EndIf
;
$H_Use_Tabs = GUICtrlCreateCheckbox("Use Tabs", $BaseX + 10, $BaseY + 70)
GUICtrlCreateLabel("Tab Size:", $BaseX + 100, $BaseY + 73, 60, 20)
$H_Tab_Size = GUICtrlCreateInput($Tab_Size, $BaseX + 155, $BaseY + 73, 20, 20)
;
; Color Tab
$h_tab1 = GUICtrlCreateTabItem("Color Settings")
$BaseY = 60
;determine current loaded definition files for SciTE
;$BaseY = 148
$H_Background_Label = GUICtrlCreateLabel("Background Color:" & StringLower($Background_Color), $BaseX + 5, $BaseY - 20, 150, 20)
$H_CaretLine_Label = GUICtrlCreateLabel("Caret line Color:" & StringLower($CaretLine_Color), $BaseX + 5, $BaseY, 150, 20)
$H_Console_Label = GUICtrlCreateLabel("Console BGColor:" & StringLower($Console_BGColor), $BaseX + 5, $BaseY + 20, 150, 20)
$H_Background_Color = GUICtrlCreateButton("BackGround", $BaseX + 170, $BaseY - 20, 80, 20)
$H_CaretLine_Color = GUICtrlCreateButton("CaretLine", $BaseX + 170, $BaseY, 80, 20)
$H_Console_BGColor = GUICtrlCreateButton("ConsoleBG", $BaseX + 170, $BaseY + 20, 80, 20)
$BaseY = $BaseY + 50
GUICtrlCreateLabel("B", $BaseX + 170, $BaseY, 20, 20)
GUICtrlSetFont(-1, $SYN_Font_Size, 900, 0, $SYN_Font_Type)
GUICtrlCreateLabel("I", $BaseX + 195, $BaseY, 20, 20)
GUICtrlSetFont(-1, $SYN_Font_Size, 400, 2, $SYN_Font_Type)
GUICtrlCreateLabel("U", $BaseX + 220, $BaseY, 20, 20)
GUICtrlSetFont(-1, $SYN_Font_Size, 400, 4, $SYN_Font_Type)
GUICtrlCreateLabel("Default BackColor", $BaseX + 280, $BaseY - 10, 50, 30)
For $x = 1 To 24
    $H_Syn_Label[$x] = GUICtrlCreateLabel($Syn_Label[$x], $BaseX + 5, $BaseY + 20 * $x, 150, 20)
    $H_Syn_Bold[$x] = GUICtrlCreateCheckbox("", $BaseX + 170, $BaseY + 20 * $x, 20, 20)
    $H_Syn_Italic[$x] = GUICtrlCreateCheckbox("", $BaseX + 195, $BaseY + 20 * $x, 20, 20)
    $H_Syn_Underline[$x] = GUICtrlCreateCheckbox("", $BaseX + 220, $BaseY + 20 * $x, 20, 20)
    $H_Syn_fColor[$x] = GUICtrlCreateButton("Fore", $BaseX + 245, $BaseY + 20 * $x, 40, 20)
    $H_Syn_bColor_Standard[$x] = GUICtrlCreateCheckbox("", $BaseX + 295, $BaseY + 20 * $x, 20, 20)
    $H_Syn_bColor[$x] = GUICtrlCreateButton("Back", $BaseX + 320, $BaseY + 20 * $x, 40, 20)
Next

Update_Window()
;~ $H_Update = GUICtrlCreateButton("Update", 60, 442, 70)
;~ GUICtrlSetTip(-1, "Save all Color changes made to SciTEUser.properties")
;~ $H_Cancel = GUICtrlCreateButton("Cancel", 150, 415)
;~ GUICtrlSetTip(-1, "Exit and ignore all Color changes made")
$H_Reset = 0
;$H_Reset = GUICtrlCreateButton("Reset", 160, 520, 70)
;GUICtrlSetTip(-1, "Revert to last saved Color configuration.")
;~ $H_NewScheme = GUICtrlCreateButton("Remove", 260, 442, 70)
;~ GUICtrlSetTip(-1, "Remove personal Color settings from SciTEUser.properties")
;
#region - Tools
; Need these variables declared for the message loop
Global $file_au3properties, $h_treeview
If FileExists($AutoIT3_Dir & '\SciTE\Properties\au3.properties') Then
    Global $file_au3properties = $AutoIT3_Dir & '\SciTE\Properties\au3.properties'
    Global $comment = '#~ '
    $split = SciteToolsFileRead($file_au3properties)
    If @error Then
        ConsoleWrite('Error: FileRead ' & $file_au3properties & @CRLF)
    Else
        Global $checkbox[$split[0] + 1]
        ; Create the Tools selection Tab
        $h_tab2 = GUICtrlCreateTabItem("Tools Selection")
        GUICtrlCreateLabel("Select items to enable or disable from Scite's Tools menu", 40, 50, 330)
        GUICtrlSetFont(Default, 9)
        $h_treeview = GUICtrlCreateTreeView(16, 80, 375, 385, BitOR($TVS_CHECKBOXES, $TVS_DISABLEDRAGDROP, $TVS_LINESATROOT), $WS_EX_CLIENTEDGE)
        ; Create the TreeView Checkboxes
        For $i = 1 To $split[0]
            $checkbox_ini_data = IniRead(@ScriptDir & '\SciteTools.ini', 'Tools Selection Tab', $i, '')
            If $checkbox_ini_data <> '' Then
                If StringLeft($checkbox_ini_data, 4) = '#~ #' Then
                    $checkbox_text = StringTrimLeft($split[$i], 5)
                    $checkbox[$i] = GUICtrlCreateTreeViewItem($checkbox_text, $h_treeview)
                    GUICtrlSetState($checkbox[$i], $GUI_UNCHECKED)
                Else
                    $checkbox_text = StringTrimLeft($split[$i], 2)
                    $checkbox[$i] = GUICtrlCreateTreeViewItem($checkbox_text, $h_treeview)
                    GUICtrlSetState($checkbox[$i], $GUI_CHECKED)
                EndIf
                ContinueLoop
            EndIf
            If StringLeft($split[$i], 3) = $comment Then
                $checkbox_text = StringTrimLeft($split[$i], 5)
                $checkbox[$i] = GUICtrlCreateTreeViewItem($checkbox_text, $h_treeview)
                GUICtrlSetState($checkbox[$i], $GUI_UNCHECKED)
            Else
                $checkbox_text = StringTrimLeft($split[$i], 2)
                $checkbox[$i] = GUICtrlCreateTreeViewItem($checkbox_text, $h_treeview)
                GUICtrlSetState($checkbox[$i], $GUI_CHECKED)
            EndIf
        Next
    EndIf
EndIf
#endregion - Tools

GUICtrlCreateTabItem("") ; end tabitem definition
$H_Update = GUICtrlCreateButton("Update", 10, 660, 70)
GUICtrlSetTip(-1, "Show changes in SciTE and save to SciTEUser.properties")
$H_NewScheme = GUICtrlCreateButton("New Scheme", 90, 660, 70)
GUICtrlSetTip(-1, "Select a new Color&Font Scheme.")
GUICtrlSetState($H_NewScheme, $GUI_HIDE)
$H_Exit = GUICtrlCreateButton("Exit", 170, 660, 50)
$H_SciTE4AutoIT3Updates = GUICtrlCreateButton("Check for SciTE4Autoit3 Updates", 230, 660, 170)
GUICtrlSetTip(-1, "Check for available update for SciTE4AutoIT3")

GUISetState(@SW_SHOW)
; Process GUI Input
;-------------------------------------------------------------------------------------------
While 1
    $rc = GUIGetMsg()
    ;Sleep(10)
    If $rc = $H_Exit Or $rc = -3 Then Exit
    If $rc <= 0 Then ContinueLoop
    ; Cancel clicked
    Select
        Case $rc = $h_tab
            If GUICtrlRead($h_tab) = 1 Then
                GUICtrlSetState($H_NewScheme, $GUI_SHOW)
            Else
                GUICtrlSetState($H_NewScheme, $GUI_HIDE)
            EndIf
        Case $rc = $H_Update
            SciteToolsFileWrite($file_au3properties)
            Update_SciTE_User(1)
            Reload_Config()
            MsgBox(262144 + 48, "SciTE config", "Updated Configuration")
            ;
        Case $rc = $H_Reset
            If 6 = MsgBox(4 + 262144, 'SciTE Config', 'Reset to last saved setting?') Then
                Get_Current_config()
                Update_Window()
                MsgBox(4096, "reload done", "All settings are reloaded")
            EndIf
            ContinueLoop
            ;
        Case $rc = $H_NewScheme
            SelectNewScheme()
            ;Update_SciTE_User(0)
            Reload_Config()
            Get_Current_config()
            Update_Window()
            ContinueLoop
            ;
        Case $rc = $h_Edit
            RunReqAdmin("RegWrite('HKEY_CLASSES_ROOT\AutoIt3Script\Shell', '', 'REG_SZ', 'Open')")
;~             RegWrite('HKEY_CLASSES_ROOT\AutoIt3Script\Shell', '', 'REG_SZ', 'Open')
            ;
        Case $rc = $h_Run
            RunReqAdmin("RegWrite('HKEY_CLASSES_ROOT\AutoIt3Script\Shell', '', 'REG_SZ', 'Run')")
;~             RegWrite('HKEY_CLASSES_ROOT\AutoIt3Script\Shell', '', 'REG_SZ', 'Run')
            ;
        Case $rc = $H_ProperCase
            Update_SciTE_User(1)
            ;
        Case $rc = $H_CheckUpdatesSciTE4AutoIt3
            Update_SciTE_User(1)
            ;
        Case $rc = $h_Backups
            Update_SciTE_User(1)
            ;
        Case $rc = $h_UserIncludeDirectory
            RegWrite("HKEY_CURRENT_USER\SOFTWARE\AutoIt v3\AutoIt", "Include", "REG_SZ", GUICtrlRead($h_UserIncludeDirectory))
            If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Include") <> "" Then
;~                 RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Include", "REG_SZ", GUICtrlRead($h_UserIncludeDirectory))
                Local $T_Commands = "RegWrite('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'Include', 'REG_SZ'," & GUICtrlRead($h_UserIncludeDirectory) & ")"
                RunReqAdmin($T_Commands)
            EndIf
        Case $rc = $h_UserIncludeDirectory_Button
            GUISetState(@SW_HIDE)
            $NewDir = FileSelectFolder("Select the User Include directory:", "", 4, GUICtrlRead($h_UserIncludeDirectory))
            If @error = 0 Then
                GUICtrlSetData($h_UserIncludeDirectory, $NewDir)
                RegWrite("HKEY_CURRENT_USER\SOFTWARE\AutoIt v3\AutoIt", "Include", "REG_SZ", $NewDir)
                If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Include") <> "" Then
                    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Include", "REG_SZ", $NewDir)
                EndIf
            EndIf
            GUISetState(@SW_SHOW)
            ;
        Case $rc = $h_PLoaded
            If GUICtrlRead($h_PLoaded) = $GUI_CHECKED Then
                RunReqAdmin('RunWait("' & FileGetShortName($SciTE_Dir & "\defs\UpdateDefs.exe") & ' prod")')
;~                 RunWait(FileGetShortName($SciTE_Dir & "\defs\UpdateDefs.exe") & " prod")
            EndIf
            If FileGetSize($SciTE_Dir & "\properties\au3.keywords.properties") = FileGetSize($SciTE_Dir & "\Defs\Production\au3.keywords.properties") Then
                GUICtrlSetState($h_PLoaded, $GUI_CHECKED)
            Else
                GUICtrlSetState($h_BLoaded, $GUI_CHECKED)
            EndIf
            Reload_Config()
            ;
        Case $rc = $h_BLoaded
            If GUICtrlRead($h_BLoaded) = $GUI_CHECKED Then
                RunReqAdmin('RunWait("' & FileGetShortName($SciTE_Dir & "\defs\UpdateDefs.exe") & ' beta")')
;~                 RunWait(FileGetShortName($SciTE_Dir & "\defs\UpdateDefs.exe") & " beta")
            EndIf
            If FileGetSize($SciTE_Dir & "\au3.keywords.properties") = FileGetSize($SciTE_Dir & "\Defs\Production\au3.keywords.properties") Then
                GUICtrlSetState($h_PLoaded, $GUI_CHECKED)
            Else
                GUICtrlSetState($h_BLoaded, $GUI_CHECKED)
            EndIf
            ;
        Case $rc = $H_Use_Tabs
            $Use_Tabs = Not $Use_Tabs
            ;
        Case $rc = $H_Syn_Mono Or $rc = $H_Syn_Prop
            $SYN_Font_Mono_ON = Not $SYN_Font_Mono_ON
            Update_Window()
            ;
        Case $rc = $H_Syn_Mono_Change
            $Return = Select_Font($SYN_Font_Mono_Type, $SYN_Font_Mono_Size)
            Update_Window()
            ;
        Case $rc = $H_Syn_Prop_Change
            $Return = Select_Font($SYN_Font_Prop_Type, $SYN_Font_Prop_Size)
            Update_Window()
            ;
        Case $rc = $H_Background_Color
            $tempcolor = SelectColor($Background_Color, $Background_Color)
            If $tempcolor <> 0 Then $Background_Color = $tempcolor
            Update_Window()
            ;GUICtrlSetBkColor($H_Background_Label, $Background_Color)
            ;GUICtrlSetData($H_Background_Label, "Background Color:" & StringLower($Background_Color))
            ;
        Case $rc = $H_CaretLine_Color
            $tempcolor = SelectColor($CaretLine_Color, $CaretLine_Color)
            If $tempcolor <> 0 Then $CaretLine_Color = $tempcolor
            GUICtrlSetBkColor($H_CaretLine_Label, $CaretLine_Color)
            GUICtrlSetData($H_CaretLine_Label, "Caret line Color:" & StringLower($CaretLine_Color))
        Case $rc = $H_Console_BGColor
            $tempcolor = SelectColor($Console_BGColor, $Console_BGColor)
            If $tempcolor <> 0 Then $Console_BGColor = $tempcolor
            Update_Window()
        Case $rc = $H_SciTE4AutoIT3Updates
            CheckForUpdates(0)
    EndSelect
    ; Check if one of the checkboxes is clicked
    For $x = 1 To 24
        If $rc = $H_Syn_bColor_Standard[$x] Then
            $Syn_bColor_Default[$x] = GUICtrlRead($H_Syn_bColor_Standard[$x])
            If GUICtrlRead($H_Syn_bColor_Standard[$x]) = $GUI_CHECKED Then
                GUICtrlSetState($H_Syn_bColor[$x], $GUI_DISABLE)
                $Syn_bColor[$x] = $Background_Color
                GUICtrlSetBkColor($H_Syn_Label[$x], $Syn_bColor[$x])
            Else
                GUICtrlSetState($H_Syn_bColor[$x], $GUI_ENABLE)
            EndIf
        EndIf
        If $rc = $H_Syn_Bold[$x] Then $Syn_Bold[$x] = Not $Syn_Bold[$x]
        If $rc = $H_Syn_Italic[$x] Then $Syn_Italic[$x] = Not $Syn_Italic[$x]
        If $rc = $H_Syn_Underline[$x] Then $Syn_Underline[$x] = Not $Syn_Underline[$x]
        If $rc = $H_Syn_fColor[$x] Then
            $tempcolor = SelectColor($Syn_Label[$x], $Syn_fColor[$x])
            $Syn_fColor[$x] = $tempcolor
            GUICtrlSetColor($H_Syn_Label[$x], $Syn_fColor[$x])
        EndIf
        If $rc = $H_Syn_bColor[$x] Then
            $tempcolor = SelectColor($Syn_Label[$x], $Syn_bColor[$x])
            $Syn_bColor[$x] = $tempcolor
            GUICtrlSetBkColor($H_Syn_Label[$x], $Syn_bColor[$x])
        EndIf
        If $rc = $H_Syn_Bold[$x] Or $rc = $H_Syn_Italic[$x] Or $rc = $H_Syn_Underline[$x] Or $rc = $H_Syn_fColor[$x] Or $rc = $H_Syn_bColor[$x] Then
            GUICtrlSetFont($H_Syn_Label[$x], $SYN_Font_Size, 400 + $Syn_Bold[$x] * 200, $Syn_Italic[$x] * 2 + $Syn_Underline[$x] * 4, $SYN_Font_Type)
        EndIf
    Next
WEnd

Exit
;
;*****************************************************************************
; Update Window info
;*****************************************************************************
Func Update_Window()
    Local $x
    GUICtrlSetData($H_Syn_Mono, "Monospace Font:" & $SYN_Font_Mono_Type)
    GUICtrlSetData($H_Syn_Prop, "Proportional Font:" & $SYN_Font_Prop_Type)
    GUICtrlSetData($H_Syn_Mono_Size, "Size:" & $SYN_Font_Mono_Size)
    GUICtrlSetData($H_Syn_Prop_Size, "Size:" & $SYN_Font_Prop_Size)
    If $ProperCase = 1 Then
        GUICtrlSetState($H_ProperCase, 1)
    Else
        GUICtrlSetState($H_ProperCase, 4)
    EndIf
    If $CheckuUpdatesSciTE4AutoIt3 = 1 Then
        GUICtrlSetState($H_CheckUpdatesSciTE4AutoIt3, 1)
    Else
        GUICtrlSetState($H_CheckUpdatesSciTE4AutoIt3, 4)
    EndIf
    If $SYN_Font_Mono_ON = 1 Then
        GUICtrlSetState($H_Syn_Mono, 1)
        GUICtrlSetState($H_Syn_Prop, 4)
        $SYN_Font_Type = $SYN_Font_Mono_Type
        $SYN_Font_Size = $SYN_Font_Mono_Size
    Else
        GUICtrlSetState($H_Syn_Mono, 4)
        GUICtrlSetState($H_Syn_Prop, 1)
        $SYN_Font_Type = $SYN_Font_Prop_Type
        $SYN_Font_Size = $SYN_Font_Prop_Size
    EndIf
    If $Use_Tabs = 1 Then
        GUICtrlSetState($H_Use_Tabs, 1)
    Else
        GUICtrlSetState($H_Use_Tabs, 4)
    EndIf
    GUICtrlSetBkColor($H_Background_Label, $Background_Color)
    GUICtrlSetBkColor($H_Console_Label, $Console_BGColor)
    GUICtrlSetBkColor($H_CaretLine_Label, $CaretLine_Color)
    For $x = 1 To 24
        GUICtrlSetColor($H_Syn_Label[$x], $Syn_fColor[$x])
        If $Syn_bColor_Default[$x] = $GUI_CHECKED Then
            $Syn_bColor[$x] = $Background_Color
            GUICtrlSetState($H_Syn_bColor_Standard[$x], $GUI_CHECKED)
            GUICtrlSetState($H_Syn_bColor[$x], $GUI_DISABLE)
        Else
            GUICtrlSetState($H_Syn_bColor[$x], $GUI_UNCHECKED)
            GUICtrlSetState($H_Syn_bColor[$x], $GUI_ENABLE)
        EndIf
        GUICtrlSetBkColor($H_Syn_Label[$x], $Syn_bColor[$x])
        GUICtrlSetFont($H_Syn_Label[$x], $SYN_Font_Size, 400 + $Syn_Bold[$x] * 200, $Syn_Italic[$x] * 2 + $Syn_Underline[$x] * 4, $SYN_Font_Type)
        If $Syn_Bold[$x] Then
            GUICtrlSetState($H_Syn_Bold[$x], 1)
        Else
            GUICtrlSetState($H_Syn_Bold[$x], 4)
        EndIf
        If $Syn_Italic[$x] Then
            GUICtrlSetState($H_Syn_Italic[$x], 1)
        Else
            GUICtrlSetState($H_Syn_Italic[$x], 4)
        EndIf
        If $Syn_Underline[$x] Then
            GUICtrlSetState($H_Syn_Underline[$x], 1)
        Else
            GUICtrlSetState($H_Syn_Underline[$x], 4)
        EndIf
    Next
EndFunc   ;==>Update_Window
;
Func Get_Current_config()
    Local $z, $y, $x

    ; Init background colors
    $Background_Color = "0xffffff"
    $CaretLine_Color = "0xFF0000"
    $Console_BGColor = "0xffffff"

    ; init array
    For $z = 1 To 24
        $Syn_fColor[$z] = "0x000000"
        $Syn_bColor[$z] = ""
        $Syn_Bold[$z] = 0
        $Syn_Italic[$z] = 0
        $Syn_Underline[$z] = 0
    Next

    $Backups = Number(SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:backup.files"))
    $ProperCase = Number(SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:proper.case"))
    $CheckuUpdatesSciTE4AutoIt3 = Number(SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:check.updates.scite4autoit3"))
    $Use_Tabs = Number(SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:use.tabs"))
    $Tab_Size = Number(SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:tabsize"))

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.au3.32")
    If StringInStr($rest, "back:") Then
        $Background_Color = StringTrimLeft($rest, StringInStr($rest, "back:") + 4)
        $Background_Color = StringReplace($Background_Color, "#", "0X")
    EndIf
    If $Background_Color = "" Then
        $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.*.32")
        If StringInStr($rest, "back:") Then
            $Background_Color = StringTrimLeft($rest, StringInStr($rest, "back:") + 4)
            $Background_Color = StringReplace($Background_Color, "#", "0X")
        EndIf
    EndIf

    $CaretLine_Color = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:caret.line.back")
    $CaretLine_Color = StringReplace($CaretLine_Color, "#", "0X")

    ;------------------------------------------------------------------------------------------------
    ; Console Background Color
    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.errorlist.32")

    If StringInStr($rest, "back:") Then
        $Console_BGColor = StringTrimLeft($rest, StringInStr($rest, "back:") + 4)
        $Console_BGColor = StringReplace($Console_BGColor, "#", "0X")
    EndIf
    ;------------------------------------------------------------------------------------------------

    For $StyleNbr = 1 To 16
        $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.au3." & $StyleNbr - 1)
        $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
        $Syn_Italic[$StyleNbr] = 0
        $Syn_Bold[$StyleNbr] = 0
        $Syn_Underline[$StyleNbr] = 0
        For $y = 1 To $Style[0]
            If $Style[$y] = "italics" Then $Syn_Italic[$StyleNbr] = 1
            If $Style[$y] = "bold" Then $Syn_Bold[$StyleNbr] = 1
            If $Style[$y] = "underlined" Then $Syn_Underline[$StyleNbr] = 1
            If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
            If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        Next
    Next


    ; --------------------------------------------------------------------------------------------------
    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.errorlist.0")
    $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
    $StyleNbr = 17
    $Syn_Italic[$StyleNbr] = 0
    $Syn_Bold[$StyleNbr] = 0
    $Syn_Underline[$StyleNbr] = 0

    For $y = 1 To $Style[0]
        If $Style[$y] = "italics" Then $Syn_Italic[$StyleNbr] = 1
        If $Style[$y] = "bold" Then $Syn_Bold[$StyleNbr] = 1
        If $Style[$y] = "underlined" Then $Syn_Underline[$StyleNbr] = 1
        If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
    Next

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.errorlist.1")
    $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
    $StyleNbr = 18
    $Syn_Italic[$StyleNbr] = 0
    $Syn_Bold[$StyleNbr] = 0
    $Syn_Underline[$StyleNbr] = 0

    For $y = 1 To $Style[0]
        If $Style[$y] = "italics" Then $Syn_Italic[$StyleNbr] = 1
        If $Style[$y] = "bold" Then $Syn_Bold[$StyleNbr] = 1
        If $Style[$y] = "underlined" Then $Syn_Underline[$StyleNbr] = 1
        If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
    Next

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.errorlist.3")
    $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
    $StyleNbr = 19
    $Syn_Italic[$StyleNbr] = 0
    $Syn_Bold[$StyleNbr] = 0
    $Syn_Underline[$StyleNbr] = 0

    For $y = 1 To $Style[0]
        If $Style[$y] = "italics" Then $Syn_Italic[$StyleNbr] = 1
        If $Style[$y] = "bold" Then $Syn_Bold[$StyleNbr] = 1
        If $Style[$y] = "underlined" Then $Syn_Underline[$StyleNbr] = 1
        If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
    Next

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.errorlist.4")
    $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
    $StyleNbr = 20
    $Syn_Italic[$StyleNbr] = 0
    $Syn_Bold[$StyleNbr] = 0
    $Syn_Underline[$StyleNbr] = 0

    For $y = 1 To $Style[0]
        If $Style[$y] = "italics" Then $Syn_Italic[$StyleNbr] = 1
        If $Style[$y] = "bold" Then $Syn_Bold[$StyleNbr] = 1
        If $Style[$y] = "underlined" Then $Syn_Underline[$StyleNbr] = 1
        If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
    Next

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.errorlist.10")
    $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
    $StyleNbr = 21
    $Syn_Italic[$StyleNbr] = 0
    $Syn_Bold[$StyleNbr] = 0
    $Syn_Underline[$StyleNbr] = 0

    For $y = 1 To $Style[0]
        If $Style[$y] = "italics" Then $Syn_Italic[$StyleNbr] = 1
        If $Style[$y] = "bold" Then $Syn_Bold[$StyleNbr] = 1
        If $Style[$y] = "underlined" Then $Syn_Underline[$StyleNbr] = 1
        If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
    Next

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.errorlist.11")
    $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
    $StyleNbr = 22
    $Syn_Italic[$StyleNbr] = 0
    $Syn_Bold[$StyleNbr] = 0
    $Syn_Underline[$StyleNbr] = 0

    For $y = 1 To $Style[0]
        If $Style[$y] = "italics" Then $Syn_Italic[$StyleNbr] = 1
        If $Style[$y] = "bold" Then $Syn_Bold[$StyleNbr] = 1
        If $Style[$y] = "underlined" Then $Syn_Underline[$StyleNbr] = 1
        If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
    Next

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.errorlist.12")
    $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
    $StyleNbr = 23
    $Syn_Italic[$StyleNbr] = 0
    $Syn_Bold[$StyleNbr] = 0
    $Syn_Underline[$StyleNbr] = 0

    For $y = 1 To $Style[0]
        If $Style[$y] = "italics" Then $Syn_Italic[$StyleNbr] = 1
        If $Style[$y] = "bold" Then $Syn_Bold[$StyleNbr] = 1
        If $Style[$y] = "underlined" Then $Syn_Underline[$StyleNbr] = 1
        If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
    Next

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:style.au3.33")
    $Style = StringSplit(StringTrimLeft($rest, StringInStr($rest, "=")), ",")
    $StyleNbr = 24

    For $y = 1 To $Style[0]
        If StringLeft($Style[$y], 5) = "fore:" Then $Syn_fColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
        If StringLeft($Style[$y], 5) = "back:" Then $Syn_bColor[$StyleNbr] = StringReplace(StringMid($Style[$y], 6), "#", "0X")
    Next
    ; --------------------------------------------------------------------------------------------------


    ; get the windows font section
    ;font.base=font:Verdana,size:10,$(font.override)
    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:font.base")
    $param = StringSplit($rest, "=,")
    For $y = 1 To $param[0]
        If StringLeft($param[$y], 5) = "font:" Then $SYN_Font_Prop_Type = StringMid($param[$y], 6)
        If StringLeft($param[$y], 5) = "size:" Then $SYN_Font_Prop_Size = StringMid($param[$y], 6)
    Next
    ;font.monospace=font:Courier New,size:10
    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:font.monospace")
    $param = StringSplit($rest, "=,")
    For $y = 1 To $param[0]
        If StringLeft($param[$y], 5) = "font:" Then $SYN_Font_Mono_Type = StringMid($param[$y], 6)
        If StringLeft($param[$y], 5) = "size:" Then $SYN_Font_Mono_Size = StringMid($param[$y], 6)
    Next
    ;font.override=$(font.monospace)
    ;font.base=font:Verdana,size:10,$(font.override)

    $rest = SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, "askproperty:font.base")
    If StringInStr($rest, "$(font.override)") Then
        $SYN_Font_Mono_ON = 1
    Else
        $SYN_Font_Mono_ON = 0
    EndIf
    ;******************************************************************************************************
    $Syn_Label[1] = "White space"
    $Syn_Label[2] = "Comment line"
    $Syn_Label[3] = "Comment block"
    $Syn_Label[4] = "Number"
    $Syn_Label[5] = "Function"
    $Syn_Label[6] = "Keyword"
    $Syn_Label[7] = "Macro"
    $Syn_Label[8] = "String"
    $Syn_Label[9] = "Operator"
    $Syn_Label[10] = "Variable"
    $Syn_Label[11] = "Sent keys"
    $Syn_Label[12] = "Pre-Processor"
    $Syn_Label[13] = "Special"
    $Syn_Label[14] = "Abbrev-Expand"
    $Syn_Label[15] = "Com Objects"
    $Syn_Label[16] = "Standard UDF's"
    $Syn_Label[17] = "Error Output"
    $Syn_Label[18] = "Program Output"
    $Syn_Label[19] = "Error Line"
    $Syn_Label[20] = "Command status '>'"
    $Syn_Label[21] = "Diff changed '!'"
    $Syn_Label[22] = "Diff changed '+'"
    $Syn_Label[23] = "Diff changed '-'"
    $Syn_Label[24] = "Line Margin"
    ; set the default background
    For $x = 1 To 24
        If $Syn_bColor[$x] = "" Or $Syn_bColor[$x] = $Background_Color Then
;~             $Syn_bColor[$x] = $Background_Color
            $Syn_bColor_Default[$x] = $GUI_CHECKED
        EndIf
    Next
EndFunc   ;==>Get_Current_config

;*****************************************************************************
; Font Selection part
;*****************************************************************************
Func Select_Font(ByRef $FontType, ByRef $FontSize)
    Local $a_font
    GUISetState(@SW_HIDE)
    $a_font = _ChooseFont($FontType, $FontSize)
    Local $rc = @error
    GUISetState(@SW_SHOW)
    If ($rc) Then Return 0
    $FontType = $a_font[2]
    $FontSize = $a_font[3]
    Return 1
EndFunc   ;==>Select_Font

;*****************************************************************************
; Color Selection Part
;*****************************************************************************
Func SelectColor($Type, $CurColor)
    Local $color
    GUISetState(@SW_HIDE)
    $color = _ChooseColor(2, $CurColor, 2)
    Local $rc = @error
    GUISetState(@SW_SHOW)
    If ($rc) Then Return $CurColor
    Return $color
EndFunc   ;==>SelectColor

;*****************************************************************************
; Save info to SciTEUser
;*****************************************************************************
Func Update_SciTE_User($Task)
    ; Task=0 Remove settings In SciTEUser.properties
    ; Task=1 Add/Update settings In SciTEUser.properties
    Local $x, $y
    $UserDir = @UserProfileDir
    If @OSType = "WIN32_WINDOWS" Then $UserDir = $SciTE_Dir
    $au3Prop = $UserDir & "\SciTEUser.properties"
    $H_au3Prop = FileOpen($au3Prop, 0)
    $H_au3PropNew = FileOpen($au3Prop & ".New", 2)
    ;
    $SciTEConfigSec = 0
    ; copy all SciTEUser info To new SciTEuser.properties except old Settings...
    If $H_au3Prop <> -1 Then
        While 1
            $Irec = FileReadLine($H_au3Prop)
            If @error = -1 Then ExitLoop
            ;
            If $Irec = "# DO NOT CHANGE ANYTHING BETWEEN THESE LINES #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#" _
                    Or $Irec = "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#" Then
                $SciTEConfigSec = Not $SciTEConfigSec
                ContinueLoop
            EndIf
            If StringInStr($Irec, "style.au3") = 0 And StringInStr($Irec, "Font.") = 0 And $SciTEConfigSec = 0 Then
                FileWriteLine($H_au3PropNew, $Irec)
                ContinueLoop
            EndIf
        WEnd
    EndIf

    If $Task = 1 Then
        FileWriteLine($H_au3PropNew, "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#")
        FileWriteLine($H_au3PropNew, "# START: DO NOT CHANGE ANYTHING AFTER THIS LINE     #-#-#-#-#")
        FileWriteLine($H_au3PropNew, "# Created by SciTEConfig")
        FileWriteLine($H_au3PropNew, "#------------------------------------------------------------")

        If $SYN_Font_Mono_ON = 1 Then
            FileWriteLine($H_au3PropNew, "font.base=font:" & $SYN_Font_Prop_Type & ",size:" & $SYN_Font_Prop_Size & ",$(font.override)")
        Else
            FileWriteLine($H_au3PropNew, "font.base=font:" & $SYN_Font_Prop_Type & ",size:" & $SYN_Font_Prop_Size)
        EndIf
        FileWriteLine($H_au3PropNew, "font.monospace=font:" & $SYN_Font_Mono_Type & ",size:" & $SYN_Font_Mono_Size)

        ;Backup Info
        If GUICtrlRead($h_Backups) > 0 Then
            FileWriteLine($H_au3PropNew, "backup.files=" & GUICtrlRead($h_Backups))
        EndIf

        ;propercase info
        If GUICtrlRead($H_ProperCase) = 1 Then
            FileWriteLine($H_au3PropNew, "proper.case=1")
        Else
            FileWriteLine($H_au3PropNew, "proper.case=0")
        EndIf

        ;Check for updates
        If GUICtrlRead($H_CheckUpdatesSciTE4AutoIt3) = 1 Then
            FileWriteLine($H_au3PropNew, "check.updates.scite4autoit3=1")
        Else
            FileWriteLine($H_au3PropNew, "check.updates.scite4autoit3=0")
        EndIf

        ;Tabs info
        If $Use_Tabs = 1 Then
            FileWriteLine($H_au3PropNew, "use.tabs=1")
        Else
            FileWriteLine($H_au3PropNew, "use.tabs=0")
        EndIf
        $Tab_Size = GUICtrlRead($H_Tab_Size)
        If Number($Tab_Size) > 0 Then
            FileWriteLine($H_au3PropNew, "indent.size=" & $Tab_Size)
            FileWriteLine($H_au3PropNew, "indent.size.*.au3=" & $Tab_Size)
            FileWriteLine($H_au3PropNew, "tabsize=" & $Tab_Size)
        EndIf

        ; BackGround color
        FileWriteLine($H_au3PropNew, "#Background")
        $Orec = "style.au3.32=style.*.32=$(font.base)"
        If $Background_Color <> "" And $Background_Color <> "0XFFFFFF" Then $Orec = $Orec & ",back:#" & StringTrimLeft($Background_Color, 2)
        FileWriteLine($H_au3PropNew, $Orec)

        ; caretline color
        If $CaretLine_Color <> "" And $CaretLine_Color <> "0XFFFFFF" Then
            FileWriteLine($H_au3PropNew, "#CaretLineBackground")
            FileWriteLine($H_au3PropNew, "caret.line.back=#" & StringTrimLeft($CaretLine_Color, 2))
        EndIf

        ; -----------------------------------------------------------------------------------------------------------------
        ; Console background color
        FileWriteLine($H_au3PropNew, "#Console Background")
        $Orec = "style.errorlist.32=$(font.base)"
        If $Console_BGColor <> "" And $Console_BGColor <> "0XFFFFFF" Then $Orec = $Orec & ",back:#" & StringTrimLeft($Console_BGColor, 2)
        FileWriteLine($H_au3PropNew, $Orec)
        ; -----------------------------------------------------------------------------------------------------------------

        ;Write bracket color
;~ #
        FileWriteLine($H_au3PropNew, "# Brace highlight")
        $y = 6
        $Orec = "style.au3.34=fore:#" & StringTrimLeft($Syn_fColor[$y], 2)
        If $Syn_Italic[$y] Then $Orec = $Orec & ",italics"
        If $Syn_Bold[$y] Then $Orec = $Orec & ",bold"
        If $Syn_Underline[$y] Then $Orec = $Orec & ",underlined"
        If $Syn_bColor[$y] <> "" And $Syn_bColor[$y] <> "0XFFFFFF" Then $Orec = $Orec & ",back:#" & StringTrimLeft($Syn_bColor[$y], 2)
        FileWriteLine($H_au3PropNew, $Orec)

        FileWriteLine($H_au3PropNew, "# Brace incomplete highlight")
        $y = 2
        $Orec = "style.au3.35=fore:#" & StringTrimLeft($Syn_fColor[$y], 2)
        If $Syn_Italic[$y] Then $Orec = $Orec & ",italics"
        If $Syn_Bold[$y] Then $Orec = $Orec & ",bold"
        If $Syn_Underline[$y] Then $Orec = $Orec & ",underlined"
        If $Syn_bColor[$y] <> "" And $Syn_bColor[$y] <> "0XFFFFFF" Then $Orec = $Orec & ",back:#" & StringTrimLeft($Syn_bColor[$y], 2)
        FileWriteLine($H_au3PropNew, $Orec)

        For $y = 1 To 16
            ;# Comment block
            ;style.au3.2=fore:#669900,italics
            FileWriteLine($H_au3PropNew, "#" & $Syn_Label[$y])
            $Orec = "style.au3." & $y - 1 & "=fore:#" & StringTrimLeft($Syn_fColor[$y], 2)
            If $Syn_Italic[$y] Then $Orec = $Orec & ",italics"
            If $Syn_Bold[$y] Then $Orec = $Orec & ",bold"
            If $Syn_Underline[$y] Then $Orec = $Orec & ",underlined"
            ;If $Syn_bColor[$y] <> $Background_Color And $Syn_bColor[$y] <> "0XFFFFFF" Then $Orec = $Orec & ",back:#" & StringTrimLeft($Syn_bColor[$y], 2)
            $Orec = $Orec & ",back:#" & StringTrimLeft($Syn_bColor[$y], 2)
            FileWriteLine($H_au3PropNew, $Orec)
        Next

        ; ---------------------------------------------------------------------------------------------------------------------------
        ; Console colors
        $i = 0
        For $StyleNbr = 17 To 23
            FileWriteLine($H_au3PropNew, '#' & $Syn_Label[$StyleNbr])
            $Orec = "style.errorlist." & $errorlist[$i] & "=fore:#" & StringTrimLeft($Syn_fColor[$StyleNbr], 2)
            If $Syn_Italic[$StyleNbr] Then $Orec = $Orec & ",italics"
            If $Syn_Bold[$StyleNbr] Then $Orec = $Orec & ",bold"
            If $Syn_Underline[$StyleNbr] Then $Orec = $Orec & ",underlined"
            $Orec = $Orec & ",back:#" & StringTrimLeft($Syn_bColor[$StyleNbr], 2)
            FileWriteLine($H_au3PropNew, $Orec)
            $i += 1
        Next

        ; Line Margin fore and back
        $StyleNbr = 24
        FileWriteLine($H_au3PropNew, '#' & $Syn_Label[$StyleNbr])
        $Orec = "style.au3.33=fore:#" & StringTrimLeft($Syn_fColor[$StyleNbr], 2)
        If $Syn_Italic[$StyleNbr] Then $Orec = $Orec & ",italics"
        If $Syn_Bold[$StyleNbr] Then $Orec = $Orec & ",bold"
        If $Syn_Underline[$StyleNbr] Then $Orec = $Orec & ",underlined"
        $Orec = $Orec & ",back:#" & StringTrimLeft($Syn_bColor[$StyleNbr], 2)
        FileWriteLine($H_au3PropNew, $Orec)
        ; ---------------------------------------------------------------------------------------------------------------------------

        FileWriteLine($H_au3PropNew, "# END => DO NOT CHANGE ANYTHING BEFORE THIS LINE  #-#-#-#-#-#")
        FileWriteLine($H_au3PropNew, "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#")
    EndIf
    If $H_au3Prop <> -1 Then
        FileClose($H_au3Prop)
        FileMove($UserDir & "\SciTEUser.properties", $UserDir & "\SciTEUser.properties.old", 1)
    EndIf
    FileClose($H_au3PropNew)
    FileMove($UserDir & "\SciTEUser.properties.new", $UserDir & "\SciTEUser.properties", 1)
    Reload_Config()
EndFunc   ;==>Update_SciTE_User
;
Func Reload_Config()
    Opt("WinSearchChildren", 1)
    ;Send SciTE Director my GUI handle so it will report info back from SciTE
    SendSciTE_Command(0, $SciTE_hwnd, "reloadproperties:")
EndFunc   ;==>Reload_Config
;
Func Update_User_Properties($Property, $value)
    Opt("WinSearchChildren", 1)
    ; Get SciTE DirectorHandle
    $SciTE_hwnd = WinGetHandle("DirectorExtension")
    ;Send SciTE Director my GUI handle so it will report info back from SciTE
    SendSciTE_Command(0, $SciTE_hwnd, "property:user:style.au3." & $Property & "=" & $value)
EndFunc   ;==>Update_User_Properties
;
;
Func SendSciTE_GetInfo($My_Hwnd, $SciTE_hwnd, $sCmd)
    $My_Dec_Hwnd = Dec(StringTrimLeft($My_Hwnd, 2))
    $sCmd = ":" & $My_Dec_Hwnd & ":" & $sCmd
    $SciTECmd = ""
    SendSciTE_Command($My_Hwnd, $SciTE_hwnd, $sCmd)
    For $x = 1 To 10
        If $SciTECmd <> "" Then ExitLoop
        Sleep(20)
    Next
    $SciTECmd = StringTrimLeft($SciTECmd, StringLen(":" & $My_Dec_Hwnd & ":"))
    $SciTECmd = StringReplace($SciTECmd, "macro:stringinfo:", "")
    Return $SciTECmd
EndFunc   ;==>SendSciTE_GetInfo
;
Func SciTE_Update_Property($My_Hwnd, $SciTE_hwnd, $key, $value)
    $My_Dec_Hwnd = Dec(StringTrimLeft($My_Hwnd, 2))
    Local $sCmd = ":" & $My_Dec_Hwnd & ":" & "property:" & $key & "=" & $value
    SendSciTE_Command($My_Hwnd, $SciTE_hwnd, $sCmd)
EndFunc   ;==>SciTE_Update_Property
;
Func SendSciTE_Command($My_Hwnd, $SciTE_hwnd, $sCmd)
    Local $WM_COPYDATA = 74
    Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
    ;ConsoleWrite('-->' & $sCmd & @lf )
    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[255]', DllStructGetData($COPYDATA, 3))
    $SciTECmd = StringLeft(DllStructGetData($CmdStruct, 1), $SciTECmdLen)
    ;ConsoleWrite('<--' & $SciTECmd & @lf )
    ;GUICtrlSetData($list,GUICtrlRead($list) & '<--' & $SciTECmd & @CRLF )
EndFunc   ;==>MY_WM_COPYDATA

; Check for the availablility of New installers for SciTE4AutoIT3
Func CheckForUpdates($Silent = 1)
    $rc = InetGet('http://www.autoitscript.com/autoit3/scite/download/scite4autoit3version.ini', $SciTE_Dir & "\scite4autoit3versionWeb.ini", 1)
    If $rc Then
        $SciTE4AutoIt3WebDate = IniRead($SciTE_Dir & "\scite4autoit3versionWeb.ini", 'SciTE4AutoIt3', 'Date', '')
        $SciTE4Au3UpdWebDate = IniRead($SciTE_Dir & "\scite4autoit3versionWeb.ini", 'SciTE4Au3Upd', 'Date', '')
        $SciTE4AutoIt3RegDate = RegRead("HKLM\Software\Microsoft\Windows\Currentversion\Uninstall\SciTE4AutoIt3", 'DisplayVersion')
        $SciTE4AutoIt3Date = IniRead($SciTE_Dir & "\SciTEVersion.ini", 'SciTE4AutoIt3', 'Date', '')
        $SciTE4Au3UpdDate = IniRead($SciTE_Dir & "\SciTEVersion.ini", 'SciTE4Au3Upd', 'Date', '')
        ; If the INI date is blank then use the registry Date
        If $SciTE4AutoIt3Date = "" Then
            ; If registry date is empty then assume the installer is never used and thus exit.
            If $SciTE4AutoIt3RegDate = "" Then
                If $Silent = 0 Then MsgBox(0 + 262144, "SciTE4AutoIt3", "No updates available.")
                Exit
            EndIf
            $SciTE4AutoIt3Date = $SciTE4AutoIt3RegDate
            IniWrite($SciTE_Dir & "\SciTEConfig.ini", 'SciTE4AutoIt3', 'Date', $SciTE4AutoIt3Date)
        EndIf
        ; Check for updated SciTE4AutoIt3 Installer
        If $SciTE4AutoIt3WebDate <> $SciTE4AutoIt3Date Then
            $msg = "Your SciTE4AutoIt3 version is " & $SciTE4AutoIt3Date & @LF & @LF & _
                    "The latest SciTE4AutoIt3 version is " & $SciTE4AutoIt3WebDate & @LF & @LF & _
                    "Do you want to goto the SciTE4AutoIt3 Download page?"
            If MsgBox(4 + 262144, "New SciTE4AutoIt3 installer available", $msg) = 6 Then
                Run(@ComSpec & " /c start http://www.autoitscript.com/autoit3/scite/downloads.shtml", '', @SW_HIDE)
            EndIf
        Else
            ; Check for Patch updates
            If $SciTE4Au3UpdWebDate <> "" And $SciTE4Au3UpdWebDate <> $SciTE4Au3UpdDate Then
                $msg = "There is a SciTE4Au3Upd installer available dated: " & $SciTE4Au3UpdWebDate & @LF & _
                        "Do you want to goto the SciTE4AutoIt3 Download page?"
                If MsgBox(4 + 262144, "New SciTE4Au3Upd installer available", $msg) = 6 Then
                    Run(@ComSpec & " /c start http://www.autoitscript.com/autoit3/scite/downloads.shtml", '', @SW_HIDE)
                EndIf
            Else
                If $Silent = 0 Then MsgBox(262144, "SciTE4AutoIt3", "No updates available.")
            EndIf
        EndIf
    Else
        If $Silent = 0 Then MsgBox(262144, "SciTE4AutoIt3", "Not able to connect to WebSite.")
    EndIf
EndFunc   ;==>CheckForUpdates

; Tools Selection Tab related
Func SciteToolsFileRead($file_au3properties)
    Local $comment = '#~ ', $handle_read, $line, $split, $total
    ; Open Au3.properties for Read
    $handle_read = FileOpen($file_au3properties, 0)
    If $handle_read = -1 Then
        ConsoleWrite('Unable to open for read ' & $file_au3properties & @CRLF)
        Return SetError(1, 0, '')
    EndIf
    ; Read Tools headers from Au3.properties
    While True
        $line = FileReadLine($handle_read)
        If @error Then ExitLoop
        $line = StringStripWS($line, 3)
        If Not $line Then
            ContinueLoop
        ElseIf StringRegExp($line, $comment & '# [0-9]{1,2}') Or StringRegExp($line, '# [0-9]{1,2}') Then
            $total &= $line & '|'
        EndIf
    WEnd
    FileClose($handle_read)
    ; Remove last pipe char
    If StringRight($total, 1) = '|' Then
        $total = StringTrimRight($total, 1)
    EndIf
    ; Split Tools headers into an Array
    $split = StringSplit($total, '|')
    Return SetError(@error, @extended, $split)
EndFunc   ;==>SciteToolsFileRead
;
Func SciteToolsFileWrite($file_au3properties)
    ; Process Au3.properties with selections made
    Local $check, $comment = '#~ ', $debug
    Local $done, $file_temp, $handle_read, $handle_write, $i
    Local $line, $checkbox_state, $checkbox_text
    Dim $checkbox
    If Not FileExists($file_au3properties) Then Return
    $file_temp = _TempFile()
    $handle_read = FileOpen($file_au3properties, 0)
    If $handle_read = -1 Then
        ConsoleWrite('Unable to open for read ' & $file_au3properties & @LF)
        Return
    EndIf
    $handle_write = FileOpen($file_temp, 2)
    If $handle_read = -1 Then
        ConsoleWrite('Unable to open for write ' & $file_temp & @LF)
        FileClose($handle_read)
        Return
    EndIf
    ;
    While True
        $line = FileReadLine($handle_read)
        If @error Then ExitLoop
        $tline = StringStripWS($line, 3)
        Switch $tline
            Case '', '#', '##'
                ; Write line then loop again
                FileWriteLine($handle_write, $line)
                ContinueLoop
            Case '# Standard LUA Functions', 'extension.$(file.patterns.au3)=$(SciteDefaultHome)\AutoIt3.lua'
                ; Write line then loop again
                FileWriteLine($handle_write, $line)
                ContinueLoop
            Case '# Commands to for Help F1'
                ; After help line shows, then just write the rest of the file
                FileWriteLine($handle_write, $line)
                While 1
                    $line = FileReadLine($handle_read)
                    If @error Then ExitLoop 2
                    FileWriteLine($handle_write, $line)
                WEnd
                ExitLoop
            Case 'if BETA_AUTOIT' ; Skip Beta Tools
                $done = False
                FileWriteLine($handle_write, $line)
                ContinueLoop
        EndSwitch
        Switch StringRegExp($tline, '##? [0-9]{1,2}')
            Case True
                ; Found a Tools line so enable or disable it
                $done = True
                For $i = 1 To UBound($checkbox) - 1 ;$split[0]
                    $checkbox_state = GUICtrlRead($checkbox[$i])
                    $checkbox_text = GUICtrlRead($checkbox[$i], 1)
                    ; Match the the line to a TreeView item
                    If StringInStr($line, $checkbox_text) Then
                        ; Reset line status
                        $check = 0
                        If StringLeft($line, 3) = $comment Then
                            If BitAND($checkbox_state, $GUI_CHECKED) = $GUI_CHECKED Then; is commented
                                ; UnComment line
                                While StringLeft($line, 3) = $comment
                                    $line = StringTrimLeft($line, 3)
                                WEnd
                                $check = -1
                            EndIf
                        ElseIf BitAND($checkbox_state, $GUI_UNCHECKED) = $GUI_UNCHECKED Then; is not commented
                            ; Comment line
                            While Not (StringLeft($line, 3) = $comment)
                                $line = $comment & $line
                            WEnd
                            $check = 1
                        EndIf
                        IniWrite(@ScriptDir & '\SciteTools.ini', 'Tools Selection Tab', $i, $line)
                        If $debug Then
                            If $check = 1 Then
                                $debug_1 = 'Disabled '
                            ElseIf $check = -1 Then
                                $debug_1 = 'Enabled  '
                            Else
                                ExitLoop
                            EndIf
                            ConsoleWrite($debug_1 & ' ' & StringTrimLeft($checkbox_text, 3) & @LF)
                        EndIf
                        ExitLoop
                    EndIf
                Next
            Case Else
                ; Command lines for Tools which are enabled or disabled
                If $done Then
                    If $check = -1 Then
                        ; Trim comment
                        While StringLeft($line, 3) = $comment
                            $line = StringTrimLeft($line, 3)
                        WEnd
                    ElseIf $check = 1 Then
                        ; Add comment
                        While Not (StringLeft($line, 3) = $comment)
                            $line = $comment & $line
                        WEnd
                    EndIf
                EndIf
        EndSwitch
        FileWriteLine($handle_write, $line)
    WEnd
    ;
    FileClose($handle_read)
    FileClose($handle_write)
    Sleep(50)
;~     If Not FileWrite($file_au3properties, " ") Then
;~         Local $temp_Script = _TempFile(@TempDir, "~", ".au3")
;~         MsgBox(262144, "Need Admin mode", "Admin mode is needed to update au3.properties. Answer the following prompts to allow the update.")
;~         FileWriteLine($temp_Script, '#RequireAdmin')
;~         FileWriteLine($temp_Script, "FileCopy('" & $file_au3properties & "','" & $file_au3properties & "_old" & "', 1)")
;~         FileWriteLine($temp_Script, "FileDelete('" & $file_au3properties & "')")
;~         FileWriteLine($temp_Script, "FileCopy('" & $file_temp & "','" & $file_au3properties & "', 1)")
;~         FileWriteLine($temp_Script, "FileDelete('" & $file_temp & "')")
;~         RunWait('"' & @ScriptFullPath & '" /AutoIt3ExecuteScript "' & $temp_Script & '"')
;~         While FileExists($file_temp)
;~             Sleep(50)
;~         WEnd
;~         FileDelete($temp_Script)
    Local $T_Commands
    $T_Commands &= "FileCopy('" & $file_au3properties & "','" & $file_au3properties & "_old" & "', 1)" & @CRLF
    $T_Commands &= "FileDelete('" & $file_au3properties & "')" & @CRLF
    $T_Commands &= "FileCopy('" & $file_temp & "','" & $file_au3properties & "', 1)" & @CRLF
    $T_Commands &= "FileDelete('" & $file_temp & "')"
    RunReqAdmin($T_Commands)
;~     Else
;~         FileMove($file_au3properties, $file_au3properties & "_old")
;~         FileMove($file_temp, $file_au3properties, 1)
;~         FileDelete($file_temp)
;~     EndIf
EndFunc   ;==>SciteToolsFileWrite

Func SelectNewScheme()
    ; Task=0 Remove settings In SciTEUser.properties
    ; Task=1 Add/Update settings In SciTEUser.properties
    ; Find all default scheme's
    Local $Schemes = " [NoChange]"
    Local $s_name
    Local $search = FileFindFirstFile(@ScriptDir & "\*.SciTEConfig")
    Local $SaveUserSettings = ""
    ; Check if the search was successful
    If $search = -1 Then
        ; No default schema's found so just remove the personal settings and revert to the au3.properties.
        If 6 = MsgBox(4 + 262144, 'SciTE Config', 'There are no *.SciTEConfig files available, do you want to Remove the user settings and revert to the standard SciTE4AutoIt3 setting?') Then
            Update_SciTE_User(0)
        EndIf
        Return
    EndIf
    ;
    While 1
        $file = FileFindNextFile($search)
        If @error Then ExitLoop
        $s_name = StringMid(FileReadLine(@ScriptDir & "\" & $file, 3), 3)
        If StringLeft($file, 2) = "[L" Then
            $Schemes &= "| " & StringReplace($file, ".SciteConfig", "") & " ==> Last modified User Settings"
        Else
            $Schemes &= "|" & StringReplace($file, ".SciteConfig", "") & " ==> " & $s_name
        EndIf
    WEnd
    ;
    FileClose($search)
    ;
    $gui2 = GUICreate("Select new default Color/Font Scheme", 500, 100, -1, -1, $WS_CAPTION, $WS_EX_TOPMOST)
    GUICtrlCreateLabel("Select new default Color/Font Scheme.", 30, 10)
    $h_Scheme = GUICtrlCreateCombo("", 30, 35, 460, 80, $CBS_DROPDOWN + $CBS_AUTOHSCROLL + $WS_VSCROLL + $CBS_SORT)
    GUICtrlSetData(-1, $Schemes, " [NoChange]")
    Local $h_Ok = GUICtrlCreateButton("Ok", 155, 60, 80, 33, 0)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    Local $h_Cancel = GUICtrlCreateButton("Cancel", 265, 60, 80, 33, 0)
    GUISetState(@SW_SHOW, $gui2)
    Local $rc
    While 1
        $nMsg = GUIGetMsg()
        Select
            Case $nMsg = $GUI_EVENT_CLOSE Or $nMsg = $h_Cancel
                $rc = 9
                ExitLoop
            Case $nMsg = $h_Ok
                $rc = 1
                ExitLoop
        EndSelect
    WEnd
    Local $SchemeFile = GUICtrlRead($h_Scheme)
    GUIDelete($gui2)
    ;
    If $rc = 9 Then Return
    ;
    If StringInStr($SchemeFile, " ==> ") Then $SchemeFile = StringLeft($SchemeFile, StringInStr($SchemeFile, " ==> ") - 1) & ".SciteConfig"
    If $SchemeFile = " [NoChange]" Then Return
    ;
    Local $x, $y
    $UserDir = @UserProfileDir
    If @OSType = "WIN32_WINDOWS" Then $UserDir = @ScriptDir
    $au3Prop = $UserDir & "\SciTEUser.properties"
    $H_au3Prop = FileOpen($au3Prop, 0)
    $H_au3PropNew = FileOpen($au3Prop & ".New", 2)
    ;
    $SchemeFile = StringStripWS($SchemeFile, 3)
    $H_au3PropScheme = FileOpen(@ScriptDir & "\" & $SchemeFile, 0)
    ;
    $SciTEConfigSec = 0
    ; copy all SciTEUser info To new SciTEuser.properties except old Settings...
    If $H_au3Prop <> -1 Then
        While 1
            $Irec = FileReadLine($H_au3Prop)
            If @error = -1 Then ExitLoop
            ;
            If $Irec = "# DO NOT CHANGE ANYTHING BETWEEN THESE LINES #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#" _
                    Or $Irec = "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#" Then
                $SciTEConfigSec = Not $SciTEConfigSec
                If $SchemeFile <> "[Last_User_setting].SciTEConfig" Then $SaveUserSettings &= $Irec & @CRLF
                ContinueLoop
            EndIf
            If Not $SciTEConfigSec And StringInStr($Irec, "style.au3") = 0 And StringInStr($Irec, "Font.") = 0 Then
                FileWriteLine($H_au3PropNew, $Irec)
                ContinueLoop
            Else
                If $SchemeFile <> "[Last_User_setting].SciTEConfig" Then $SaveUserSettings &= $Irec & @CRLF
            EndIf
        WEnd
    EndIf
    If $H_au3PropScheme <> -1 Then
        While 1
            $Irec = FileReadLine($H_au3PropScheme)
            If @error = -1 Then ExitLoop
            FileWriteLine($H_au3PropNew, $Irec)
        WEnd
    EndIf
    ;
    If $H_au3Prop <> -1 Then
        FileClose($H_au3Prop)
        FileMove($UserDir & "\SciTEUser.properties", $UserDir & "\SciTEUser.properties.old", 1)
    EndIf
    FileClose($H_au3PropNew)
    If $SchemeFile <> "[Last_User_setting].SciTEConfig" Then
        If StringInStr($SaveUserSettings, "# Created by SciTEConfig") Then
            $H_au3PropScheme_User = FileOpen(@ScriptDir & "\[Last_User_setting].SciTEConfig", 2)
            FileWrite($H_au3PropScheme_User, $SaveUserSettings)
            FileClose($H_au3PropScheme_User)
        EndIf
    EndIf
    FileMove($UserDir & "\SciTEUser.properties.new", $UserDir & "\SciTEUser.properties", 1)
EndFunc   ;==>SelectNewScheme
;
Func RunReqAdmin($Autoit3Commands, $prompt = 1)
    Local $temp_Script = _TempFile(@TempDir, "~", ".au3")
    Local $temp_check = _TempFile(@TempDir, "~", ".chk")
    FileWriteLine($temp_check, 'TempFile')
    FileWriteLine($temp_Script, '#NoTrayIcon')
    If Not IsAdmin() Then
        FileWriteLine($temp_Script, '#RequireAdmin')
        If $prompt = 1 Then MsgBox(262144, "Need Admin mode", "Admin mode is needed for this update. Answer the following prompts to allow the update.")
    EndIf
    FileWriteLine($temp_Script, $Autoit3Commands)
    FileWriteLine($temp_Script, "FileDelete('" & $temp_check & "')")
    RunWait('"' & @ScriptFullPath & '" /AutoIt3ExecuteScript "' & $temp_Script & '"')
    While FileExists($temp_check)
        Sleep(50)
    WEnd
    FileDelete($temp_Script)
EndFunc   ;==>RunReqAdmin

WTF?

Edited by LaCastiglione
Posted

Where did this come from?

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...