Jump to content

Check Boxes


Recommended Posts

i started learning how to send simple commands like Send sleep and slowly got to make few things by Editing and looking at help file

this is my first time to work with GUI and i used koda to help me with it, so what i am trying to make with this code is simply key press and also to learn how check boxes works if a box is ticked , and tried to set a delay that user choses

Code

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Simple Presser", 261, 393, 240, 130)
$Checkbox1 = GUICtrlCreateCheckbox("1", 5, 80, 25, 17)
$Checkbox2 = GUICtrlCreateCheckbox("2", 5, 112, 25, 17)
$Checkbox3 = GUICtrlCreateCheckbox("3", 5, 144, 25, 17)
$Checkbox7 = GUICtrlCreateCheckbox("4", 5, 176, 25, 17)
$Checkbox4 = GUICtrlCreateCheckbox("5", 5, 208, 25, 17)
$Checkbox5 = GUICtrlCreateCheckbox("6", 5, 240, 25, 17)
$Checkbox6 = GUICtrlCreateCheckbox("7", 5, 272, 25, 17)
$Checkbox8 = GUICtrlCreateCheckbox("8", 5, 304, 25, 17)
$Checkbox0 = GUICtrlCreateCheckbox("0", 5, 368, 25, 17)
$Checkbox9 = GUICtrlCreateCheckbox("9", 5, 336, 25, 17)
$Checkboxx = GUICtrlCreateCheckbox("X", 5, 48, 25, 17)
$Button1 = GUICtrlCreateButton("Stop", 160, 99, 97, 25, $WS_GROUP)
$Button4 = GUICtrlCreateButton("Start", 160, 5, 97, 25, $WS_GROUP)
$Button5 = GUICtrlCreateButton("Exit", 160, 51, 97, 25, $WS_GROUP)
$Input1 = GUICtrlCreateInput("1000", 48, 368, 81, 21)
$Input2 = GUICtrlCreateInput("1000", 48, 336, 81, 21)
$Input3 = GUICtrlCreateInput("1000", 48, 304, 81, 21)
$Input4 = GUICtrlCreateInput("1000", 48, 272, 81, 21)
$Input5 = GUICtrlCreateInput("1000", 48, 240, 81, 21)
$Input6 = GUICtrlCreateInput("1000", 48, 208, 81, 21)
$Input7 = GUICtrlCreateInput("1000", 48, 176, 81, 21)
$Input8 = GUICtrlCreateInput("1000", 48, 144, 81, 21)
$Input9 = GUICtrlCreateInput("1000", 48, 112, 81, 21)
$Input10 = GUICtrlCreateInput("1000", 48, 80, 81, 21)
$Input11 = GUICtrlCreateInput("1000", 48, 48, 81, 21)
$Delay = GUICtrlCreateLabel("Delay", 48, 16, 31, 17)
$Key = GUICtrlCreateLabel("Key", 5, 16, 22, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

If u take a look at it u will understand what i want to do .

Thx in advance

Edited by SilentCurse
Link to comment
Share on other sites

  • Moderators

SilentCurse,

Here is one way to do what you want. It looks pretty complex, but read the comments carefully and you will see that it is really very simple.

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

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Simple Presser", 261, 393, 240, 130)

$Checkbox0 = GUICtrlCreateCheckbox("0", 5,  48, 25, 17)
$Checkbox1 = GUICtrlCreateCheckbox("1", 5,  80, 25, 17)
$Checkbox2 = GUICtrlCreateCheckbox("2", 5, 112, 25, 17)
$Checkbox3 = GUICtrlCreateCheckbox("3", 5, 144, 25, 17)
$Checkbox7 = GUICtrlCreateCheckbox("4", 5, 176, 25, 17)
$Checkbox4 = GUICtrlCreateCheckbox("5", 5, 208, 25, 17)
$Checkbox5 = GUICtrlCreateCheckbox("6", 5, 240, 25, 17)
$Checkbox6 = GUICtrlCreateCheckbox("7", 5, 272, 25, 17)
$Checkbox8 = GUICtrlCreateCheckbox("8", 5, 304, 25, 17)
$Checkbox9 = GUICtrlCreateCheckbox("9", 5, 336, 25, 17)
$CheckboxX = GUICtrlCreateCheckbox("X", 5, 368, 25, 17)

$Button4 = GUICtrlCreateButton("Start", 160,  5, 97, 25, $WS_GROUP)
$Button1 = GUICtrlCreateButton("Stop", 160,  55, 97, 25, $WS_GROUP)
$Button5 = GUICtrlCreateButton("Exit", 160, 105, 97, 25, $WS_GROUP)

$Input0 = GUICtrlCreateInput("1000", 48,  48, 81, 21)
$Input1 = GUICtrlCreateInput("1000", 48,  80, 81, 21)
$Input2 = GUICtrlCreateInput("1000", 48, 112, 81, 21)
$Input3 = GUICtrlCreateInput("1000", 48, 144, 81, 21)
$Input4 = GUICtrlCreateInput("1000", 48, 176, 81, 21)
$Input5 = GUICtrlCreateInput("1000", 48, 208, 81, 21)
$Input6 = GUICtrlCreateInput("1000", 48, 240, 81, 21)
$Input7 = GUICtrlCreateInput("1000", 48, 272, 81, 21)
$Input8 = GUICtrlCreateInput("1000", 48, 304, 81, 21)
$Input9 = GUICtrlCreateInput("1000", 48, 336, 81, 21)
$InputX = GUICtrlCreateInput("1000", 48, 368, 81, 21)

$Delay = GUICtrlCreateLabel("Delay", 48, 16, 31, 17)
$Key = GUICtrlCreateLabel("Key", 5, 16, 22, 17)

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

; Calculate difference between Checkbox and Input ControlID
$CheckToInput = $Input0 - $Checkbox0

; Start a loop
While 1
; Check if a button is pressed
    Switch GUIGetMsg()
        ; Window closed or "Exit" pressed
            Case $GUI_EVENT_CLOSE, $Button5
            ; Exit the whole script
                ConsoleWrite("Exiting" & @CRLF)
                Exit
        ; "Start" pressed
            Case $Button4
            ; Run down checkboxes to find first ticked
                For $i = $Checkbox0 To $CheckboxX
                ; Read 'state' of checkbox
                    If GUICtrlRead($i) = 1 Then
                    ; If ticked then calculate which key is needed
                        $Key = $i - $Checkbox0
                    ; "X" is a special case!
                        If $Key = 10 Then $Key = "X"
                    ; Now read the associated input for the delay
                        $Delay = GUICtrlRead($i + $CheckToInput)

                    ; Start another loop
                        While 1
                        ; Send the key (but here it goes to the SciTE console)
                            ConsoleWrite($Key & @CRLF); Send($Key)
                        ; Get the time
                            $Begin = TimerInit()
                        ; Begin yet another loop - yes you do need it!
                            Do
                            ; Check if a button is pressed
                                Switch GUIGetMsg()
                                ; Window closed or "Exit" pressed
                                    Case $GUI_EVENT_CLOSE, $Button5
                                    ; Exit the whole script
                                        ConsoleWrite("Exiting" & @CRLF)
                                        Exit
                                ; "Stop" pressed
                                    Case $Button1
                                    ; Exit the 3 inner loops (For, While, Do) to get back to outer While loop
                                        ConsoleWrite("Stopping" & @CRLF)
                                        ExitLoop 3
                                EndSwitch
                        ; Check to see if the delay has finished
                            Until TimerDiff($Begin) > $Delay
                        WEnd
                    EndIf
                Next
    EndSwitch
WEnd

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

SilentCurse,

Here is one way to do what you want. It looks pretty complex, but read the comments carefully and you will see that it is

Do ask if anything is unclear.

M23

Thanks M23 , but what i am trying to learn how to to do is for example i want to tick box 1 with delay 1000

then number 3 with 6000 delay then x and so on not just tick the first box , more like a simple key presser

i know i can get programs to do this task . but the idea of how its made to observe the code and learn from and then get further , sorry if i am asking too much

Thanks for helping me out

Link to comment
Share on other sites

  • Moderators

SilentCurse,

Do you mean you want the keys "ticked" to be sent at regular intervals like this:

Key 1 - Every 500ms

Key 2 - Every 1000ms

Key 3 - Every 2000ms

So that you get: 1 (500ms) 1 (500ms) 12 (500ms) 1 (500ms) 123 (500ms) 1 (500ms) 12 (500ms) 1 (500ms) 123...... until you stop.

Or do you want a single delay between each key:

1 (500ms) 2 (1000ms) 3 (2000ms) Stop.

I imagine it is the first option, but I thought I would ask!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

SilentCurse,

Do you mean you want the keys "ticked" to be sent at regular intervals like this:

Key 1 - Every 500ms

Key 2 - Every 1000ms

Key 3 - Every 2000ms

So that you get: 1 (500ms) 1 (500ms) 12 (500ms) 1 (500ms) 123 (500ms) 1 (500ms) 12 (500ms) 1 (500ms) 123...... until you stop.

Or do you want a single delay between each key:

1 (500ms) 2 (1000ms) 3 (2000ms) Stop.

I imagine it is the first option, but I thought I would ask!

M23

First of all i would like to say how thankful i am for ur help and how sorry that i am bothering u with my Rquest

as you have seen how the prog look like what i want it to do is more like this

Key Delay

X 2000 which means i need X to press every 2 sec

1 3000 press After 3 sec of the X Key delay

2 3000 press after 3 sec of the 1 Key delay

and so on

and if is it possible to send such Key to specific application [games for example] that i chose with prompt screen that says (your client name)

Edited by SilentCurse
Link to comment
Share on other sites

  • Moderators

SilentCurse,

I am sorry, but I still do not quite understand what you want to do (it must be age you know!). Do you want this:

Seconds
1   2   3   4   5   6   7   8   9   0   1   2   3   4   5   6   7   8   9   0   1   2   3   4   5
X 2000 - every 2 seconds
Xa      Xb      Xc      Xd      Xe      Xf      Xg      Xh      Xi      Xj
1 3000 - 3 seconds after each X
                1a      1b      1c      1d      1e      1f      1g      1h      1i      1k
2 3000 - 3 seconds after each 1
                            2a      2b      2c      2d      2e      2f      2g      2h      2i      3j

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

SilentCurse,

Do you mean you want the keys "ticked" to be sent at regular intervals like this:

Key 1 - Every 500ms

Key 2 - Every 1000ms

Key 3 - Every 2000ms

So that you get: 1 (500ms) 1 (500ms) 12 (500ms) 1 (500ms) 123 (500ms) 1 (500ms) 12 (500ms) 1 (500ms) 123...... until you stop.

Or do you want a single delay between each key:

1 (500ms) 2 (1000ms) 3 (2000ms) Stop.

I imagine it is the first option, but I thought I would ask!

M23

its not age , its my level of English . to make things easier lets say i want the 2nd option to have a delay that i chose between each key that is Ticked , if u still cant get the idea and u wont mind me msging on MSN or Skype then please do as i need help with this thing
Link to comment
Share on other sites

  • Moderators

SilentCurse,

Here is a script that reads the keys and then sends them in order with the next being sent after the specified delay:

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

#include <Array.au3>

; Initialise a 2D array for the key presses and delays
Global $aKeys[10][2]

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Simple Presser", 261, 393, 240, 130)

$Checkbox0 = GUICtrlCreateCheckbox("0", 5,  48, 25, 17)
$Checkbox1 = GUICtrlCreateCheckbox("1", 5,  80, 25, 17)
$Checkbox2 = GUICtrlCreateCheckbox("2", 5, 112, 25, 17)
$Checkbox3 = GUICtrlCreateCheckbox("3", 5, 144, 25, 17)
$Checkbox7 = GUICtrlCreateCheckbox("4", 5, 176, 25, 17)
$Checkbox4 = GUICtrlCreateCheckbox("5", 5, 208, 25, 17)
$Checkbox5 = GUICtrlCreateCheckbox("6", 5, 240, 25, 17)
$Checkbox6 = GUICtrlCreateCheckbox("7", 5, 272, 25, 17)
$Checkbox8 = GUICtrlCreateCheckbox("8", 5, 304, 25, 17)
$Checkbox9 = GUICtrlCreateCheckbox("9", 5, 336, 25, 17)
$CheckboxX = GUICtrlCreateCheckbox("X", 5, 368, 25, 17)

$Button4 = GUICtrlCreateButton("Start", 160,  5, 97, 25, $WS_GROUP)
$Button1 = GUICtrlCreateButton("Stop", 160,  55, 97, 25, $WS_GROUP)
$Button5 = GUICtrlCreateButton("Exit", 160, 105, 97, 25, $WS_GROUP)

$Input0 = GUICtrlCreateInput("1000", 48,  48, 81, 21)
$Input1 = GUICtrlCreateInput("1000", 48,  80, 81, 21)
$Input2 = GUICtrlCreateInput("1000", 48, 112, 81, 21)
$Input3 = GUICtrlCreateInput("1000", 48, 144, 81, 21)
$Input4 = GUICtrlCreateInput("1000", 48, 176, 81, 21)
$Input5 = GUICtrlCreateInput("1000", 48, 208, 81, 21)
$Input6 = GUICtrlCreateInput("1000", 48, 240, 81, 21)
$Input7 = GUICtrlCreateInput("1000", 48, 272, 81, 21)
$Input8 = GUICtrlCreateInput("1000", 48, 304, 81, 21)
$Input9 = GUICtrlCreateInput("1000", 48, 336, 81, 21)
$InputX = GUICtrlCreateInput("1000", 48, 368, 81, 21)

$Delay = GUICtrlCreateLabel("Delay", 48, 16, 31, 17)
$Key = GUICtrlCreateLabel("Key", 5, 16, 22, 17)

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

; Calculate difference between Checkbox and Input ControlID
$CheckToInput = $Input0 - $Checkbox0

; Start a loop
While 1
; Check if a button is pressed
    Switch GUIGetMsg()
       ; Window closed or "Exit" pressed
            Case $GUI_EVENT_CLOSE, $Button5
           ; Exit the whole script
                ConsoleWrite("Exiting" & @CRLF)
                Exit
       ; "Start" pressed
            Case $Button4
        ; Start key counter
            $iCount = 0
           ; Run down checkboxes to see if ticked
                For $i = $Checkbox0 To $CheckboxX
               ; Read 'state' of checkbox
                    If GUICtrlRead($i) = 1 Then
                    ; If ticked then calculate which key is needed
                        $Key = $i - $Checkbox0
                    ; "X" is a special case!
                        If $Key = 10 Then $Key = "X"
                    ; Now read the associated input for the delay
                        $Delay = GUICtrlRead($i + $CheckToInput)
                    ; Add to our array
                        $aKeys[$iCount][0] = $Key
                        $aKeys[$iCount][1] = $Delay
                    ; and increase the count
                        $iCount += 1
                    EndIf
                Next

                _ArrayDisplay($aKeys)

                For $i = 0 To $iCount - 1
                    ConsoleWrite($aKeys[$i][0] & @CRLF)
                    Sleep($aKeys[$i][1])
                Next

                ConsoleWrite("Resetting" & @CRLF)
                For $i = $Checkbox0 To $CheckboxX
                    GUICtrlSetState($i, $GUI_UNCHECKED)
                    GUICtrlSetData($i + $CheckToInput, 1000)
                Next

    EndSwitch
WEnd

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

SilentCurse,

ink your GUI to include some form of ordering.

I hope we are getting there. :-)

M23

YES !! thats how i want it to work the only thing that i hope it can be fixed is that after it finish it reset all the boxes ( which i dont want) i want it to keep going in infinit loop after i click start and stop when i click stop
Link to comment
Share on other sites

  • Moderators

SilentCurse,

That is easy - here you go:

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

; Initialise a 2D array for the key presses and delays
Global $aKeys[10][2]

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Simple Presser", 261, 393, 240, 130)

$Checkbox0 = GUICtrlCreateCheckbox("0", 5,  48, 25, 17)
$Checkbox1 = GUICtrlCreateCheckbox("1", 5,  80, 25, 17)
$Checkbox2 = GUICtrlCreateCheckbox("2", 5, 112, 25, 17)
$Checkbox3 = GUICtrlCreateCheckbox("3", 5, 144, 25, 17)
$Checkbox7 = GUICtrlCreateCheckbox("4", 5, 176, 25, 17)
$Checkbox4 = GUICtrlCreateCheckbox("5", 5, 208, 25, 17)
$Checkbox5 = GUICtrlCreateCheckbox("6", 5, 240, 25, 17)
$Checkbox6 = GUICtrlCreateCheckbox("7", 5, 272, 25, 17)
$Checkbox8 = GUICtrlCreateCheckbox("8", 5, 304, 25, 17)
$Checkbox9 = GUICtrlCreateCheckbox("9", 5, 336, 25, 17)
$CheckboxX = GUICtrlCreateCheckbox("X", 5, 368, 25, 17)

$Button4 = GUICtrlCreateButton("Start", 160,  5, 97, 25, $WS_GROUP)
$Button1 = GUICtrlCreateButton("Stop", 160,  55, 97, 25, $WS_GROUP)
$Button5 = GUICtrlCreateButton("Exit", 160, 105, 97, 25, $WS_GROUP)

$Input0 = GUICtrlCreateInput("1000", 48,  48, 81, 21)
$Input1 = GUICtrlCreateInput("1000", 48,  80, 81, 21)
$Input2 = GUICtrlCreateInput("1000", 48, 112, 81, 21)
$Input3 = GUICtrlCreateInput("1000", 48, 144, 81, 21)
$Input4 = GUICtrlCreateInput("1000", 48, 176, 81, 21)
$Input5 = GUICtrlCreateInput("1000", 48, 208, 81, 21)
$Input6 = GUICtrlCreateInput("1000", 48, 240, 81, 21)
$Input7 = GUICtrlCreateInput("1000", 48, 272, 81, 21)
$Input8 = GUICtrlCreateInput("1000", 48, 304, 81, 21)
$Input9 = GUICtrlCreateInput("1000", 48, 336, 81, 21)
$InputX = GUICtrlCreateInput("1000", 48, 368, 81, 21)

$Delay = GUICtrlCreateLabel("Delay", 48, 16, 31, 17)
$Key = GUICtrlCreateLabel("Key", 5, 16, 22, 17)

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

; Calculate difference between Checkbox and Input ControlID
$CheckToInput = $Input0 - $Checkbox0

; Start a loop
While 1
; Check if a button is pressed
    Switch GUIGetMsg()
       ; Window closed or "Exit" pressed
            Case $GUI_EVENT_CLOSE, $Button5
           ; Exit the whole script
                ConsoleWrite("Exiting" & @CRLF)
                Exit
       ; "Start" pressed
            Case $Button4
        ; Start key counter
            $iCount = 0
            ; Run down checkboxes to see if ticked
                For $i = $Checkbox0 To $CheckboxX
               ; Read 'state' of checkbox
                    If GUICtrlRead($i) = 1 Then
                    ; If ticked then calculate which key is needed
                        $Key = $i - $Checkbox0
                    ; "X" is a special case!
                        If $Key = 10 Then $Key = "X"
                    ; Now read the associated input for the delay
                        $Delay = GUICtrlRead($i + $CheckToInput)
                    ; Add to our array
                        $aKeys[$iCount][0] = $Key
                        $aKeys[$iCount][1] = $Delay
                    ; and increase the count
                        $iCount += 1
                    EndIf
                Next

            ; Now start the infinite loop
                While 1
                    For $i = 0 To $iCount - 1
                        ConsoleWrite($aKeys[$i][0] & @CRLF)
                        $begin = TimerInit()
                        Do
                            Switch GUIGetMsg()
                                Case $GUI_EVENT_CLOSE, $Button5
                                ; Exit the whole script
                                    ConsoleWrite("Exiting" & @CRLF)
                                    Exit
                                Case $Button1
                                ; Stop the Sending
                                    ConsoleWrite("Stopping" & @CRLF)
                                ; Exit the While, For and Do loops
                                    ExitLoop 3
                            EndSwitch
                        Until TimerDiff($begin) > $aKeys[$i][1]
                    Next
                WEnd

            ; Reset ready for next cycle
                ConsoleWrite("Resetting" & @CRLF)
                For $i = $Checkbox0 To $CheckboxX
                    GUICtrlSetState($i, $GUI_UNCHECKED)
                    GUICtrlSetData($i + $CheckToInput, 1000)
                Next

    EndSwitch
WEnd

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

SilentCurse,

Look at WinActivate in the Help file. Time you did some more coding for yourself! :-) Came back if you have problems.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

SilentCurse,

Glad I could help. :-)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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