Jump to content

Dan's misc. Scripts


Recommended Posts

😀

 

i'v extracted the hex view code (from BF visualizer, see my previous post) and made a single function of it.

Usage:

Put something in the $CreateHexString variable, then call the Function CreateHexDataString()

Parameters are Func CreateHexDataString($startnr=0, $collums=10, $rowsize=10, $countwidth=0, $counttype=0, $asciilow=30, $asciihi=255)

$startnr is the starting point of the string. It depends on the $collums, and starts from the 0. if $startnr is greater than the length of the $CreateHexString variable, then empty spaces will be displayed as hex/ascii data.

$collumns in/decreases the width (amount of displayed letters per row)

$rowsize in/decreases the Height. 

$countwidth ensures that the counter numbers will be equal in size. 

$counttype  Decimal (0) or Hexadecimal (1) counter numbers. 

$asciilow, $asciihi determine which chars will be displayed. Ascii chars outside these numbers will be displayed as . in the ascii-view part. 

The function returns a String, which can be placed in a label, editbox or saved to a file.

To display the hex-view without the counter and the text, set the $CreateHexStringDisplay variable to 0

This is the how the example script looks like:

  HexView.png.dba4705dfe96a6c2363d5d1c881bc1c8.png

Save the following script as CreateHexDataString-include.au3

#include-once
#include <String.au3>

Global $CreateHexString = ""
Global $CreateHexStringDisplay = 1

;~ $CreateHexString="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et ornare sapien. In felis leo, luctus sit amet ligula sed, fringilla feugiat elit. In interdum vestibulum ligula, sed commodo purus fringilla a."
;~ ConsoleWrite( CreateHexDataString($CreateHexString) & @CRLF)

Func CreateHexDataString($startnr = 0, $collums = 10, $rowsize = 10, $countwidth = 0, $counttype = 0, $asciilow = 30, $asciihi = 255)
    ;$startnr = start number 0-99
    ;$countwidth - how many 0 will be displayed for the counter
    ;$counttype = 0 = decimal, 1= hexa
    Local $tmpString = "", $tmpbin = "", $tmpchr = ""
    Local $tmpnr = 0, $y = 0, $z = ($startnr * $collums)
    Local $strlen = StringLen($CreateHexString)
    Local $d
    Local $tmphi = $asciilow

    If $asciilow > $asciihi Then
        $asciilow = $asciihi
        $asciihi = $tmphi
    EndIf

    If $asciihi < 0 Or $asciihi > 255 Then $asciihi = 0
    If $asciilow < 0 Or $asciilow > 255 Then $asciilow = 0
    If $countwidth <= 0 Then $countwidth = StringLen($strlen)

    For $x = 1 To $collums

        If $CreateHexStringDisplay = 1 Then             ;Show counter
            If $counttype = 0 Then
                $tmpString = $tmpString & _StringRepeat("0", $countwidth - StringLen($z)) & $z & ":  "
            Else
                $tmpString = $tmpString & Hex($z, $countwidth) & ":  "
            EndIf
        EndIf
        $tmpbin = ""
        $tmpchr = ""

        For $y = 0 To $rowsize - 1
            If $z <= $strlen - 1 Then
                $d = StringMid($CreateHexString, $z + 1, 1)
                $tmpbin = $tmpbin & StringRight(Hex(Asc($d)), 2) & " "      ;Show hex
                If $CreateHexStringDisplay = 1 Then                         ;Show Ascii
                    If Asc($d) >= $asciilow And Asc($d) <= $asciihi Then
                        $tmpchr = $tmpchr & $d
                    Else
                        $tmpchr = $tmpchr & "."
                    EndIf
                EndIf
            Else
                $tmpbin = $tmpbin & "   "                       
                $tmpchr = $tmpchr & " "
            EndIf
            $z = $z + 1
        Next
        $tmpString = $tmpString & $tmpbin & "  " & $tmpchr & @CRLF

    Next
    Return $tmpString
EndFunc   ;==>CreateHexDataString

and here is a simple demo script for the above function (I'v named it CreateHexDataString-Example.au3) 

#include "CreateHexDataString-include.au3"

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <FileConstants.au3>


#Region ### START Koda GUI section ### Form=
Global $CTRL[13]

$Form1 = GUICreate("Hex Data View", 512, 400, -1, -1, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_SYSMENU))
Global $Edit1 = GUICtrlCreateEdit("", 2, 2, 417, 370)
GUICtrlSetData(-1, "")
GUICtrlSetFont(-1, 9, 400, 0, "Consolas")
$CTRL[00] = GUICtrlCreateButton("+Row", 424, 14, 39, 23)
$CTRL[01] = GUICtrlCreateButton("-Row", 467, 14, 39, 23)
$CTRL[02] = GUICtrlCreateButton("+Col", 424, 63, 39, 23)
$CTRL[03] = GUICtrlCreateButton("-Col", 467, 63, 39, 23)
$CTRL[04] = GUICtrlCreateLabel("Row", 426, 41, 79, 17)
$CTRL[05] = GUICtrlCreateLabel("Col", 425, 91, 79, 17)
$CTRL[06] = GUICtrlCreateSlider(425, 116, 28, 255, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_VERT, $TBS_TOP, $TBS_LEFT, $TBS_TOOLTIPS))
$CTRL[07] = GUICtrlCreateCheckbox("Hex", 470, 116, 80, 18)
$CTRL[08] = GUICtrlCreateButton("+W", 470, 145, 39, 20)
$CTRL[09] = GUICtrlCreateButton("-W", 470, 165, 39, 20)
$CTRL[10] = GUICtrlCreateLabel("Col", 470, 185, 40, 17)
$CTRL[11] = GUICtrlCreateCheckbox("All", 470, 210, 80, 18)
GuiCtrlSetTip (-1,"Switch between normal and hex-data only view")
$CTRL[12] = GUICtrlCreateButton("Load", 470, 250, 39, 20)
GUICtrlSetState($CTRL[11], $GUI_CHECKED)
GUICtrlSetLimit(-1, (1000 / 10), 0) ; change min/max value

For $x = 0 To 12
    GUICtrlSetResizing($CTRL[$x], $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
Next

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $collums = 10, $rows = 10, $startnr = 0, $width = 4

$CreateHexString = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed et ornare sapien. In felis leo, luctus sit amet ligula sed, fringilla feugiat elit. In interdum vestibulum ligula, sed commodo purus fringilla a."

CWE(CreateHexDataString(0))

UpdateLabels()


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $CTRL[0]                ;Inc Row nr button
            $rows = $rows + 1
            UpdateLabels()
        Case $CTRL[1]                ;Dec Row nr button
            $rows = $rows - 1
            If $rows < 0 Then $rows = 0
            UpdateLabels()
        Case $CTRL[2]                ;Inc Col nr button
            $collums = $collums + 1
            UpdateLabels()
        Case $CTRL[3]                ;Dec Col nr button
            $collums = $collums - 1
            If $collums < 0 Then $collums = 0
            UpdateLabels()
        Case $CTRL[6]                ;Slider
            CWE(CreateHexDataString(GUICtrlRead($CTRL[6]), $rows, $collums, $width, _IsChecked($CTRL[7])))
        Case $CTRL[7]                            ;Checkbox
            UpdateLabels()
        Case $CTRL[8]                ;Width +
            $width = $width + 1
            UpdateLabels()
        Case $CTRL[9]                ;Width -
            $width = $width - 1
            If $width < 0 Then $width = 0
            UpdateLabels()
        Case $CTRL[11]
            $CreateHexStringDisplay = _IsChecked($CTRL[11])
            CWE(CreateHexDataString(GUICtrlRead($CTRL[6]), $rows, $collums, $width, _IsChecked($CTRL[7])))
        Case $CTRL[12]
            Local $sFilePath = FileOpenDialog("Select a file", @ScriptDir & "\", "All Files(*.*)", BitOR($FD_FILEMUSTEXIST, $FD_MULTISELECT))

            Local $hFileOpen = FileOpen($sFilePath, $FO_READ)
            If $hFileOpen > 0 Then
                $CreateHexString = BinaryToString(FileRead($hFileOpen))
                FileClose($hFileOpen)
                CWE(CreateHexDataString(GUICtrlRead($CTRL[6]), $rows, $collums, $width, _IsChecked($CTRL[7])))
            EndIf
    EndSwitch
WEnd

Func UpdateLabels()
    GUICtrlSetData($CTRL[4], $rows)
    GUICtrlSetData($CTRL[5], $collums)
    GUICtrlSetData($CTRL[10], $width)
    CWE(CreateHexDataString(GUICtrlRead($CTRL[6]), $rows, $collums, $width, _IsChecked($CTRL[7])))   ;$ctrl[6] = Slider
EndFunc   ;==>UpdateLabels


Func CWE($txt) ;Write text to the edit box
    GUICtrlSetData($Edit1, $txt)
EndFunc   ;==>CWE

Func _IsChecked($idControlID)
    ;Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED     ;Returns true or false (oneliner)
    ;The lines below convert true and false to numbers - 1 and 0
    Local $x = BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
    If $x = True Then Return 1
    Return 0
EndFunc   ;==>_IsChecked

 

Edited by Dan_555
bugfix + Update

Some of my script sourcecode

Link to post
Share on other sites

Hi, here is an alternative to the MsgBox.

It displays a Gui with one edit field to the left, and variable number of Buttons to the right.

The buttons are defined by text and are separated by |. Button numbers start from 1.

To make 2 buttons, yes and no use "yes|no". Yes will have the number 1, and no the number 2 returned by the function.

The height of the gui is dependant on the number of buttons. The width of the buttons can be raised by the width of the Gui.

#include <String.au3>
#include <Array.au3>
#include <GUIConstants.au3>

;Demo
$txt = "Do you want to do this ?" & @CRLF & "or that?" & @CRLF & "click on the " & @CRLF & "Button(s) !"

ConsoleWrite(MsgBoxButton("TestBox", $txt) & @CRLF)
ConsoleWrite(MsgBoxButton("TestBox", "Do you want to do this or that, then click on one of the buttons" & _StringRepeat(@crlf,30) & "Button(s) !", "Si") & @CRLF)
ConsoleWrite(MsgBoxButton("TestBox", $txt, "Yes|No") & @CRLF)
ConsoleWrite(MsgBoxButton("TestBox", $txt, "Hey|It's|me") & @CRLF)
ConsoleWrite(MsgBoxButton("TestBox", $txt, "Row|Row|Row|Your|Boat") & @CRLF)
ConsoleWrite(MsgBoxButton("TestBox", $txt, "1|2|3|4|5|6") & @CRLF)
ConsoleWrite(MsgBoxButton("TestBox", $txt, "Very long text |is not|adjusted|to|the|window|width") & @CRLF)
ConsoleWrite(MsgBoxButton("TestBox", $txt, "Top|left|corner| |Space is accepted as a button",400,400,0,0) & @CRLF)
ConsoleWrite(MsgBoxButton("TestBox", $txt, "One|Two||Four|Five|Six|Seven|One missing button?!",320,50,-1,-1,8) & @CRLF)
local $tmptxt=""
for $x=1 to 33
$tmptxt=$tmptxt & $x & "|"
Next
ConsoleWrite(MsgBoxButton("TestBox", $txt, $tmptxt,400,50,0,0,Random(1,33,1)) & @CRLF)
;/demo

Func MsgBoxButton($title = "MsgBox", $txt = "", $buttons = "Ok|Cancel", $width = 250, $height = 100, $xpos = -1, $ypos = -1, $defbtn = 1)
    ;By Dan_555
    ;Displays a custom message box with variable number of buttons
    ;$title = Title text,  $txt=info text
    ;$buttons = Add any number of buttons needed by entering their names. Buttons are separated by |  E.g. 'yes|no' will create two buttons. Button numbers start from 1
    ;$Width, $height minimum of 250,100. Height is expanded by the amount of buttons.
    ;Button width is dependant on the Gui-Width
    ;$defbtn sets a button to act as default button - Acted upon return
    Local $hParentGui=WinGetHandle("","")
    GUISetState(@SW_DISABLE,$hParentGui)
    Local $nMsg
    Local $btnnr = -1
    If StringLeft($buttons, 1) <> "|" Then $buttons = "|" & $buttons
    If StringRight($buttons, 1) <> "|" Then $buttons = $buttons & "|"
    Local $a_btn = _StringBetween($buttons, "|", "|")

    If @error = 0 Then
        For $x = UBound($a_btn) - 1 To 0 Step -1
            If $a_btn[$x] = "" Then _ArrayDelete($a_btn, $x)
        Next
    Else                                                            ;Error creating button array
        Local $a_btn[] = ["ok"]
    EndIf

    If $height < (UBound($a_btn)) * 20 Then $height = (UBound($a_btn)) * 20
    If $width < 250 Then $width = 250
    If $height < 100 Then $height = 100

    Local $ahBtn[UBound($a_btn)]

    Local $hMsgBoxGui = GUICreate($title, $width, $height, $xpos, $ypos, BitOR($WS_DLGFRAME, $WS_BORDER, $WS_VISIBLE), BitOR($WS_EX_TOPMOST, $WS_EX_APPWINDOW),$hParentGui)
    Local $hMsgBoxEdi = GUICtrlCreateEdit($txt, 0, 0, 195, $height, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY))
    ;Local $hMsgBoxEdi = GUICtrlCreateEdit($txt, 0, 0, 195, $height, BitOR($WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY))
    ;Local $hMsgBoxEdi = GUICtrlCreateLabel($txt, 2, 2, 195, $height-4,$SS_SUNKEN)
    Local $xs = $height - (20 * (UBound($a_btn) - 1)) - 20
    For $x = 0 To UBound($a_btn) - 1
        $deftyp = -1
        If $defbtn = $x + 1 Then $deftyp = $BS_DEFPUSHBUTTON
        $ahBtn[$x] = GUICtrlCreateButton($a_btn[$x], 198, $xs + ($x * 20), $width - 199, 20, $deftyp)
;~      $ahBtn[$x] = GUICtrlCreateButton($a_btn[$x], 198, (UBound($a_btn)-1 = 0) ? (($height/2)-10)+($x * 20) : (($height/UBound($a_btn))-20)+($x * 20) , $width-199, 20,$deftyp)
    Next
    GUISetState(@SW_SHOW)
    Do
        $nMsg = GUIGetMsg()
        If $nMsg > 0 Then
            For $x = 0 To UBound($ahBtn) - 1
                If $nMsg = $ahBtn[$x] Then $btnnr = $x + 1
            Next
        EndIf
    Until $btnnr > -1
    GUIDelete($hMsgBoxGui)
    GUISetState(@SW_ENABLE,$hParentGui)
    WinActivate ($hParentGui)
    Return $btnnr
EndFunc   ;==>MsgBoxButton

Have Fun !

Edited by Dan_555
Added lock for the parent gui + bugfix, Set wordwrap to the edit field .

Some of my script sourcecode

Link to post
Share on other sites

Hi, 

i'm using the CrimsonEditor as my default text editor. 

It can start user added tools, but it is missing the ability to start the edited thing over it's extension.

And so, i got the idea to write the following script: 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=ShellExec-StopIt.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <TrayConstants.au3>
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)

If StringLen($cmdlineraw) > 0 Then
    $cmdmenu = _StringSearchSplit($cmdlineraw, "\", "R", "R")
    $a1 = TrayCreateItem("Running Process:")
    $a2 = TrayCreateItem($cmdmenu)
    $menu = TrayCreateItem("Stop it !")

    TrayItemSetState($a1, $TRAY_DISABLE)
    TrayItemSetState($a2, $TRAY_DISABLE)
    $pid = ShellExecute($cmdlineraw)

    Sleep(1300)
    While ProcessExists($pid)
        $tMsg = TrayGetMsg()
        If $tMsg = $menu Then ProcessClose($pid)
    WEnd

EndIf

Func _StringSearchSplit($str, $delimiter, $dir = "L", $ret = "R", $incdel = -1)
    ; #FUNCTION# ====================================================================================================================
    ; Name ..........:  _StringSearchSplit
    ; Description ...:  Search for the first delimiter in a string, with searching direction, Case Sensitive search
    ; Syntax ........:  _StringSearchSplit( $String, $delimiter [, $dir ] [, $ret ] [, $incdel ])
    ; Parameters ....:  $String             - String to be checked.
    ;                   $delimiter          - 1 char delimiter, has to be defined
    ;                   $dir                - Search from direction (Left/Right), use "L" or "R" - Left is default
    ;                                           The first letter will be used for direction, if multiple letters are entered e.g "Lab" = "L"
    ;                   $ret                - Return side, Left or Right - Right is default. see above for valid entries.
    ;                   $incdel             - Include delimiter 0 = No, 1 = Yes
    ;
    ; Return values .:  Success             - String
    ;
    ;                       e.g. 1: _StringSearch("c:\bat\test.bb","\","L","L")   returns "c:"
    ;                       e.g. 2: _StringSearch("c:\bat\test.bb","\","L","L",1) returns "c:\"
    ;                       e.g. 3: _StringSearch("c:\bat\test.bb","\","L","R")   returns "bat\test.bb"
    ;                       e.g. 4: _StringSearch("c:\bat\test.bb","\","L","R",1) returns "\bat\test.bb"
    ;                       e.g. 5: _StringSearch("c:\bat\test.bb","\","R","R")   returns "test.bb"
    ;                       e.g. 6: _StringSearch("c:\bat\test.bb","\","R","R",1) returns "\test.bb"
    ;
    ;                   Failure             - Empty string and @error flag as follows:
    ;                   @error :            1 - Empty String
    ;                                       2 - Delimiter should have a length of 1 char
    ;                                       3 - Should not happen, but if it does, search the PANIC button !
    ; Author ........:  Dan_555 (Autoitscript.com forum)
    ; ===============================================================================================================================

    Local $y
    Local $tmptxt = ""

    $dir = StringLeft(StringUpper($dir), 1)
    $ret = StringLeft(StringUpper($ret), 1)

    SetError(0)

    If StringLen($str) = 0 Then
        SetError(1)             ;empty string
        Return ""
    EndIf

    If (StringInStr($str, $delimiter) = 0) Or (StringLen($delimiter) <> 1) Then
        SetError(2)                ;invalid delimiter
        Return ""
    EndIf

    If $dir <> "L" And $dir <> "R" Then $dir = "L"                    ;Set default values
    If $ret <> "L" And $ret <> "R" Then $ret = "R"

    If $dir = "L" Then $y = StringInStr($str, $delimiter, 1)        ;Search for the delimiter
    If $dir = "R" Then $y = StringInStr($str, $delimiter, 1, -1)

    If $incdel = 0 Then $incdel = -1                                ;Tricky calculations ;)
    If $incdel <> -1 Then $incdel = 0

    If $ret = "L" Then Return StringMid($str, 1, $y + $incdel)      ;DisAssemble the string
    If $ret = "R" Then Return StringMid($str, $y - $incdel)

    SetError(3)
    Return ""
EndFunc   ;==>_StringSearchSplit

It takes, whatever is passed as the parameter and executes is with the shellexec command.

Practical example: you can edit html files with the CE, and launch it, automatically, with the assigned browser.

(or any other files like au3, nx, bas ... )

The Script then waits in the tray menue, until the launched program is ended. Or, if the Program becomes stuck, you can click on the tray icon, and end it's process.  

Here are the steps to add this to the CrimsonEditor:

Launch CE, Choose Tools/ Conf. user tools.

 Select an empty user tool slot.

Enter a menu text, something like "Shell Exec"

Seek the compiled exe for the command by clicking on the ...

Add $(FilePath) as Argument. 

Click on Save before execute. 

Then save the Tool.

 

From now on, you can edit and launch (e.g. provided launching au3 files runs the script and not the editor) the edited files over the tools menue or over the assigned shortcut.

 

Edit:
Here is an updated version of the code. 
This version does check if the script is running, by setting the filename as a Mutex string. (_Singleton).
Therefore if a code is already running, you won't have two icons in the tray.
 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=ShellExec-StopIt.ico
#AutoIt3Wrapper_Compression=0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <TrayConstants.au3>
#include <Misc.au3>
Opt("TrayAutoPause", 0)
Opt("TrayMenuMode", 1)

If StringLen($cmdlineraw) > 0 Then
    $cmdmenu = _StringSearchSplit($cmdlineraw, "\", "R", "R")

    If _Singleton($cmdmenu,0) > 0 Then

        $a1 = TrayCreateItem("Running Process:")
        $a2 = TrayCreateItem($cmdmenu)
        $menu = TrayCreateItem("Stop it !")
        TrayCreateItem("")
        $exit = TrayCreateItem("End this app")

        TrayItemSetState($a1, $TRAY_DISABLE)
        TrayItemSetState($a2, $TRAY_DISABLE)
        $pid = ShellExecute($cmdlineraw)

        Sleep(1300)
        While ProcessExists($pid)
            $tMsg = TrayGetMsg()
            If $tMsg = $menu Then ProcessClose($pid)
            If $tMsg = $exit Then Exit
        WEnd

    EndIf
EndIf

Func _StringSearchSplit($str, $delimiter, $dir = "L", $ret = "R", $incdel = -1)
    ; #FUNCTION# ====================================================================================================================
    ; Name ..........:  _StringSearchSplit
    ; Description ...:  Search for the first delimiter in a string, with searching direction, Case Sensitive search
    ; Syntax ........:  _StringSearchSplit( $String, $delimiter [, $dir ] [, $ret ] [, $incdel ])
    ; Parameters ....:  $String             - String to be checked.
    ;                   $delimiter          - 1 char delimiter, has to be defined
    ;                   $dir                - Search from direction (Left/Right), use "L" or "R" - Left is default
    ;                                           The first letter will be used for direction, if multiple letters are entered e.g "Lab" = "L"
    ;                   $ret                - Return side, Left or Right - Right is default. see above for valid entries.
    ;                   $incdel             - Include delimiter 0 = No, 1 = Yes
    ;
    ; Return values .:  Success             - String
    ;
    ;                       e.g. 1: _StringSearch("c:\bat\test.bb","\","L","L")   returns "c:"
    ;                       e.g. 2: _StringSearch("c:\bat\test.bb","\","L","L",1) returns "c:\"
    ;                       e.g. 3: _StringSearch("c:\bat\test.bb","\","L","R")   returns "bat\test.bb"
    ;                       e.g. 4: _StringSearch("c:\bat\test.bb","\","L","R",1) returns "\bat\test.bb"
    ;                       e.g. 5: _StringSearch("c:\bat\test.bb","\","R","R")   returns "test.bb"
    ;                       e.g. 6: _StringSearch("c:\bat\test.bb","\","R","R",1) returns "\test.bb"
    ;
    ;                   Failure             - Empty string and @error flag as follows:
    ;                   @error :            1 - Empty String
    ;                                       2 - Delimiter should have a length of 1 char
    ;                                       3 - Should not happen, but if it does, search the PANIC button !
    ; Author ........:  Dan_555 (Autoitscript.com forum)
    ; ===============================================================================================================================

    Local $y
    Local $tmptxt = ""

    $dir = StringLeft(StringUpper($dir), 1)
    $ret = StringLeft(StringUpper($ret), 1)

    SetError(0)

    If StringLen($str) = 0 Then
        SetError(1)             ;empty string
        Return ""
    EndIf

    If (StringInStr($str, $delimiter) = 0) Or (StringLen($delimiter) <> 1) Then
        SetError(2)                ;invalid delimiter
        Return ""
    EndIf

    If $dir <> "L" And $dir <> "R" Then $dir = "L"                    ;Set default values
    If $ret <> "L" And $ret <> "R" Then $ret = "R"

    If $dir = "L" Then $y = StringInStr($str, $delimiter, 1)        ;Search for the delimiter
    If $dir = "R" Then $y = StringInStr($str, $delimiter, 1, -1)

    If $incdel = 0 Then $incdel = -1                                ;Tricky calculations ;)
    If $incdel <> -1 Then $incdel = 0

    If $ret = "L" Then Return StringMid($str, 1, $y + $incdel)      ;DisAssemble the string
    If $ret = "R" Then Return StringMid($str, $y - $incdel)

    SetError(3)
    Return ""
EndFunc   ;==>_StringSearchSplit

 

 

ShellExec-StopIt.ico

Edited by Dan_555
Added a new/alternate version of the script.

Some of my script sourcecode

Link to post
Share on other sites
  • 4 months later...
  • 4 weeks later...

Hi, this is my Note-Memo-Pad script written in Autoit 3:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=NoteMemoPad.ico
#AutoIt3Wrapper_Outfile=NoteMemoPad.exe
#AutoIt3Wrapper_Outfile_x64=NoteMemoPad_x64.exe
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GuiEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <TrayConstants.au3>
#include <Misc.au3>

If _Singleton("Memo-Note-Pad00") = 0 Then Exit

Global $a_Font, $a_Fontc
Dim $a_Font[8]    ;Font array definition
Dim $a_Fontc[8]
Global $f_Italic, $f_Strikethru, $f_Underline
Global $f_inifile

Opt("TrayMenuMode", 11)
TraySetClick(16)

Global $closecounter = 0, $TimeHandle = TimerInit(), $TimeDiff = TimerDiff($TimeHandle)
Global $formTitle = "Note-memo-pad"

Global $inifile = @ScriptDir & "\" & "NoteMemoPad.ini"
$f_inifile = $inifile
Global $a_BTN[10][9]
Global $btnnr = -1

;Tray menu definition
Global $idMenu = TrayCreateMenu("Options")
Global $idHideOnSave = TrayCreateItem("Hide on autosave", $idMenu, -1, 1)
Global $idSTARTUP = TrayCreateItem("Start Hidden", $idMenu, -1, 1)
Global $idBUP = TrayCreateItem("Create Back-Up", $idMenu, -1, 1)
Global $idOTYP = TrayCreateItem("Tray single click open/Close", $idMenu, -1, 1)
Global $idWW = TrayCreateItem("WordWrap", $idMenu, -1, 1)
TrayCreateItem("", $idMenu)
Global $idPos = TrayCreateItem("Reset Position", $idMenu)
Global $idRPos = TrayCreateItem("Remember Position", $idMenu)
TrayCreateItem("", $idMenu)
Global $idFont = TrayCreateItem("Set Font", $idMenu)
Global $idSave = TrayCreateItem("SaveNow")
TrayCreateItem("")
Global $idExit = TrayCreateItem("Exit")

Local $tmpx, $tmpy
$tmpx = IniRead($inifile, "OPTIONS", "POSX", "-1")
$tmpy = IniRead($inifile, "OPTIONS", "POSY", "-1")


Global $HideOnAutoSave = IniRead($inifile, "OPTIONS", "HideOnAutoSave", "0")

If $HideOnAutoSave = 0 Then
    TrayItemSetState($idHideOnSave, $Tray_Unchecked)
Else
    TrayItemSetState($idHideOnSave, $Tray_checked)
EndIf


Global $SingleClickOpen = IniRead($inifile, "OPTIONS", "TrayClickSingleOpen", "0")

If $SingleClickOpen = 0 Then
    TrayItemSetState($idOTYP, $Tray_Unchecked)
    $TRAYCLICK = $TRAY_EVENT_PRIMARYDOUBLE
Else
    TrayItemSetState($idOTYP, $Tray_checked)
    $TRAYCLICK = $TRAY_EVENT_PRIMARYUP
EndIf

Global $DoBackup = IniRead($inifile, "OPTIONS", "EnableBackup", "1")

If $DoBackup = 0 Then
    TrayItemSetState($idBUP, $Tray_Unchecked)
Else
    TrayItemSetState($idBUP, $Tray_checked)
EndIf

Global $WordWrap = IniRead($inifile, "OPTIONS", "Wordwrap", "0")

If $WordWrap = 0 Then
    TrayItemSetState($idWW, $Tray_Unchecked)
    $ww = BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL)
Else
    TrayItemSetState($idWW, $Tray_checked)
    $ww = BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL)
EndIf

Global $StartHidden = IniRead($inifile, "OPTIONS", "StartHide", "1")

If $StartHidden = 0 Then
    TrayItemSetState($idSTARTUP, $Tray_Unchecked)
Else
    TrayItemSetState($idSTARTUP, $Tray_checked)
EndIf

Global $GUIVISIBLE = 1
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate($formTitle, 680, 450, $tmpx, $tmpy, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_TABSTOP))
$Button1 = GUICtrlCreateButton("Add Button", 508, 2, 82, 19)
GUICtrlSetTip(-1, "Add a Copy to Clipboard Button")
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
$Button2 = GUICtrlCreateButton("Add Counter", 508, 25, 82, 19)
GUICtrlSetTip(-1, "Add counter type buttons")
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
$Button3 = GUICtrlCreateButton("Selection", 625, 25, 51, 19)
GUICtrlSetTip(-1, "Invert Selection")
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
$Button4 = GUICtrlCreateButton("Delete", 625, 2, 51, 19)
GUICtrlSetTip(-1, "Delete Selected items")
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))

Global $Edit1 = GUICtrlCreateEdit("", 2, 2, 500, 444, $ww)
GUICtrlSetData(-1, "")
GUICtrlSetResizing(-1, $GUI_DOCKTOP)
;GUICtrlSetFont($Edit1, 8, 0, 0, "JSE_AmigaAMOS", 0)
_GUICtrlEdit_SetLimitText($Edit1, 20000000)

GetIniFont($Edit1)

#EndRegion ### END Koda GUI section ###

ReadFromFile()
_GUICtrlEdit_SetSel($Edit1, -1, -1)

If $StartHidden = 0 Then
    GUISetState(@SW_SHOW)
    $GUIVISIBLE = 1
Else
    GUISetState(@SW_HIDE)
    $GUIVISIBLE = 0
EndIf


CreateButtons()

GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

Global $AutoSaveTimer = TimerInit()
Global $AutoSave = 0

While 1

    Switch TrayGetMsg()
        Case $idSave
            SaveToFile()
        Case $idExit
            If $GUIVISIBLE = 1 And _GUICtrlEdit_GetModify($Edit1) = True Then SaveToFile()
            Exit
        Case $idHideOnSave
            $HideOnAutoSave = $HideOnAutoSave + 1
            If $HideOnAutoSave > 1 Then $HideOnAutoSave = 0
            If $HideOnAutoSave = 0 Then
                TrayItemSetState($idHideOnSave, $Tray_Unchecked)
            Else
                TrayItemSetState($idHideOnSave, $Tray_checked)
            EndIf
            IniWrite($inifile, "OPTIONS", "HideOnAutoSave", $HideOnAutoSave)
        Case $idSTARTUP
            $StartHidden = $StartHidden + 1
            If $StartHidden > 1 Then $StartHidden = 0
            If $StartHidden = 0 Then
                TrayItemSetState($idSTARTUP, $Tray_Unchecked)
            Else
                TrayItemSetState($idSTARTUP, $Tray_checked)
            EndIf
            $StartHidden = IniWrite($inifile, "OPTIONS", "StartHide", $StartHidden)
        Case $idWW
            $WordWrap = $WordWrap + 1
            If $WordWrap > 1 Then $WordWrap = 0

            If $WordWrap = 0 Then
                TrayItemSetState($idWW, $Tray_Unchecked)
                $ww = BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL)
            Else
                TrayItemSetState($idWW, $Tray_checked)
                $ww = BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL)
            EndIf

            IniWrite($inifile, "OPTIONS", "Wordwrap", $WordWrap)
            $tmp = GUICtrlRead($Edit1)
            GUICtrlDelete($Edit1)
            $Edit1 = GUICtrlCreateEdit("", 2, 2, 500, 444, $ww)
            _GUICtrlEdit_SetLimitText($Edit1, 20000000)
            GetIniFont($Edit1)
            GUICtrlSetData($Edit1, $tmp)
            $tmp = ""
        Case $idBUP
            $DoBackup = $DoBackup + 1
            If $DoBackup > 1 Then $DoBackup = 0
            If $DoBackup = 0 Then
                TrayItemSetState($idBUP, $Tray_Unchecked)
            Else
                TrayItemSetState($idBUP, $Tray_checked)
            EndIf
            IniWrite($inifile, "OPTIONS", "EnableBackup", $DoBackup)

        Case $idOTYP
            $SingleClickOpen = $SingleClickOpen + 1
            If $SingleClickOpen > 1 Then $SingleClickOpen = 0
            If $SingleClickOpen = 0 Then
                TrayItemSetState($idOTYP, $Tray_Unchecked)
                $TRAYCLICK = $TRAY_EVENT_PRIMARYDOUBLE
            Else
                TrayItemSetState($idOTYP, $Tray_checked)
                $TRAYCLICK = $TRAY_EVENT_PRIMARYUP
            EndIf
            IniWrite($inifile, "OPTIONS", "TrayClickSingleOpen", $SingleClickOpen)
        Case $idFont
            SetFont($Edit1, $Form1)
        Case $idRPos
            Local $aTmp = WinGetPos($Form1)
            IniWrite($inifile, "OPTIONS", "POSX", $aTmp[0])
            IniWrite($inifile, "OPTIONS", "POSY", $aTmp[1])
            $aTmp = ""
        Case $idPos
            IniWrite($inifile, "OPTIONS", "POSX", "-1")
            IniWrite($inifile, "OPTIONS", "POSY", "-1")
            WinMove($Form1, "", 0, 0)
            WinActivate($Form1)
        Case $TRAYCLICK
            If _GUICtrlEdit_GetModify($Edit1) = True Then SaveToFile()
            If $GUIVISIBLE = 0 Then
                GUISetState(@SW_SHOW, $Form1)
                $GUIVISIBLE = 1
                Tray_Items(1)
            Else
                GUISetState(@SW_HIDE, $Form1)
                $GUIVISIBLE = 0
                Tray_Items(2)
            EndIf

    EndSwitch

    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            If _GUICtrlEdit_GetModify($Edit1) = True Then SaveToFile()
            GUISetState(@SW_HIDE, $Form1)
            $GUIVISIBLE = 0
            Tray_Items(2)
        Case $Button1            ;Add Button
            AddButtons(1)
        Case $Button2            ;Add Counter
            AddButtons(2)
        Case $Button3            ;Invert Selection
            For $x = 0 To $btnnr
                $tmp = _IsChecked($a_BTN[$x][3])
                If $tmp = 0 Then
                    $tmp1 = 1
                Else
                    $tmp1 = 0
                EndIf
                _CheckUncheck($a_BTN[$x][3], $tmp1)
            Next
        Case $Button4            ;Delete
            $tmp1 = 0
            For $x = 0 To $btnnr
                $tmp = _IsChecked($a_BTN[$x][3])
                If $tmp = 1 Then
                    IniWrite($inifile, "BUTTON_" & $a_BTN[$x][8], "00", 0)
                    $tmp1 = 1
                EndIf
            Next
            If $tmp1 = 1 Then CreateButtons()
        Case Else
            If $nMsg > 0 Then
                For $x = 0 To $btnnr
                    If $a_BTN[$x][0] = 1 Then
                        If $nMsg = $a_BTN[$x][4] Then ClipPut($a_BTN[$x][2])
                    Else
                        $tmp = 0
                        If $nMsg = $a_BTN[$x][4] Then
                            GUICtrlSetData($a_BTN[$x][5], GUICtrlRead($a_BTN[$x][5]) - 1)
                            $tmp = 1
                        EndIf
                        If $nMsg = $a_BTN[$x][6] Then
                            GUICtrlSetData($a_BTN[$x][5], GUICtrlRead($a_BTN[$x][5]) + 1)
                            $tmp = 1
                        EndIf
                        If $tmp = 1 Then IniWrite($inifile, "BUTTON_" & $a_BTN[$x][8], "02", GUICtrlRead($a_BTN[$x][5]))
                    EndIf
                Next
            EndIf
    EndSwitch

    If TimerDiff($AutoSaveTimer) > 300000 And $AutoSave = 0 And $GUIVISIBLE = 1 Then
        If _GUICtrlEdit_GetModify($Edit1) = True Then
            SaveToFile()
            $AutoSave = 1
            If $HideOnAutoSave = 1 Then
                GUISetState(@SW_HIDE, $Form1)
                $GUIVISIBLE = 0
                Tray_Items(2)
            EndIf
        EndIf

    EndIf
WEnd


Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $IdFrom, $iCode

    $IdFrom = BitAND($wParam, 0x0000FFFF)
    $iCode = BitShift($wParam, 16)

    Switch $IdFrom
        Case $Edit1
            Switch $iCode
                Case $EN_UPDATE
                    $AutoSaveTimer = TimerInit()
                    $AutoSave = 0
            EndSwitch
    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Func Tray_Items($typ)
    Local $tmp, $tmp1
    If $typ = 1 Then
        $tmp = $TRAY_ENABLE
        $tmp1 = $TRAY_ENABLE
    ElseIf $typ = 0 Then
        $tmp = $TRAY_DISABLE
        $tmp1 = $TRAY_DISABLE
    Else
        $tmp = $TRAY_DISABLE
        $tmp1 = $TRAY_ENABLE
    EndIf

    TrayItemSetState($idWW, $tmp)
    TrayItemSetState($idPos, $tmp)
    TrayItemSetState($idRPos, $tmp)
    TrayItemSetState($idFont, $tmp)
    TrayItemSetState($idSave, $tmp)
    TrayItemSetState($idExit, $tmp1)
EndFunc   ;==>Tray_Items

Func AddButtons($typ)
    If $btnnr < 9 Then
        Tray_Items(0)
        $nMsg = GUIGetMsg()
        Local $InputForm, $Button1, $Button2, $Input1, $Input2, $Label1, $Label2
        #Region ### START Koda GUI section ### Form=
        GUISetState(@SW_DISABLE, $Form1)
        $InputForm = GUICreate("Button Generator", 237, 135, -1, -1, BitOR($WS_BORDER, $WS_CAPTION), $WS_EX_APPWINDOW, $Form1)
        $Button1 = GUICtrlCreateButton("Ok", 16, 104, 55, 18, $BS_DEFPUSHBUTTON)
        $Button2 = GUICtrlCreateButton("Cancel", 167, 104, 55, 18)

        If $typ = 1 Then
            $Input1 = GUICtrlCreateInput("", 15, 24, 208, 21)
            $Label1 = GUICtrlCreateLabel("Button Name:", 15, 4, 122, 17)
            $Input2 = GUICtrlCreateInput("", 15, 74, 208, 21)
            $Label2 = GUICtrlCreateLabel("Clipboard Text:", 14, 55, 267, 17)
            GUICtrlSetLimit($Input1, 22)
        Else
            $Input1 = GUICtrlCreateInput("", 15, 24, 208, 21)
            $Label1 = GUICtrlCreateLabel("Descriptional Text:", 15, 4, 122, 17)
            $Input2 = GUICtrlCreateInput("", 15, 74, 208, 21, $ES_NUMBER)
            GUICtrlSetLimit($Input1, 28)
            GUICtrlSetLimit($Input2, 8)
            $Label2 = GUICtrlCreateLabel("Enter a Number", 14, 55, 267, 17)
        EndIf


        GUISetState(@SW_SHOW)
        #EndRegion ### END Koda GUI section ###

        Local $Ex = 0
        While 1
            $nMsg = GUIGetMsg()
            Switch $nMsg
                Case $Button1
                    If GUICtrlRead($Input1) <> "" And GUICtrlRead($Input2) <> "" Then
                        $Ex = 0
                        ExitLoop
                    EndIf
                Case $Button2
                    $Ex = 1
                    ExitLoop
            EndSwitch
        WEnd

        If $Ex = 0 Then
            Local $found = 0
            For $x = 0 To 9
                $tmp = IniRead($inifile, "BUTTON_" & $x, "00", "-1")
                If $tmp <= 0 Then
                    IniWrite($inifile, "BUTTON_" & $x, "00", $typ)
                    IniWrite($inifile, "BUTTON_" & $x, "01", GUICtrlRead($Input1))
                    IniWrite($inifile, "BUTTON_" & $x, "02", GUICtrlRead($Input2))
                    $found = 1
                    ExitLoop
                EndIf
            Next
        EndIf
        GUIDelete($InputForm)
        GUISetState(@SW_ENABLE, $Form1)
        WinActivate($Form1)
        CreateButtons()
        Tray_Items(1)
    EndIf
EndFunc   ;==>AddButtons

Func CreateButtons()

    If $btnnr > -1 Then
        For $x = 0 To $btnnr
            $tmp = $a_BTN[$x][0]
            If $tmp = 1 Then
                GUICtrlDelete($a_BTN[$x][3])
                GUICtrlDelete($a_BTN[$x][4])
            ElseIf $tmp = 2 Then
                GUICtrlDelete($a_BTN[$x][3])
                GUICtrlDelete($a_BTN[$x][4])
                GUICtrlDelete($a_BTN[$x][5])
                GUICtrlDelete($a_BTN[$x][6])
                GUICtrlDelete($a_BTN[$x][7])
            EndIf
        Next
        $btnnr = -1
    EndIf

    For $x = 0 To 9
        $tmp = IniRead($inifile, "BUTTON_" & $x, "00", "-1")
        If $tmp > 0 And $tmp < 9 Then
            $btnnr = $btnnr + 1
            $a_BTN[$btnnr][0] = Int($tmp)
            $a_BTN[$btnnr][1] = IniRead($inifile, "BUTTON_" & $x, "01", "")
            $a_BTN[$btnnr][2] = IniRead($inifile, "BUTTON_" & $x, "02", "")
            $a_BTN[$btnnr][8] = $x
        EndIf
    Next

    For $x = 0 To $btnnr
        $tmp = $a_BTN[$x][0]
        If $tmp > 0 Then
            If $tmp = 1 Then
                $a_BTN[$x][3] = GUICtrlCreateCheckbox("", 650, 60 + $x * 40, 18, 30)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][4] = GUICtrlCreateButton($a_BTN[$x][1], 510, 60 + $x * 40, 130, 30)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                GUICtrlSetTip($a_BTN[$x][4], "Click to copy to clipboard")
            ElseIf $tmp = 2 Then
                $a_BTN[$x][7] = GUICtrlCreateLabel($a_BTN[$x][1] & ":", 510, 53 + $x * 40, 220, 18)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][3] = GUICtrlCreateCheckbox("", 650, 70 + $x * 40, 18, 20)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][4] = GUICtrlCreateButton("-", 510, 70 + $x * 40, 20, 20)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][5] = GUICtrlCreateInput($a_BTN[$x][2], 540, 70 + $x * 40, 60, 20, BitOR($ES_NUMBER, $ES_READONLY))
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][6] = GUICtrlCreateButton("+", 610, 70 + $x * 40, 20, 20)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
            EndIf
        EndIf
    Next

EndFunc   ;==>CreateButtons

Func _CheckUncheck($id, $nr)
    If $nr = 0 Then
        GUICtrlSetState($id, $GUI_UNCHECKED)
    Else
        GUICtrlSetState($id, $GUI_CHECKED)
    EndIf
EndFunc   ;==>_CheckUncheck

Func _IsChecked($idControlID)
    Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc   ;==>_IsChecked

Func ReadFromFile()
    If FileExists(@ScriptDir & "\" & "memory.txt") Then
        Local $hFileOpen = FileOpen(@ScriptDir & "\" & "memory.txt", $FO_READ)
        If $hFileOpen = -1 Then
            MsgBox($MB_SYSTEMMODAL, "ReadFromFile", "An error occurred when reading the file." & @CRLF & @ScriptDir & "\" & "memory.txt")
            Return False
        EndIf
        Local $sFileRead = FileRead($hFileOpen)
        ; Close the handle returned by FileOpen.
        FileClose($hFileOpen)
        GUICtrlSetData($Edit1, $sFileRead, 1)
    EndIf
EndFunc   ;==>ReadFromFile

Func SaveToFile()
    If $DoBackup = 1 Then
        If FileExists(@ScriptDir & "\" & "memory.bak") Then FileDelete(@ScriptDir & "\" & "memory.bak")
        FileCopy(@ScriptDir & "\" & "memory.txt", @ScriptDir & "\" & "memory.bak")
    EndIf

    Local $hFileOpen = FileOpen(@ScriptDir & "\" & "memory.txt", $FO_OVERWRITE)
    If $hFileOpen = -1 Then
        MsgBox($MB_SYSTEMMODAL, "SaveToFile", "An error occurred whilst writing the temporary file." & @CRLF & @ScriptDir & "\" & "memory.txt")
        Return False
    EndIf
    If FileWrite($hFileOpen, GUICtrlRead($Edit1)) = 0 Then
        MsgBox($MB_SYSTEMMODAL, "FileWrite", "Failed to write to Memory.txt" & @CRLF & @ScriptDir & "\" & "memory.txt")
        Return False
    Else
        _GUICtrlEdit_SetModify($Edit1, False)
    EndIf
    FileClose($hFileOpen)
EndFunc   ;==>SaveToFile

Func SetFont($id, $h_gui, $nr = 0)
    For $x = 0 To 7
        $a_Fontc[$x] = $a_Font[$x]
    Next
    $a_Font = _ChooseFont($a_Font[2], $a_Font[3], $a_Font[5], $a_Font[4], $f_Italic, $f_Underline, $f_Strikethru, $h_gui)
    If $a_Font <> -1 Then
        ;  GUICtrlSetFont ( controlID, size [, weight [, attribute [, fontname [, quality]]]] )
        GUICtrlSetFont($id, $a_Font[3], $a_Font[4], $a_Font[1], $a_Font[2], 0)
        GUICtrlSetColor($id, $a_Font[5])
        $f_Italic = BitAND($a_Font[1], 2)
        $f_Underline = BitAND($a_Font[1], 4)
        $f_Strikethru = BitAND($a_Font[1], 8)
        SaveIniFont($nr)
        ;ConsoleWrite(@CRLF & $a_Font[3] & @CRLF & $a_Font[4] & @CRLF & $a_Font[1] & @CRLF & $a_Font[2] & @CRLF & $a_Font[5])
    Else
        Dim $a_Font[8]    ;Font array definition
        For $x = 0 To 7
            $a_Font[$x] = $a_Fontc[$x]
        Next
    EndIf
EndFunc   ;==>SetFont

Func GetIniFont($id, $nr = 0)
    ;Default font definition
    $a_Font[1] = IniRead($f_inifile, "font", $nr & "1", "0")
    $a_Font[2] = IniRead($f_inifile, "font", $nr & "2", "Arial")
    $a_Font[3] = IniRead($f_inifile, "font", $nr & "3", "8")
    $a_Font[4] = IniRead($f_inifile, "font", $nr & "4", "400")
    $a_Font[7] = IniRead($f_inifile, "font", $nr & "7", "0")

    $f_Italic = BitAND($a_Font[1], 2)
    $f_Underline = BitAND($a_Font[1], 4)
    $f_Strikethru = BitAND($a_Font[1], 8)
    GUICtrlSetFont($id, $a_Font[3], $a_Font[4], $a_Font[1], $a_Font[2], 0)
    GUICtrlSetColor($id, $a_Font[7])
EndFunc   ;==>GetIniFont

Func SaveIniFont($nr = 0)
    IniWrite($f_inifile, "font", $nr & "1", $a_Font[1])
    IniWrite($f_inifile, "font", $nr & "2", $a_Font[2])
    IniWrite($f_inifile, "font", $nr & "3", $a_Font[3])
    IniWrite($f_inifile, "font", $nr & "4", $a_Font[4])
    IniWrite($f_inifile, "font", $nr & "7", $a_Font[7])
EndFunc   ;==>SaveIniFont


Func CW($txt)
    ConsoleWrite($txt & @CRLF)
EndFunc   ;==>CW

It is meant to stay in the Tray menue, so the script will exit only if you choose the Exit from its icon.

(Only single instance can run at a time)

It has an editor field, its content is saved when the app is hidden (if there was a change in the editor - if the modify flag is set).

The text is saved as "memory.txt" in the script folder.

The ini file is named "NoteMemoPad.ini" and will be created in the script folder.

 

It has some additional buttons (max 10):

You can add a button, which will copy a predefined text into clipboard.

You can add a counter. Click on + or - to change it.

The counter and the button are saved in the ini file.

When you delete a button, its contents are not deleted - The slot is only marked as unused. (In case you deleted it by a mistake)

This is how it looks like:

Note-Memo-Pad.png.c4038e14140ab85a2692c30a3ca460fd.png

The options for this tool are located in the tray menu, and they are saved in the ini file.

Some options can be changed only when the Editor Window is visible.

Options are:

 

Hide on Autosave: An autosave will be done, if something is typed in the editor field, after 5 minutes. You can let the window be hidden then.

Start Hidden: Do not open the window at the first start.  

Make backup : (Create a backup of the last saved file as memory.bak before saving)

 Tray Single Click open/close : Open the window with 1 or 2 clicks on the tray menu.

WordWrap: Set or Reset the wordwrap mode for the editor.   

Reset position: Reset the window starting position to center of the screen. (Using this option will set the window to the top left edge, but it will open centered by the next start)

Remember Position: Position the window where you like it to be, and it will always open there (if you do not move it).

Set Font: Change the used font.

 

 Attached is an icon file.

 

Have fun.

NoteMemoPad.ico

Edited by Dan_555
Update: 18.03.2023 - Bug Fix - Word Wrapped Editbox now allows enter key to be used.

Some of my script sourcecode

Link to post
Share on other sites
  • 1 year later...

Hi, here is a version #1 of my Note-Memo-Pad script.
 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=NoteMemoPad.ico
#AutoIt3Wrapper_Outfile=NoteMemoPad.exe
#AutoIt3Wrapper_Outfile_x64=NoteMemoPad_x64.exe
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Misc.au3>
If _Singleton("Memo-Note-Pad00") = 0 Then Exit

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GuiEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <TrayConstants.au3>

#include <WinAPI.au3>

Global $g_hStub_KeyProc = DllCallbackRegister("_KeyProc", "LRESULT", "int;wparam;lparam")
$hMod = _WinAPI_GetModuleHandle(0)
Global $g_hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($g_hStub_KeyProc), $hMod)
Global Const $MSLLHOOKSTRUCT = $tagPOINT & ";dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo"

Global Const $VK_TAB = 0x09
Global Const $VK_CAPSLOCK = 0x14
Global Const $VK_SPACE = 0x20
Global Const $VK_LWIN = 0x5B
Global Const $VK_RWIN = 0x5C
Global $isWinDown1 = False
Global $isWinDown2 = False
Global $isWinDown1T = TimerInit(), $isWinDown2T = TimerInit()
$hHookProc = DllCallbackRegister("_KeyboardProc", "long", "int;wparam;lparam")
$hHookKeyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hHookProc), _WinAPI_GetModuleHandle(0), 0)

Global $t1, $t2, $t3

Global $a_Font, $a_Fontc
Dim $a_Font[8]    ;Font array definition
Dim $a_Fontc[8]
Global $f_Italic, $f_Strikethru, $f_Underline
Global $f_inifile

Opt("TrayMenuMode", 11)
TraySetClick(16)

Global $closecounter = 0, $TimeHandle = TimerInit(), $TimeDiff = TimerDiff($TimeHandle)
Global $formTitle = "Note-memo-pad"

Global $inifile = @ScriptDir & "\" & "NoteMemoPad.ini"
$f_inifile = $inifile
Global $a_BTN[10][9]
Global $btnnr = -1

Global $KeyDebug = 0

;Tray menu definition
Global $idPopOutOnTop = TrayCreateItem("Set PopoutYoutube on Top")
Global $idPopOutOffTop = TrayCreateItem("Set PopoutYoutube off Top")
TrayCreateItem("")
Global $idCloseSDLBASC = TrayCreateItem("Close SDL-Basic compiler")
Global $idCloseBlitzBasicC = TrayCreateItem("Close Blitzbasic compiler")
TrayCreateItem("")
Global $idKeyCaptureWin = TrayCreateItem("Show KeyDebugger")
Global $idMenu = TrayCreateMenu("Options")
Global $idDisableLWINSPACE = TrayCreateItem("Disable LWIN Space", $idMenu, -1, 1)
Global $idDisableCaps = TrayCreateItem("Disable CapsLock", $idMenu, -1, 1)
Global $idDisableAltTab = TrayCreateItem("Disable Alt Tab", $idMenu, -1, 1)
Global $idMouseVolume = TrayCreateItem("Mouse Buttons (3/4) to Volume", $idMenu, -1, 1)
Global $idHideOnSave = TrayCreateItem("Hide on autosave", $idMenu, -1, 1)
Global $idSTARTUP = TrayCreateItem("Start Hidden", $idMenu, -1, 1)
Global $idBUP = TrayCreateItem("Create Back-Up", $idMenu, -1, 1)
Global $idOTYP = TrayCreateItem("Tray single click open/Close", $idMenu, -1, 1)
Global $idWW = TrayCreateItem("WordWrap", $idMenu, -1, 1)
TrayCreateItem("", $idMenu)
Global $idPos0 = TrayCreateItem("Move to 0,0 (does not save)", $idMenu)
Global $idPos = TrayCreateItem("Recall Position", $idMenu)
TrayCreateItem("-----------------", $idMenu)
TrayItemSetState(-1, $TRAY_DISABLE)
Global $idRPos = TrayCreateItem("Remember Position", $idMenu)


TrayCreateItem("", $idMenu)
Global $idFont = TrayCreateItem("Set Font", $idMenu)
TrayCreateItem("")
Global $idScratchbook = TrayCreateItem("Open Scratchbook")
TrayCreateItem("")
Global $idSave = TrayCreateItem("SaveNow")
TrayCreateItem("")
Global $idExit = TrayCreateItem("Exit")

Local $tmpx, $tmpy
$tmpx = IniRead($inifile, "OPTIONS", "POSX", "-1")
$tmpy = IniRead($inifile, "OPTIONS", "POSY", "-1")

Global $DisableLWINSpace = IniRead($inifile, "OPTIONS", "DisableLWinSPACE", "1")
_TrayCheckUncheck($idDisableLWINSPACE, $DisableLWINSpace)

Global $DisableCaps = IniRead($inifile, "OPTIONS", "DisableCaps", "1")
_TrayCheckUncheck($idDisableCaps, $DisableCaps)

Global $DisableAltTab = IniRead($inifile, "OPTIONS", "DisableAltTab", "1")
_TrayCheckUncheck($idDisableAltTab, $DisableAltTab)

Global $MouseVolume = IniRead($inifile, "OPTIONS", "MouseVolume", "1")
_TrayCheckUncheck($idMouseVolume, $MouseVolume)

Global $HideOnAutoSave = IniRead($inifile, "OPTIONS", "HideOnAutoSave", "0")
_TrayCheckUncheck($idHideOnSave, $HideOnAutoSave)

Global $SingleClickOpen = IniRead($inifile, "OPTIONS", "TrayClickSingleOpen", "0")
_TrayCheckUncheck($idOTYP, $SingleClickOpen)

If $SingleClickOpen = 0 Then
    $TRAYCLICK = $TRAY_EVENT_PRIMARYDOUBLE
Else
    $TRAYCLICK = $TRAY_EVENT_PRIMARYUP
EndIf

Global $DoBackup = IniRead($inifile, "OPTIONS", "EnableBackup", "1")
_TrayCheckUncheck($idBUP, $DoBackup)


Global $WordWrap = IniRead($inifile, "OPTIONS", "Wordwrap", "0")
_TrayCheckUncheck($idWW, $WordWrap)

If $WordWrap = 0 Then
    $ww = BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $WS_HSCROLL)
Else
    $ww = BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL)
EndIf

Global $StartHidden = IniRead($inifile, "OPTIONS", "StartHide", "1")
_TrayCheckUncheck($idSTARTUP, $StartHidden)

#Region ### START Koda GUI section ### Form=
$hKeyDebug = GUICreate("KeyDebug", 133, 84, -1, -1, $WS_OVERLAPPED, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_CLIENTEDGE))
$KeyInput1 = GUICtrlCreateInput("", 6, 6, 118, 21, $ES_READONLY)
$KeyInput2 = GUICtrlCreateInput("", 6, 31, 118, 21, $ES_READONLY)
GUISetState(@SW_HIDE)
#EndRegion ### END Koda GUI section ###


Global $GUIVISIBLE = 1
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate($formTitle, 680, 450, $tmpx, $tmpy, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_TABSTOP))
$Button1 = GUICtrlCreateButton("Add Button", 508, 2, 82, 19)
GUICtrlSetTip(-1, "Add a Copy to Clipboard Button")
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
$Button2 = GUICtrlCreateButton("Add Counter", 508, 25, 82, 19)
GUICtrlSetTip(-1, "Add counter type buttons")
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
$Button3 = GUICtrlCreateButton("Selection", 625, 25, 51, 19)
GUICtrlSetTip(-1, "Invert Selection")
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
$Button4 = GUICtrlCreateButton("Delete", 625, 2, 51, 19)
GUICtrlSetTip(-1, "Delete Selected items")
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))

Global $Edit1 = GUICtrlCreateEdit("", 2, 2, 500, 444, $ww)
GUICtrlSetData(-1, "")
GUICtrlSetResizing(-1, $GUI_DOCKTOP)
;GUICtrlSetFont($Edit1, 8, 0, 0, "JSE_AmigaAMOS", 0)
_GUICtrlEdit_SetLimitText($Edit1, 20000000)

GetIniFont($Edit1)

#EndRegion ### END Koda GUI section ###

ReadFromFile()
_GUICtrlEdit_SetSel($Edit1, -1, -1)

If $StartHidden = 0 Then
    GUISetState(@SW_SHOW)
    $GUIVISIBLE = 1
Else
    GUISetState(@SW_HIDE)
    $GUIVISIBLE = 0
EndIf


CreateButtons()

GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
GUIRegisterMsg($WM_GETMINMAXINFO, "MY_WM_GETMINMAXINFO")

Global $AutoSaveTimer = TimerInit()
Global $AutoSave = 0

Global $SCP_closecounter = 0, $SCP_TimeHandle = TimerInit(), $SCP_TimeDiff = TimerDiff($SCP_TimeHandle)
Global $SCP_formTitle = "Simple Scratchbook"
Global $SCP_Form1, $SCP_Edit1, $SCP_ButtonCLS, $SCP_ButtonCLSPASTE, $SCP_ButtonPaste, $SCP_ButtonCopy, $SCP_ButtonCopyALL
Global $SCP_ButtonUndo, $SCP_ButtonFont, $SCP_CheckLock, $SCP_WInOpen = 0, $SCP_WW, $SCP_WWEdSetting, $SCP_hEdit1

$SCP_WWEdSetting =BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL)

While 1

    If TimerDiff($AutoSaveTimer) > 300000 And $AutoSave = 0 And $GUIVISIBLE = 1 Then
        If _GUICtrlEdit_GetModify($Edit1) = True Then
            SaveToFile()
            $AutoSave = 1
            If $HideOnAutoSave = 1 Then
                GUISetState(@SW_HIDE, $Form1)
                $GUIVISIBLE = 0
                Tray_Items(2)
            EndIf
        EndIf
    EndIf

    If $isWinDown1 = True And TimerDiff($isWinDown1T) > 5000 Then $isWinDown1 = False
    If $isWinDown2 = True And TimerDiff($isWinDown2T) > 5000 Then $isWinDown1 = False

    If $KeyDebug = 1 Then
        If $t1 <> 0 Then
            GUICtrlSetData($KeyInput1, "TkeyHooks=" & $t1)
            $t1 = 0
        EndIf
        If $t2 <> 0 Then
            GUICtrlSetData($KeyInput2, "vKode=" & $t2)
            $t2 = 0
        EndIf
;~ GUICtrlSetData($KeyInput1, "IsWinDown1=" & $isWinDown1)
;~ GUICtrlSetData($KeyInput2, "IsWinDown2=" & $isWinDown2)
    EndIf

    Switch TrayGetMsg()
        Case $idScratchbook
            If $SCP_WInOpen = 0 Then
                Scratchbook()
            Else
                CloseScratchbook()
            EndIf
        Case $idSave
            SaveToFile()
        Case $idExit
            If $GUIVISIBLE = 1 And _GUICtrlEdit_GetModify($Edit1) = True Then SaveToFile()
            If $SCP_WInOpen = 1 Then CloseScratchbook()
            Cleanup()
        Case $idPopOutOnTop
            SetOnOffTop("Popout for", 1)
        Case $idPopOutOffTop
            SetOnOffTop("Popout for", 0)
        Case $idCloseBlitzBasicC
            KillProcess("blitzcc.exe")
        Case $idCloseSDLBASC
            KillProcess("sdlbrt.exe")
        Case $idKeyCaptureWin
            $KeyDebug = Mod($KeyDebug + 1, 2)
            _TrayCheckUncheck($idKeyCaptureWin, $KeyDebug)
            If $KeyDebug = 0 Then
                GUISetState(@SW_HIDE, $hKeyDebug)
            Else
                GUISetState(@SW_SHOW, $hKeyDebug)
            EndIf
        Case $idDisableLWINSPACE
            $DisableLWINSpace = Mod($DisableLWINSpace + 1, 2)
            _TrayCheckUncheck($idDisableLWINSPACE, $DisableLWINSpace)
            IniWrite($inifile, "OPTIONS", "DisableLWinSPACE", $DisableLWINSpace)
        Case $idDisableCaps
            $DisableCaps = Mod($DisableCaps + 1, 2)
            _TrayCheckUncheck($idDisableCaps, $DisableCaps)
            IniWrite($inifile, "OPTIONS", "DisableCaps", $DisableCaps)
        Case $idDisableAltTab
            $DisableAltTab = Mod($DisableAltTab + 1, 2)
            _TrayCheckUncheck($idDisableAltTab, $DisableAltTab)
            IniWrite($inifile, "OPTIONS", "DisableAltTab", $DisableAltTab)
        Case $idMouseVolume
            $MouseVolume = Mod($MouseVolume + 1, 2)
            _TrayCheckUncheck($idMouseVolume, $MouseVolume)
            IniWrite($inifile, "OPTIONS", "MouseVolume", $MouseVolume)
        Case $idHideOnSave
            $HideOnAutoSave = Mod($HideOnAutoSave + 1, 2)
            _TrayCheckUncheck($idHideOnSave, $HideOnAutoSave)
            IniWrite($inifile, "OPTIONS", "HideOnAutoSave", $HideOnAutoSave)
        Case $idSTARTUP
            $StartHidden = Mod($StartHidden + 1, 2)
            _TrayCheckUncheck($idSTARTUP, $StartHidden)
            $StartHidden = IniWrite($inifile, "OPTIONS", "StartHide", $StartHidden)
        Case $idWW
            $WordWrap = Mod($WordWrap + 1, 2)
            _TrayCheckUncheck($idWW, $WordWrap)

            If $WordWrap = 0 Then
                TrayItemSetState($idWW, $Tray_Unchecked)
                $ww = BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL)
            Else
                TrayItemSetState($idWW, $Tray_checked)
                $ww = BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL)
            EndIf

            IniWrite($inifile, "OPTIONS", "Wordwrap", $WordWrap)
            $tmp = GUICtrlRead($Edit1)
            GUICtrlDelete($Edit1)
            $Edit1 = GUICtrlCreateEdit("", 2, 2, 500, 444, $ww)
            _GUICtrlEdit_SetLimitText($Edit1, 20000000)
            GetIniFont($Edit1)
            GUICtrlSetData($Edit1, $tmp)
            $tmp = ""

        Case $idBUP
            $DoBackup = Mod($DoBackup + 1, 2)
            _TrayCheckUncheck($idBUP, $DoBackup)
            IniWrite($inifile, "OPTIONS", "EnableBackup", $DoBackup)
        Case $idOTYP
            $SingleClickOpen = Mod($SingleClickOpen + 1, 2)
            _TrayCheckUncheck($idOTYP, $SingleClickOpen)
            If $SingleClickOpen = 0 Then
                $TRAYCLICK = $TRAY_EVENT_PRIMARYDOUBLE
            Else
                $TRAYCLICK = $TRAY_EVENT_PRIMARYUP
            EndIf
            IniWrite($inifile, "OPTIONS", "TrayClickSingleOpen", $SingleClickOpen)
        Case $idFont
            SetFont($Edit1, $Form1)
        Case $idRPos
            Local $aTmp = WinGetPos($Form1)
            IniWrite($inifile, "OPTIONS", "POSX", $aTmp[0])
            IniWrite($inifile, "OPTIONS", "POSY", $aTmp[1])
            $aTmp = ""
        Case $idPos0
            WinMove($Form1, "", 0, 0)
            WinActivate($Form1)
        Case $idPos
            WinMove($Form1, "", IniRead($inifile, "OPTIONS", "POSX", "-1"), IniRead($inifile, "OPTIONS", "POSY", "-1"))
            WinActivate($Form1)
        Case $TRAYCLICK
            If _GUICtrlEdit_GetModify($Edit1) = True Then SaveToFile()
            If $GUIVISIBLE = 0 Then
                GUISetState(@SW_SHOW, $Form1)
                $GUIVISIBLE = 1
                Tray_Items(1)
            Else
                GUISetState(@SW_HIDE, $Form1)
                $GUIVISIBLE = 0
                Tray_Items(2)
            EndIf
    EndSwitch

    $aMsg = GUIGetMsg(1) ; Use advanced parameter to get array
    If Not IsHWnd($aMsg[1]) Then ContinueLoop ; preventing subsequent lines from processing when nothing happens
    $nMsg = $aMsg[0]
    Switch $aMsg[1]
        Case $Form1

            Switch $aMsg[0]
                Case $GUI_EVENT_CLOSE
                    If _GUICtrlEdit_GetModify($Edit1) = True Then SaveToFile()
                    GUISetState(@SW_HIDE, $Form1)
                    $GUIVISIBLE = 0
                    Tray_Items(2)
                Case $Button1    ;Add Button
                    AddButtons(1)
                Case $Button2    ;Add Counter
                    AddButtons(2)
                Case $Button3    ;Invert Selection
                    For $x = 0 To $btnnr
                        $tmp = _IsChecked($a_BTN[$x][3])
                        If $tmp = 0 Then
                            $tmp1 = 1
                        Else
                            $tmp1 = 0
                        EndIf
                        _CheckUncheck($a_BTN[$x][3], $tmp1)
                    Next
                Case $Button4    ;Delete
                    $tmp1 = 0
                    For $x = 0 To $btnnr
                        $tmp = _IsChecked($a_BTN[$x][3])
                        If $tmp = 1 Then
                            IniWrite($inifile, "BUTTON_" & $a_BTN[$x][8], "00", 0)
                            $tmp1 = 1
                        EndIf
                    Next
                    If $tmp1 = 1 Then CreateButtons()
                Case Else
                    If $nMsg > 0 Then
                        For $x = 0 To $btnnr
                            If $a_BTN[$x][0] = 1 Then
                                If $nMsg = $a_BTN[$x][4] Then ClipPut($a_BTN[$x][2])
                            Else
                                $tmp = 0
                                If $nMsg = $a_BTN[$x][4] Then
                                    GUICtrlSetData($a_BTN[$x][5], GUICtrlRead($a_BTN[$x][5]) - 1)
                                    $tmp = 1
                                EndIf
                                If $nMsg = $a_BTN[$x][6] Then
                                    GUICtrlSetData($a_BTN[$x][5], GUICtrlRead($a_BTN[$x][5]) + 1)
                                    $tmp = 1
                                EndIf
                                If $tmp = 1 Then IniWrite($inifile, "BUTTON_" & $a_BTN[$x][8], "02", GUICtrlRead($a_BTN[$x][5]))
                            EndIf
                        Next
                    EndIf
            EndSwitch
        Case $SCP_Form1
            Switch $aMsg[0]
                Case $GUI_EVENT_CLOSE
                    CloseScratchbook()
                Case $SCP_ButtonCLS
                    ControlSetText("", "", $SCP_Edit1, "")
                Case $SCP_ButtonCLSPASTE
                    ControlSetText("", "", $SCP_Edit1, "")
                    Local $clp = ClipGet()
                    ControlSetText("", "", $SCP_Edit1, $clp)
                Case $SCP_ButtonPaste
                    ;Local $clp = ClipGet()
                    ControlFocus($SCP_Form1, "", $SCP_Edit1)
                    Send("^v")
                Case $SCP_ButtonCopy
                    ControlFocus($SCP_Form1, "", $SCP_Edit1)
                    Send("^c")
                Case $SCP_ButtonCopyALL
                    ClipPut(_GUICtrlEdit_GetText($SCP_Edit1))
                Case $SCP_ButtonUndo
                    ;ControlFocus($SCP_Form1,"",$SCP_Edit1)
                    ;Send("^z")
                    _GUICtrlEdit_Undo($SCP_Edit1)
                Case $SCP_CheckLock
                    $iStyle = _WinAPI_GetWindowLong($SCP_hEdit1, $GWL_STYLE)
                    If _IsChecked($SCP_CheckLock) = 1 Then
                        GUICtrlSetStyle($SCP_Edit1, BitOR($iStyle, $ES_READONLY))
                    Else
                        GUICtrlSetStyle($SCP_Edit1, BitXOR($iStyle, $ES_READONLY))
                    EndIf
                Case $SCP_WW
                    $tmp1 = GUICtrlRead($SCP_Edit1)
                    $aRect = WinGetPos($SCP_Form1)

                    GUICtrlDelete($SCP_Edit1)
                    $tmp=0
                    $tmp2=0
                    if _IsChecked($SCP_CheckLock) = 1 Then $tmp=$ES_READONLY
                    If _IsChecked($SCP_WW) = 0 Then
                        $tmp2=BitOR($SCP_WWEdSetting,$ES_AUTOHSCROLL, $WS_HSCROLL,$tmp)
                    Else
                        $tmp2=BitOr($SCP_WWEdSetting,$tmp)
                    EndIf
                    $SCP_Edit1 = GUICtrlCreateEdit("", 3, 30,$aRect[2]-20 , $aRect[3]-73, $tmp2, 0)
                    $SCP_hEdit1= GUICtrlGetHandle(-1)
                    GetIniFont($SCP_Edit1, 1)
                    GUICtrlSetData(-1, $tmp1)
                    GUICtrlSetResizing(-1, $GUI_DOCKTOP)
                    $tmp1=""
                    $tmp2=""
                    $aRect=""
                Case $SCP_ButtonFont
                    SetFont($SCP_Edit1, $SCP_Form1, 1)
            EndSwitch
    EndSwitch
WEnd


Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $IdFrom, $iCode

    $IdFrom = BitAND($wParam, 0x0000FFFF)
    $iCode = BitShift($wParam, 16)

    Switch $IdFrom
        Case $Edit1
            Switch $iCode
                Case $EN_UPDATE
                    $AutoSaveTimer = TimerInit()
                    $AutoSave = 0
            EndSwitch
    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Func Tray_Items($typ)
    Local $tmp, $tmp1
    If $typ = 1 Then
        $tmp = $TRAY_ENABLE
        $tmp1 = $TRAY_ENABLE
    ElseIf $typ = 0 Then
        $tmp = $TRAY_DISABLE
        $tmp1 = $TRAY_DISABLE
    Else
        $tmp = $TRAY_DISABLE
        $tmp1 = $TRAY_ENABLE
    EndIf

    TrayItemSetState($idWW, $tmp)
    TrayItemSetState($idPos, $tmp)
    TrayItemSetState($idRPos, $tmp)
    TrayItemSetState($idFont, $tmp)
    TrayItemSetState($idSave, $tmp)
    TrayItemSetState($idExit, $tmp1)
EndFunc   ;==>Tray_Items

Func AddButtons($typ)
    If $btnnr < 9 Then
        Tray_Items(0)
        $nMsg = GUIGetMsg()
        Local $InputForm, $Button1, $Button2, $Input1, $Input2, $Label1, $Label2
        #Region ### START Koda GUI section ### Form=
        GUISetState(@SW_DISABLE, $Form1)
        $InputForm = GUICreate("Button Generator", 237, 135, -1, -1, BitOR($WS_BORDER, $WS_CAPTION), $WS_EX_APPWINDOW, $Form1)
        $Button1 = GUICtrlCreateButton("Ok", 16, 104, 55, 18, $BS_DEFPUSHBUTTON)
        $Button2 = GUICtrlCreateButton("Cancel", 167, 104, 55, 18)

        If $typ = 1 Then
            $Input1 = GUICtrlCreateInput("", 15, 24, 208, 21)
            $Label1 = GUICtrlCreateLabel("Button Name:", 15, 4, 122, 17)
            $Input2 = GUICtrlCreateInput("", 15, 74, 208, 21)
            $Label2 = GUICtrlCreateLabel("Clipboard Text:", 14, 55, 267, 17)
            GUICtrlSetLimit($Input1, 22)
        Else
            $Input1 = GUICtrlCreateInput("", 15, 24, 208, 21)
            $Label1 = GUICtrlCreateLabel("Descriptional Text:", 15, 4, 122, 17)
            $Input2 = GUICtrlCreateInput("", 15, 74, 208, 21, $ES_NUMBER)
            GUICtrlSetLimit($Input1, 28)
            GUICtrlSetLimit($Input2, 8)
            $Label2 = GUICtrlCreateLabel("Enter a Number", 14, 55, 267, 17)
        EndIf


        GUISetState(@SW_SHOW)
        #EndRegion ### END Koda GUI section ###

        Local $Ex = 0
        While 1
            $nMsg = GUIGetMsg()
            Switch $nMsg
                Case $Button1
                    If GUICtrlRead($Input1) <> "" And GUICtrlRead($Input2) <> "" Then
                        $Ex = 0
                        ExitLoop
                    EndIf
                Case $Button2
                    $Ex = 1
                    ExitLoop
            EndSwitch
        WEnd

        If $Ex = 0 Then
            Local $found = 0
            For $x = 0 To 9
                $tmp = IniRead($inifile, "BUTTON_" & $x, "00", "-1")
                If $tmp <= 0 Then
                    IniWrite($inifile, "BUTTON_" & $x, "00", $typ)
                    IniWrite($inifile, "BUTTON_" & $x, "01", GUICtrlRead($Input1))
                    IniWrite($inifile, "BUTTON_" & $x, "02", GUICtrlRead($Input2))
                    $found = 1
                    ExitLoop
                EndIf
            Next
        EndIf
        GUIDelete($InputForm)
        GUISetState(@SW_ENABLE, $Form1)
        WinActivate($Form1)
        CreateButtons()
        Tray_Items(1)
    EndIf
EndFunc   ;==>AddButtons

Func CreateButtons()

    If $btnnr > -1 Then
        For $x = 0 To $btnnr
            $tmp = $a_BTN[$x][0]
            If $tmp = 1 Then
                GUICtrlDelete($a_BTN[$x][3])
                GUICtrlDelete($a_BTN[$x][4])
            ElseIf $tmp = 2 Then
                GUICtrlDelete($a_BTN[$x][3])
                GUICtrlDelete($a_BTN[$x][4])
                GUICtrlDelete($a_BTN[$x][5])
                GUICtrlDelete($a_BTN[$x][6])
                GUICtrlDelete($a_BTN[$x][7])
            EndIf
        Next
        $btnnr = -1
    EndIf

    For $x = 0 To 9
        $tmp = IniRead($inifile, "BUTTON_" & $x, "00", "-1")
        If $tmp > 0 And $tmp < 9 Then
            $btnnr = $btnnr + 1
            $a_BTN[$btnnr][0] = Int($tmp)
            $a_BTN[$btnnr][1] = IniRead($inifile, "BUTTON_" & $x, "01", "")
            $a_BTN[$btnnr][2] = IniRead($inifile, "BUTTON_" & $x, "02", "")
            $a_BTN[$btnnr][8] = $x
        EndIf
    Next

    For $x = 0 To $btnnr
        $tmp = $a_BTN[$x][0]
        If $tmp > 0 Then
            If $tmp = 1 Then
                $a_BTN[$x][3] = GUICtrlCreateCheckbox("", 650, 60 + $x * 40, 18, 30)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][4] = GUICtrlCreateButton($a_BTN[$x][1], 510, 60 + $x * 40, 130, 30)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                GUICtrlSetTip($a_BTN[$x][4], "Click to copy to clipboard")
            ElseIf $tmp = 2 Then
                $a_BTN[$x][7] = GUICtrlCreateLabel($a_BTN[$x][1] & ":", 510, 53 + $x * 40, 220, 18)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][3] = GUICtrlCreateCheckbox("", 650, 70 + $x * 40, 18, 20)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][4] = GUICtrlCreateButton("-", 510, 70 + $x * 40, 20, 20)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][5] = GUICtrlCreateInput($a_BTN[$x][2], 540, 70 + $x * 40, 60, 20, BitOR($ES_NUMBER, $ES_READONLY))
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
                $a_BTN[$x][6] = GUICtrlCreateButton("+", 610, 70 + $x * 40, 20, 20)
                GUICtrlSetResizing(-1, BitOR($GUI_DOCKHCENTER, $GUI_DOCKVCENTER))
            EndIf
        EndIf
    Next

EndFunc   ;==>CreateButtons

Func _TrayCheckUncheck($id, $nr)
    If $nr = 0 Then
        TrayItemSetState($id, $Tray_Unchecked)
    Else
        TrayItemSetState($id, $Tray_checked)
    EndIf
EndFunc   ;==>_TrayCheckUncheck


Func _CheckUncheck($id, $nr)
    If $nr = 0 Then
        GUICtrlSetState($id, $GUI_UNCHECKED)
    Else
        GUICtrlSetState($id, $GUI_CHECKED)
    EndIf
EndFunc   ;==>_CheckUncheck

Func _IsChecked($idControlID)
    Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc   ;==>_IsChecked

Func ReadFromFile()
    If FileExists(@ScriptDir & "\" & "memory.txt") Then
        Local $hFileOpen = FileOpen(@ScriptDir & "\" & "memory.txt", $FO_READ)
        If $hFileOpen = -1 Then
            MsgBox($MB_SYSTEMMODAL, "ReadFromFile", "An error occurred when reading the file." & @CRLF & @ScriptDir & "\" & "memory.txt")
            Return False
        EndIf
        Local $sFileRead = FileRead($hFileOpen)
        ; Close the handle returned by FileOpen.
        FileClose($hFileOpen)
        GUICtrlSetData($Edit1, $sFileRead, 1)
    EndIf
EndFunc   ;==>ReadFromFile

Func SaveToFile()
    If $DoBackup = 1 Then
        If FileExists(@ScriptDir & "\" & "memory.bak") Then FileDelete(@ScriptDir & "\" & "memory.bak")
        FileCopy(@ScriptDir & "\" & "memory.txt", @ScriptDir & "\" & "memory.bak")
    EndIf

    Local $hFileOpen = FileOpen(@ScriptDir & "\" & "memory.txt", $FO_OVERWRITE)
    If $hFileOpen = -1 Then
        MsgBox($MB_SYSTEMMODAL, "SaveToFile", "An error occurred whilst writing the temporary file." & @CRLF & @ScriptDir & "\" & "memory.txt")
        Return False
    EndIf
    If FileWrite($hFileOpen, GUICtrlRead($Edit1)) = 0 Then
        MsgBox($MB_SYSTEMMODAL, "FileWrite", "Failed to write to Memory.txt" & @CRLF & @ScriptDir & "\" & "memory.txt")
        Return False
    Else
        _GUICtrlEdit_SetModify($Edit1, False)
    EndIf
    FileClose($hFileOpen)
EndFunc   ;==>SaveToFile

Func SetFont($id, $h_gui, $nr = 0)
    For $x = 0 To 7
        $a_Fontc[$x] = $a_Font[$x]
    Next
    $a_Font = _ChooseFont($a_Font[2], $a_Font[3], $a_Font[5], $a_Font[4], $f_Italic, $f_Underline, $f_Strikethru, $h_gui)
    If $a_Font <> -1 Then
        ;  GUICtrlSetFont ( controlID, size [, weight [, attribute [, fontname [, quality]]]] )
        GUICtrlSetFont($id, $a_Font[3], $a_Font[4], $a_Font[1], $a_Font[2], 0)
        GUICtrlSetColor($id, $a_Font[5])
        $f_Italic = BitAND($a_Font[1], 2)
        $f_Underline = BitAND($a_Font[1], 4)
        $f_Strikethru = BitAND($a_Font[1], 8)
        SaveIniFont($nr)
        ;ConsoleWrite(@CRLF & $a_Font[3] & @CRLF & $a_Font[4] & @CRLF & $a_Font[1] & @CRLF & $a_Font[2] & @CRLF & $a_Font[5])
    Else
        Dim $a_Font[8]    ;Font array definition
        For $x = 0 To 7
            $a_Font[$x] = $a_Fontc[$x]
        Next
    EndIf
EndFunc   ;==>SetFont

Func GetIniFont($id, $nr = 0)
    ;Default font definition
    $a_Font[1] = IniRead($f_inifile, "font", $nr & "1", "0")
    $a_Font[2] = IniRead($f_inifile, "font", $nr & "2", "Arial")
    $a_Font[3] = IniRead($f_inifile, "font", $nr & "3", "8")
    $a_Font[4] = IniRead($f_inifile, "font", $nr & "4", "400")
    $a_Font[7] = IniRead($f_inifile, "font", $nr & "7", "0")

    $f_Italic = BitAND($a_Font[1], 2)
    $f_Underline = BitAND($a_Font[1], 4)
    $f_Strikethru = BitAND($a_Font[1], 8)
    GUICtrlSetFont($id, $a_Font[3], $a_Font[4], $a_Font[1], $a_Font[2], 0)
    GUICtrlSetColor($id, $a_Font[7])
EndFunc   ;==>GetIniFont

Func SaveIniFont($nr = 0)
    IniWrite($f_inifile, "font", $nr & "1", $a_Font[1])
    IniWrite($f_inifile, "font", $nr & "2", $a_Font[2])
    IniWrite($f_inifile, "font", $nr & "3", $a_Font[3])
    IniWrite($f_inifile, "font", $nr & "4", $a_Font[4])
    IniWrite($f_inifile, "font", $nr & "7", $a_Font[7])
EndFunc   ;==>SaveIniFont


Func CW($txt)
    ConsoleWrite($txt & @CRLF)
EndFunc   ;==>CW

Func _KeyProc($nCode, $wParam, $lParam)

    If $nCode < 0 Or $MouseVolume = 0 Then
        Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam)
    EndIf
    Local $info = DllStructCreate($MSLLHOOKSTRUCT, $lParam)
    Switch $wParam
        Case $WM_XBUTTONDOWN, $WM_XBUTTONUP, $WM_XBUTTONDBLCLK, $WM_NCXBUTTONDOWN, $WM_NCXBUTTONUP, $WM_NCXBUTTONDBLCLK
            If _WinAPI_HiWord(DllStructGetData($info, "mouseData")) = 1 Then
                Send("{VOLUME_DOWN}")
            Else
                Send("{VOLUME_UP}")
            EndIf
            Return 1
        Case Else
            Return _WinAPI_CallNextHookEx($g_hHook, $nCode, $wParam, $lParam)
    EndSwitch


EndFunc   ;==>_KeyProc

Func _KeyboardProc($nCode, $wParam, $lParam)
    ;Win Space code part from https://www.autoitscript.com/forum/topic/154094-hotkeyset-for-winspace-does-not-get-trapped/
    ;Alt Tab code part from ;https://www.autoitscript.com/forum/topic/87853-disabling-alttab/
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)

    Switch $wParam
        Case $WM_KEYDOWN, $WM_SYSKEYDOWN, $WM_KEYUP, $WM_SYSKEYUP
            Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
            Local $vKode = DllStructGetData($tKEYHOOKS, "vkCode")
            Local $iFlags = DllStructGetData($tKEYHOOKS, "flags")
            $t1 = $vKode
            $t2 = $iFlags
            Switch $wParam
                Case $WM_KEYDOWN
                    Switch $vKode
                        Case $VK_SPACE
                            If $isWinDown1 Or $isWinDown2 Then
                                If $DisableLWINSpace Then Return -1
                            EndIf
                        Case $VK_LWIN
                            $isWinDown1 = True
                            $isWinDown1T = TimerInit()
                        Case $VK_RWIN
                            $isWinDown2 = True
                            $isWinDown2T = TimerInit()
                    EndSwitch
                Case $WM_KEYUP
                    Switch $vKode
                        Case $VK_LWIN
                            $isWinDown1 = False
                        Case $VK_RWIN
                            $isWinDown2 = False
                    EndSwitch
            EndSwitch
            Switch $vKode
                Case $VK_TAB
                    If BitAND($iFlags, $LLKHF_ALTDOWN) And $DisableAltTab = 1 Then Return -1
                Case $VK_CAPSLOCK
                    If $DisableCaps = 1 Then Return -1
            EndSwitch
    EndSwitch

    Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
EndFunc   ;==>_KeyboardProc

Func KillProcess($exename)
    Local $aProcessList = ProcessList($exename)
    For $i = 1 To $aProcessList[0][0]
        ProcessClose($aProcessList[$i][1])
    Next
EndFunc   ;==>KillProcess

Func Cleanup()
    DllCallbackFree($hHookProc)
    _WinAPI_UnhookWindowsHookEx($hHookKeyboard)
    _WinAPI_UnhookWindowsHookEx($g_hHook)
    DllCallbackFree($g_hStub_KeyProc)
    Exit
EndFunc   ;==>Cleanup

Func SetOnOffTop($wintxt, $top = 1)
    Local $aWL = WinList($wintxt)
    If @error = 0 Then
        For $x = 1 To $aWL[0][0]
            WinSetOnTop($aWL[$x][1], "", $top)
            If $top = 1 Then WinActivate($aWL[$x][1])
        Next
    EndIf
    $aWL = ""
EndFunc   ;==>SetOnOffTop

Func CloseScratchbook()
    TrayItemSetState($idScratchbook, $Tray_Unchecked)
    GUIDelete($SCP_Form1)
    $SCP_WInOpen = 0
EndFunc   ;==>CloseScratchbook

Func Scratchbook()
    #Region ### START Koda GUI section ### Form=
    $SCP_Form1 = GUICreate($SCP_formTitle, 616, 440, 208, 165, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP))
    $SCP_Edit1 = GUICtrlCreateEdit("", 3, 30, 610, 406, -1, 0)
    GUICtrlSetData(-1, "")
    GUICtrlSetResizing(-1, $GUI_DOCKTOP)
    $SCP_hEdit1= GUICtrlGetHandle(-1)
    $SCP_ButtonCLS = GUICtrlCreateButton("Clear", 2, 0, 33, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $SCP_ButtonCLSPASTE = GUICtrlCreateButton("Clear and Paste", 110, 0, 86, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $SCP_ButtonPaste = GUICtrlCreateButton("Paste", 45, 0, 54, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $SCP_ButtonCopy = GUICtrlCreateButton("Copy", 210, 0, 49, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $SCP_ButtonCopyALL = GUICtrlCreateButton("CopyAll", 262, 0, 54, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $SCP_ButtonUndo = GUICtrlCreateButton("Undo", 325, 0, 40, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $SCP_ButtonFont = GUICtrlCreateButton("Font", 365, 0, 40, 21)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $SCP_CheckLock = GUICtrlCreateCheckbox("Read only", 484, 0, 65, 16)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $SCP_WW = GUICtrlCreateCheckbox("WordWrap", 409, 1, 72, 15)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $SCP_WInOpen = 1
    TrayItemSetState($idScratchbook, $Tray_checked)
    GetIniFont($SCP_Edit1, 1)
EndFunc   ;==>Scratchbook

Func MY_WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam)
    If $hWnd=$SCP_Form1 Then; the main GUI-limited to 640x480
        $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int",$lParam)
        DllStructSetData($minmaxinfo,7,550); min X
        DllStructSetData($minmaxinfo,8,240); min Y
        Return 0
    Else;other dialogs-"no" lower limit
        Return 0
    EndIf
EndFunc

I've added a few options to this, including the scratchbook(scratchpad) from one of my previous posts.

Summary of the new tray menu items:

Open Scratchbook - opens a Text editor window, which does not save the text.

Show Keydebugger - Shows a window which displays the keys catched by the _KeyboardProc function

Close SDLBasic/BlitzBasic compiler - Closes all the instances of these running programs, in case of endless loops.

Set PopOut for Youtube On/Off Top - Sets all the window instances of the Chrome extension "Popout for youtube" on or off top. 

In the Options menu, there are few more items, adding global hotkeys, these are on by default (turn them off once to save these options to the ini file):

Disable: LeftWin + Space key,  CapsLock,  Alt Tab

Set Mouse Keys 3+4 to Volume Up/Down

Have fun.

 

Edit: 21.01.2023 - Bugfix: After pressing the Win + L key for the lockscreen and returning back, sometime the key got stuck (or the variable did not got reseted by the $wm_keyup). - Added a timer to manually reset the variables after 5 seconds.

Edit: 28.01.2023 - Added: Recalling a window position from the saved position, replaced the "Reset Position" with "Move to 0,0" menu item.

Edit: 18.03.2023 - Changed: Word Wrapping is now functioning correctly. The Scratchbook window has now a limited minimum size.

Edited by Dan_555

Some of my script sourcecode

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

    No registered users viewing this page.

×
×
  • Create New...