Jump to content
Stormgrade

@GUI_CTRLID mess with my switch

Recommended Posts

Stormgrade

Hello,

I need some help with my gui, when I click on button 2 it call a MsgBox 2, but when I click on button 1 then button 2 it call a MsgBox 1.

I tear appart my code to minimal function then the error occur again ...

Here the script :

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

 AutoIt Version : 3.3.14.0
 Auteur:

 Fonction du Script :
    Modèle de Script AutoIt.

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

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>


Opt("GUIOnEventMode", 1);important pour gérer les fonctions et les gui

Global $GUI1
Global $GUI1_Label1, $GUI1_Label2
Global $GUI1_Input1, $GUI1_Input2
Global $GUI1_Bouton1, $GUI1_Bouton2, $GUI1_Bouton3

Global $GUI2 = 9999
Global $GUI2_Label1 = 9999, $GUI2_Label2 = 9999, $GUI2_Label3 = 9999
Global $GUI2_Input1 = 9999, $GUI2_Input2 = 9999, $GUI2_Input3 = 9999
Global $GUI2_Bouton1 = 9999
Global $GUI2_Checkbox1 = 9999

Global $GUI3 = 9998, $GUI3_Input1 = 9998, $GUI3_Label1 = 9998, $GUI3_Bouton1 = 9998

Global $GUI4 = 9997
Global $GUI4_List1 = 9997
Global $GUI4_Bouton1 = 9997, $GUI4_Bouton2 = 9997, $GUI4_Bouton3 = 9997, $GUI4_Bouton4 = 9997, $GUI4_Bouton5 = 9997, $GUI4_Bouton6 = 9997, $GUI4_Bouton7 = 9997

Global $GUI9 = 5689
Global $GUI9_Input1 = 5689, $GUI9_Input2 = 5689, $GUI9_Input3 = 5689, $GUI9_Input4 = 5689
Global $GUI9_Label1 = 5689, $GUI9_Label2 = 5689, $GUI9_Label3 = 5689, $GUI9_Label4 = 5689
Global $GUI9_Bouton1 = 5689

Global $GUI6 = 9995
Global $GUI6_Label1 = 9995, $GUI6_Label2 = 9995, $GUI6_Label3 = 9995
Global $GUI6_Input1 = 9995, $GUI6_Input2 = 9995, $GUI6_Input3 = 9995
Global $GUI6_Bouton1 = 9995
Global $GUI6_Checkbox1 = 9995

Global $GUI7 = 9994
Global $GUI7_Label1 = 9994, $GUI7_Label2 = 9994, $GUI7_Label3 = 9994
Global $GUI7_Input1 = 9994, $GUI7_Input2 = 9994, $GUI7_Input3 = 9994
Global $GUI7_Bouton1 = 9994, $GUI7_Bouton2 = 9994, $GUI7_Bouton3 = 9994
Global $GUI7_Checkbox1 = 9994


Global $MyQuery, $MyQueryRow
Global $TempDataEncryptage, $TempDataDecryptage
Global $Input1_Read, $Input2_Read, $Input3_Read, $Input4_Read
Global $aSQLResult, $iRows, $iColumns, $iRval
Global $GUI4_List1_Indice, $GUI4_List1_Item


GUI1_Principal()

Func GUI1_Principal();fenêtre principale
    $GUI1 = GUICreate("Password Manager", 266, 120, 786, 412)
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")

    $GUI1_Label1 = GUICtrlCreateLabel("Login", 24, 12, 30, 18)
    $GUI1_Label2 = GUICtrlCreateLabel("Password", 8, 44, 50, 18)

    $GUI1_Bouton1 = GUICtrlCreateButton("OUVRIR", 192, 8, 58, 58)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI1_Bouton2 = GUICtrlCreateButton("Change Password", 144, 72, 114, 34)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI1_Bouton3 = GUICtrlCreateButton("Change Login", 8, 72, 114, 34)
    GUICtrlSetOnEvent(-1, "On_Button")

    $GUI1_Input1 = GUICtrlCreateInput("", 64, 8, 114, 22)
    $GUI1_Input2 = GUICtrlCreateInput("", 64, 40, 114, 22)

    GUISetState()

    While 1
        Sleep(10)
    WEnd
EndFunc   ;==>GUI1_Principal

Func GUI2_change_password();changer mot de passe
    $GUI2 = GUICreate("Change Password", 284, 152, 721, 395)
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")

    $GUI2_Label1 = GUICtrlCreateLabel("Last Password", 8, 12, 74, 18)
    $GUI2_Label2 = GUICtrlCreateLabel("New Password", 8, 44, 76, 18)
    $GUI2_Label3 = GUICtrlCreateLabel("Check Password", 8, 76, 84, 18)

    $GUI2_Input1 = GUICtrlCreateInput("", 120, 8, 154, 22)
    $GUI2_Input2 = GUICtrlCreateInput("", 120, 40, 154, 22)
    $GUI2_Input3 = GUICtrlCreateInput("", 120, 72, 154, 22)

    $GUI2_Bouton1 = GUICtrlCreateButton("VALIDATE", 136, 104, 114, 34)
    GUICtrlSetOnEvent(-1, "On_Button")

    $GUI2_Checkbox1 = GUICtrlCreateCheckbox("Display Password", 8, 112, 114, 18)
    GUICtrlSetOnEvent(-1, "On_Checkbox")

    GUISetState()
EndFunc ;=>GUI2_change_password

Func GUI3_change_login();changer login
    $GUI3 = GUICreate("Change Login", 240, 102, 674, 392)
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")

    $GUI3_Input1 = GUICtrlCreateInput("", 88, 16, 114, 22)

    $GUI3_Label1 = GUICtrlCreateLabel("New Login", 16, 20, 56, 18)

    $GUI3_Bouton1 = GUICtrlCreateButton("VALIDATE", 88, 48, 114, 34)
    GUICtrlSetOnEvent(-1, "On_Button")

    GUISetState()
EndFunc ;=>GUI3_change_login

Func GUI4_Manager();manager
    $GUI4 = GUICreate("Password Manager", 528, 282, 690, 294)
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")


    $GUI4_List1 = GUICtrlCreateListView("", 16, 16, 426, 188)

    $GUI4_Bouton1 = GUICtrlCreateButton("Add Entry", 16, 216, 98, 50)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI4_Bouton2 = GUICtrlCreateButton("Modify Entry", 120, 216, 98, 50)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI4_Bouton3 = GUICtrlCreateButton("Delete Entry", 232, 216, 98, 50)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI4_Bouton4 = GUICtrlCreateButton("View", 344, 216, 98, 50)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI4_Bouton5 = GUICtrlCreateButton("Trie A/z", 464, 16, 50, 50)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI4_Bouton6 = GUICtrlCreateButton("Trie Z/a", 464, 152, 50, 50)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI4_Bouton7 = GUICtrlCreateButton("PG", 464, 84, 49, 49)
    GUICtrlSetOnEvent(-1, "On_Button")

    GUISetState()
EndFunc ;=>GUI4_Manager

Func GUI5_Add();add entry
    $GUI9 = GUICreate("Add an entry", 304, 192, 666, 358)
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")

    $GUI9_Input1 = GUICtrlCreateInput("", 112, 16, 178, 22)
    $GUI9_Input2 = GUICtrlCreateInput("", 112, 48, 178, 22)
    $GUI9_Input3 = GUICtrlCreateInput("", 112, 80, 178, 22)
    $GUI9_Input4 = GUICtrlCreateInput("", 112, 112, 178, 22)

    $GUI9_Label1 = GUICtrlCreateLabel("Name", 8, 20, 32, 18)
    $GUI9_Label2 = GUICtrlCreateLabel("Login", 8, 52, 30, 18)
    $GUI9_Label3 = GUICtrlCreateLabel("Password", 8, 84, 50, 18)
    $GUI9_Label4 = GUICtrlCreateLabel("Retape Password", 8, 116, 88, 18)

    $GUI9_Bouton1 = GUICtrlCreateButton("Validate", 112, 144, 114, 34); <================== problem
    GUICtrlSetOnEvent($GUI9_Bouton1, "On_Button")

    GUISetState()
EndFunc ;=>GUI5_Add

Func GUI6_MOD();mod entry
    $GUI6 = GUICreate("Modify Entry", 288, 166, 572, 306)
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")

    $GUI6_Label1 = GUICtrlCreateLabel("Name", 8, 20, 32, 18)
    $GUI6_Label2 = GUICtrlCreateLabel("Login", 8, 52, 30, 18)
    $GUI6_Label3 = GUICtrlCreateLabel("Password", 8, 84, 50, 18)

    $GUI6_Input1 = GUICtrlCreateInput("", 80, 16, 194, 22)
    $GUI6_Input2 = GUICtrlCreateInput("", 80, 48, 194, 22)
    $GUI6_Input3 = GUICtrlCreateInput("", 80, 80, 194, 22)

    $GUI6_Bouton1 = GUICtrlCreateButton("Modify", 160, 120, 114, 34)
    GUICtrlSetOnEvent(-1, "On_Button")

    $GUI6_Checkbox1 = GUICtrlCreateCheckbox("Show Password", 40, 128, 100, 18)
    GUICtrlSetOnEvent(-1, "On_Checkbox")

    GUISetState()
EndFunc ;=>GUI6_MOD

Func GUI7_VIEW();view entry
    $GUI7 = GUICreate("View", 398, 112, 590, 298)
    GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")

    $GUI7_Label1 = GUICtrlCreateLabel("Name", 8, 12, 32, 18)
    $GUI7_Label2 = GUICtrlCreateLabel("Login", 8, 44, 30, 18)
    $GUI7_Label3 = GUICtrlCreateLabel("Password", 8, 76, 50, 17)

    $GUI7_Input1 = GUICtrlCreateInput("", 80, 8, 218, 22)
    $GUI7_Input2 = GUICtrlCreateInput("", 80, 40, 218, 22)
    $GUI7_Input3 = GUICtrlCreateInput("", 80, 72, 218, 22)

    $GUI7_Bouton1 = GUICtrlCreateButton("Copy", 312, 40, 66, 26)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI7_Bouton2 = GUICtrlCreateButton("Copy", 312, 72, 66, 26)
    GUICtrlSetOnEvent(-1, "On_Button")
    $GUI7_Bouton3 = GUICtrlCreateButton("GO", 312, 6, 34, 26)
    GUICtrlSetOnEvent(-1, "On_Button")

    $GUI7_Checkbox1 = GUICtrlCreateCheckbox("", 360, 12, 16, 16)
    GUICtrlSetOnEvent(-1, "On_Checkbox")

    GUISetState()
EndFunc ;=>GUI7_VIEW

Func On_Button();gestion de tout les boutons
    Switch @GUI_CTRLID

        ;### Navigation ###
        Case $GUI1_Bouton1
            GUI4_Manager()


        Case $GUI1_Bouton2
            GUI2_change_password()
        Case $GUI1_Bouton3
            GUI3_change_login()
        Case $GUI4_Bouton1
            GUI5_Add()
        Case $GUI4_Bouton2
            GUI6_MOD()
        Case $GUI4_Bouton4

                GUI7_VIEW()


        ;#################

        Case $GUI2_Bouton1

        Case $GUI3_Bouton1


        Case $GUI9_Bouton1; <================== problem

                MsgBox(64,"Erreur de sécurité 5","Les mots de passe ================================= sont différents.",5)


        Case $GUI7_Bouton1
            ;_ClipBoard_SetData($Input2_Read,$CF_TEXT)
        Case $GUI7_Bouton2
            ;_ClipBoard_SetData($Input3_Read,$CF_TEXT)
        Case $GUI7_Bouton3
            If _IsValidURL($Input1_Read) = 1 Then
                ShellExecute($Input1_Read)
            Else
                MsgBox(64,"Erreur lien","L'URL ne semble pas valide.")
            EndIf

    EndSwitch
EndFunc ;=>On_Button

Func On_Checkbox();gestion des checkbox



EndFunc ;=>On_Checkbox

Func On_Close();gestion fermeture des fenêtres
    Switch @GUI_WINHANDLE
        Case $GUI1

            Exit
        Case $GUI2
            GUIDelete($GUI2)
        Case $GUI3
            GUIDelete($GUI3)
        Case $GUI4
            GUIDelete($GUI4)
        Case $GUI9
            GUIDelete($GUI9)
        Case $GUI6
            GUIDelete($GUI6)
        Case $GUI7
            GUIDelete($GUI7)
    EndSwitch
EndFunc ;=>On_Close


Func _IsValidURL($url)
    Local $IsValid = StringRegExp($url,"^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$")
    Return ($IsValid)
EndFunc ;=>_IsValidURL

 

 The error :

Run my script, click on "OUVRIR" then click on "View" and click on "GO" you get a message : "L'URL ne semble pas valide."

Now close the view menu, click on "Add entry" , close this menu , click on "View" and click on "GO" you get another message : "Les mots de passe ================================= sont différents."

This message must only appear when you click on "Validate" in the "Add entry" menu ....

I had the same problem on another PC with AutoIT 3.3.14.0

I've changed my variable, add another button , etc... The problem occur only with this two menus and this button.

Can you test it ? If you don't have this error perhaps my AutoIT package (installer form AutoIT fr) have a problem.

Thank you.

Share this post


Link to post
Share on other sites
Melba23

Stormgrade,

The problem occurs because you are constantly creating and deleting GUIs and their controls. When you delete a control (such as by deleting the GUI that holds it) you leave an empty entry in the internal array that AutoIt uses to track the controls it creates - the index of a control in this array is the ControlID that is returned by the GUICtrlCreate* function.

So when you create one of your subsidiary GUIs the controls within it use the first available open entries in this array - and these indicies will be returned as ControlIDs. When you delete the GUI these entries are cleared, when you create the next GUI the controls will also use those entries and so have those ControlIDs - but the variables holding the ControlIDs of the now-deleted controls will still hold the same value, even though the control itself has been deleted. Then when you run your Switch, the first variable to match will fire - and in this  case it is one which refers to a deleted control.

The solution? Create all the GUIs just once at the beginning of the script and hide/show as required - or set all the variables used to store ControlIDs back to their placeholder values (as you do at the beginning of the script) when you delete a GUI. I know which is the simpler solution.

Please ask if anything is still unclear.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Stormgrade

Thank you !!!!!!!!!!!

I set all the variables used to store ControlID in the "On_close" function like this :

Func On_Close();gestion fermeture des fenêtres
    Switch @GUI_WINHANDLE
        Case $GUI1
            Exit
        Case $GUI2
            GUIDelete($GUI2)
            $GUI2 = 9999
            $GUI2_Label1 = 9999
            $GUI2_Label2 = 9999
            $GUI2_Label3 = 9999
            $GUI2_Input1 = 9999
            $GUI2_Input2 = 9999
            $GUI2_Input3 = 9999
            $GUI2_Bouton1 = 9999
            $GUI2_Checkbox1 = 9999
        Case $GUI3
            GUIDelete($GUI3)
            $GUI3 = 9998
            $GUI3_Input1 = 9998
            $GUI3_Label1 = 9998
            $GUI3_Bouton1 = 9998
        Case $GUI4
            GUIDelete($GUI4)
            $GUI4 = 9997
            $GUI4_List1 = 9997
            $GUI4_Bouton1 = 9997
            $GUI4_Bouton2 = 9997
            $GUI4_Bouton3 = 9997
            $GUI4_Bouton4 = 9997
            $GUI4_Bouton5 = 9997
            $GUI4_Bouton6 = 9997
            $GUI4_Bouton7 = 9997

        Case $GUI9
            GUIDelete($GUI9)
            $GUI9 = 5689
            $GUI9_Input1 = 5689
            $GUI9_Input2 = 5689
            $GUI9_Input3 = 5689
            $GUI9_Input4 = 5689
            $GUI9_Label1 = 5689
            $GUI9_Label2 = 5689
            $GUI9_Label3 = 5689
             $GUI9_Label4 = 5689
            $GUI9_Bouton1 = 5689
        Case $GUI6
            GUIDelete($GUI6)
            $GUI6 = 9995
            $GUI6_Label1 = 9995
            $GUI6_Label2 = 9995
            $GUI6_Label3 = 9995
            $GUI6_Input1 = 9995
            $GUI6_Input2 = 9995
            $GUI6_Input3 = 9995
            $GUI6_Bouton1 = 9995
            $GUI6_Checkbox1 = 9995
        Case $GUI7
            GUIDelete($GUI7)
            $GUI7 = 9994
             $GUI7_Label1 = 9994
             $GUI7_Label2 = 9994
            $GUI7_Label3 = 9994
            $GUI7_Input1 = 9994
            $GUI7_Input2 = 9994
            $GUI7_Input3 = 9994
            $GUI7_Bouton1 = 9994
            $GUI7_Bouton2 = 9994
            $GUI7_Bouton3 = 9994
            $GUI7_Checkbox1 = 9994
    EndSwitch
EndFunc ;=>On_Close

 

 Do you think I just need to do that ? It make me crazy to try to find the error but it seem to work like a charm now :)

Share this post


Link to post
Share on other sites
Melba23

Stormgrade,

That should work - but I would suggest that the other method I mentioned (creating all the GUIs and then hiding/showing them as required) would be much easier.

Or you could use my GUIExtender UDF to place all the sections within the same GUI and expand/retract the correct section when needed - let me know if you would like some help getting that idea to work.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Stormgrade

Thank you for your advice, I've used the AutoIt wiki to manage multiple GUI, If I use :

GUISetState(@SW_HIDE, $GUI5)

 GUISetState(@SW_SHOW, $GUI5)

I must "rethink" all I'had done with the GUis.

I've already used your UDF for a protoype, it's very useful for hiding showing GUI inside a GUI but I don't intend to make a password manager inside one GUI.

Share this post


Link to post
Share on other sites
Melba23

Stormgrade,

That sounds like you have got the measure of the problem - glad I could help you get there.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • WoodGrain
      By WoodGrain
      Hi guys,
      I'm learning about GUI's, I'm trying the below code, the idea being if I press the letter "e" while I have the GUI open I want the label color to change to green (I'm using a UDF for label colors). But every time I press "e" on my keyboard I just get a "ding" sound from my speakers and nothing changes with the label.
      I've looked at using something like "While GUIGetMsg() <> $GUI_EVENT_CLOSE" as I've seen it in other code instead of "While 1", but I don't think it's relevant.
      #include <GUIConstantsEx.au3>; for GUI... #include <GUIRichLabel.au3>; UDF for rich text label fonts #include <Misc.au3>; for _IsPressed $myLetter = "e" $hGUI = GUICreate("test", 700, 60) $lbl2 = _GUICtrlRichLabel_Create($hGUI, '<font color="purple">' & $myLetter & '</font>', 10, 10); , 260, 25 GUISetState(@SW_SHOW) Local $hDLL = DllOpen("user32.dll") While 1 if _IsPressed(Hex($myLetter), $hDLL) Then While _IsPressed(Hex($myLetter), $hDLL) Sleep(250) WEnd _GUICtrlRichLabel_SetData($lbl2, '<font color="green">' & $myLetter & '</font>') Sleep(2000) DllClose($hDLL) Exit EndIf Sleep(50) WEnd DllClose($hDLL) I am using an array of letters that I'm wanting to do this for, but as I can't get it to work I've stripped it down to the simplest code I can think of to try and get this working first. Appreciate any help.
      Thanks!
    • nacerbaaziz
      By nacerbaaziz
      hi dears, i have an question please if you can help me.
      i maked an program to do some functions
      and this program works with the global hot keys
      i added an option to the users to change the hot keys
      when i searched about how to do that i found this UDF
      GUIHotkey.au3
      http://www.autoitscript.com/forum/index.php?showtopic=107965
      but the problem here that this UDF cant be detect the win key.
      can you help me to add it, or if there are any others UDFSS wich do that work please give me some.
      i hope that my question is clear for you.
      thanks in advance
    • Silas
      By Silas
      Hello everyone,
      I have a radio button ($Radio1), which I want to disable as soon as another one get's checked (Radio5). (The system fails if the radio button i'm troubling with also gets checked).
      I know how to disable him:
      If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio5), $GUI_DISABLE) Then GUICtrlSetState($Radio5, 128) But if i try to enable $Radio5 again, after $Radio1 isn't checked anymore, it fails:
      If GUICtrlRead($Radio1)=Not 1 And Not BitAND(GUICtrlGetState($Radio5), $GUI_ENABLE) Then GUICtrlSetState($Radio5, 64)  
      Anyone knows why?
    • Bllee
      By Bllee
      every time i press "delete button" delete a line, but i can't add new line with info. the id line write normally but i can't change or add new info
      obs: looking at the "includes" one realizes that already tried of everything that knew
      my code
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <WinAPI.au3> #include <StringConstants.au3> #include <Array.au3> #include <GuiListBox.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 612, 480, 192, 154) $MenuItem1 = GUICtrlCreateMenu("&Arquivo") $MenuItem2 = GUICtrlCreateMenuItem("Salvar Ctrl+S", $MenuItem1, $SS_CENTER) $MenuItem4 = GUICtrlCreateMenuItem("Carregar Ctrl+O", $MenuItem1, $SS_CENTER) $MenuItem3 = GUICtrlCreateMenuItem("Salvar Como Shitft+Ctrl+S", $MenuItem1, $SS_CENTER) $Group1 = GUICtrlCreateGroup("", 21, 8, 569, 97, $SS_CENTER) $Input1 = GUICtrlCreateInput("ID COR", 122, 32, 97, 21, $SS_CENTER) $Input2 = GUICtrlCreateInput("REGIÃO", 138, 64, 249, 21, $SS_CENTER) $Input3 = GUICtrlCreateInput("Label", 264, 30, 121, 21, $SS_CENTER) $Label1 = GUICtrlCreateLabel("Label", 232, 32, 30, 17, $SS_CENTER) $Button1 = GUICtrlCreateButton("Capturar Cor", 42, 30, 75, 25, $SS_CENTER) $Button2 = GUICtrlCreateButton("Capturar Região", 42, 62, 91, 25, $SS_CENTER) $Button3 = GUICtrlCreateButton("ADD", 442, 24, 113, 33) $Button5 = GUICtrlCreateButton("Delet", 442, 64, 113, 33) $Group2 = GUICtrlCreateGroup("Editar ID selecionado", 8, 384, 601, 57, $SS_CENTER) $Input7 = GUICtrlCreateInput("ID", 10, 402, 40,21, $SS_CENTER) $Input4 = GUICtrlCreateInput("COR", 51, 402, 121, 21, $SS_CENTER) $Input5 = GUICtrlCreateInput("REGIÃO", 173, 402, 249, 21, $SS_CENTER) $Input6 = GUICtrlCreateInput("LABEL", 423, 402, 121, 21, $SS_CENTER) $Button4 = GUICtrlCreateButton("\/", 544, 400, 30, 25, $SS_CENTER) $Button6 = GUICtrlCreateButton("/\", 574, 400, 30, 25, $SS_CENTER) ; Add column Global $id = Int(0) $List1 = GUICtrlCreateListView("",5, 120, 601, 253, $SS_CENTER) _GUICtrlListView_AddColumn($List1, "ID",40) _GUICtrlListView_AddColumn($List1, "COR",100) _GUICtrlListView_AddColumn($List1, "COORDENADA",305) _GUICtrlListView_AddColumn($List1, "LABEL",150) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem2 MsgBox($MB_SYSTEMMODAL, "ctrl + s", "Nothing Here",1) Case $MenuItem3 MsgBox($MB_SYSTEMMODAL, "shift+ctrl s", "Nothing Here",1) Case $MenuItem4 MsgBox($MB_SYSTEMMODAL, "ctrl + o", "Nothing Here",1) Case $Button1 MsgBox($MB_SYSTEMMODAL, "Capturar cor", "Aperte espaço para capturar a cor") GUICtrlSetData($Input1,MouseColor()) Case $Button2 MsgBox($MB_SYSTEMMODAL, "capturar região", "Aperte espaço para capturar a posição inicial") local $mouse = MouseGetPos() $x_init = $mouse[0] $y_init = $mouse[1] MsgBox($MB_SYSTEMMODAL, "capturar região", "Aperte espaço para capturar a posição final") local $mouse = MouseGetPos() $x_end = $mouse[0] $y_end = $mouse[1] GUICtrlSetData($Input2,$x_init&','&$y_init&' ; '&$x_end&','&$y_end) Case $Button3 _GUICtrlListView_AddItem($List1, $id, 1) ; id _GUICtrlListView_AddSubItem($List1, $id, GUICtrlRead($Input1), 1, 1) ;cor _GUICtrlListView_AddSubItem($List1, $id, GUICtrlRead($Input2), 2, 1) ;coordenada _GUICtrlListView_AddSubItem($List1, $id, GUICtrlRead($Input3), 3, 1) ;label $id= $id + 1 Case $Button4 $Item = _GUICtrlListView_GetSelectedIndices($List1) $Sid = _GUICtrlListView_GetItem($List1, Number($Item),0) $Scor = _GUICtrlListView_GetItem($List1, Number($Item),1) $Scord = _GUICtrlListView_GetItem($List1, Number($Item),2) $Slabel = _GUICtrlListView_GetItem($List1, Number($Item),3) ; get info GUICtrlSetData($Input7,$Sid[3]) GUICtrlSetData($Input4,$Scor[3]) GUICtrlSetData($Input5,$Scord[3]) GUICtrlSetData($Input6,$Slabel[3]) Case $Button5 _GUICtrlListView_DeleteItemsSelected($List1) Case $Button6 ; give back inf if GUICtrlRead($Input7) <> "ID" Then _GUICtrlListView_SetItem($List1, GUICtrlRead($Input4), GUICtrlRead($Input7),1) ;cor _GUICtrlListView_SetItem($List1, GUICtrlRead($Input5), GUICtrlRead($Input7),2) ;coordenada _GUICtrlListView_SetItem($List1, GUICtrlRead($Input6), GUICtrlRead($Input7),3) ;coordenada EndIf EndSwitch WEnd Func MouseColor() local $mouse = MouseGetPos() Return Hex(PixelGetColor($mouse[0],$mouse[1]), 6) EndFunc  
    • nacerbaaziz
      By nacerbaaziz

      Hi dear
      This is the first include file I designed
      This work is especially directed to NVDA free screen reader users
      It contains a set of functions that enable you to control the program
      Such as forcing the program to read a custom text
      Force it to stop talking
      Find out if the program is running
      And show custom text in the Braille screen
      Available functions are
      _nvdaControllerClient_Load()
      to load the dll file
      _nvdaControllerClient_free()
      to UnLoad the dll file
      _nvdaControllerClient_SpeakText()
      to speak a custom text
      _nvdaControllerClient_brailleMessage()
      to show custom text in the Braille screen
      _nvdaControllerClient_cancelSpeech()
      to Force the NVDA  to stop talking
      _nvdaControllerClient_testIfRunning()
      to check if the NVDA is running
      important note :
      All of these functions depend on a nvdaControllerClient32.dll
      I've added it in the attachments, as well as a file for examples, and other files
      As the source and examples in other languages
      For those who wanted to download the free screen reader, this is the download link from the official website
      https://www.nvaccess.org/download/
      i hope you like this topic
      I hope you will try it and give me your opinions
      Thank you all members and administrators for their help
      now with the  Attachments
       
      nvdaControllerClient_UDF.zip
×