Jump to content

Problem to get the control's names


tresa
 Share

Recommended Posts

Hi,

:">

I tried this code to test the GUI.

But in the loop I get the msgbox with the last control I have created, e.g. "Users" as soon as I move the mouse.

What is the problem ?

Thank's in advance

#region --- GuiBuilder code Start ---

; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

$fichier=""

GuiCreate("Gestion des mots-clés", 800, 711,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

if $CmdLine[0]=1 Then

$fichier=$CmdLine[1]

$split = StringSplit($fichier, "\", 1)

$fichier=$split[$split[0]]

EndIf

$Input_1 = GuiCtrlCreateInput($fichier, 90, 350, 130, 30,$ES_READONLY)

$Treeview_1 = GuiCtrlCreateTreeview(30, 10, 300, 260)

$List_3 = GuiCtrlCreateList("List3", 380, 190, 150, 227)

$maintreeview = GUICtrlCreateTreeViewItem ("Main",$Treeview_1)

$groups = GUICtrlCreateTreeViewItem ("Groups",$maintreeview)

$users = GUICtrlCreateTreeViewItem ("Users",$maintreeview)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg=0

;

Case Else

MsgBox(0, "GUI Event", GUICtrlRead ( $msg , 1 ))

EndSelect

WEnd

Exit

#endregion --- GuiBuilder generated code End ---

Link to comment
Share on other sites

Hi,

if nothing happens it runs into the else. Just delete the else.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

if nothing happens it runs into the else. Just delete the else.

So long,

Mega

Hi, Mega

I thought the test $msg=0 was enough to avoid the idle event.

But with my else I receive also all the system events mouse ...

Here is the solution. I receive only the control events with $msg>0

Thank you for having given me the track towards solution

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>
$fichier=""
GuiCreate("Gestion des mots-clés", 800, 711,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
if $CmdLine[0]=1 Then   
    $fichier=$CmdLine[1]
    $split = StringSplit($fichier, "\", 1)
    $fichier=$split[$split[0]]
EndIf

$Treeview_1 = GuiCtrlCreateTreeview(30, 10, 300, 260)
$List_3 = GuiCtrlCreateList("List3", 380, 190, 150, 227)
$maintreeview = GUICtrlCreateTreeViewItem ("Main",$Treeview_1)
$groups = GUICtrlCreateTreeViewItem ("Groups",$maintreeview)
$users = GUICtrlCreateTreeViewItem ("Users",$maintreeview)
$Input_1 = GuiCtrlCreateInput($fichier, 90, 350, 130, 30,$ES_READONLY)
;$tests = GUICtrlCreateTreeViewItem ($CmdLine[1],$groups)
GuiSetState()
;MsgBox(0,"",$Treeview_1)
While 1
    $msg = GuiGetMsg()
    
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    case $msg>0
        MsgBox(0, "GUI Event", GUICtrlRead ( $msg , 1 ))
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---
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...