Hallo!
Ich habe mir ein Menu mit GUICtrlCreateMenu gebastelt und lese die Einträge aus einer INI aus, damit ich neue Einträge variabel hinzufügen kann. Nun stellt sich das Problem, dass ich nicht herausbekomme, auf welches MenuItem ich klicke. Dachte da an @GUI_*. Funktioniert jedoch nicht.
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;Variablen-Deklaration
$frm_about = "0"
Opt("GUIOnEventMode", 1)
[/autoit][autoit][/autoit][autoit]#Region Main_Dialog
$Localization = GUICreate("Localization %v - RAG Bildung GmbH - %Time , Úte", 460, 410, 273, 250)
GUISetFont(10, 400, 0, "Verdana")
$FirmendatenGroup = GUICtrlCreateGroup("Firmendaten", 1, -1, 457, 145)
$FirmenDatenList = GUICtrlCreateListView("|||", 16, 24, 426, 110)
GUICtrlSendMsg(-1, 0x101E, 0, 125)
GUICtrlSendMsg(-1, 0x101E, 1, 50)
GUICtrlSendMsg(-1, 0x101E, 2, 75)
GUICtrlSendMsg(-1, 0x101E, 3, 172)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$FirmenDatenList_0 = GUICtrlCreateListViewItem("Ansprechpartner:", $FirmenDatenList)
$FirmenDatenList_1 = GUICtrlCreateListViewItem("Straße:", $FirmenDatenList)
$FirmenDatenList_2 = GUICtrlCreateListViewItem("Stadt:", $FirmenDatenList)
$FirmenDatenList_3 = GUICtrlCreateListViewItem("Postleitzahl:", $FirmenDatenList)
$FirmenDatenList_4 = GUICtrlCreateListViewItem("Telefonnummer:", $FirmenDatenList)
$FirmenDatenList_5 = GUICtrlCreateListViewItem("Mobilnummer:", $FirmenDatenList)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$ButtonClose = GUICtrlCreateButton("Close", 367, 359, 91, 25, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$ServerDatenGroup = GUICtrlCreateGroup("Server-Daten", 1, 145, 457, 209)
$StandortAuswahl = GUICtrlCreateCombo("Bildungszentrum wählen", 252, 161, 201, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$ServerDaten = GUICtrlCreateListView("|Server-Adresse", 16, 192, 426, 150)
GUICtrlSendMsg(-1, 0x101E, 0, 125)
GUICtrlSendMsg(-1, 0x101E, 1, 297)
GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
$ServerDaten_0 = GUICtrlCreateListViewItem("DNS-Server:", $ServerDaten)
$ServerDaten_1 = GUICtrlCreateListViewItem("Domäne:", $ServerDaten)
$ServerDaten_2 = GUICtrlCreateListViewItem("Proxy:", $ServerDaten)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Datei = GUICtrlCreateMenu("&Datei")
$DataReset = GUICtrlCreateMenuItem("Daten Zurücksetzen", $Datei)
$MenuItem5 = GUICtrlCreateMenuItem("", $Datei)
$SpotAdd = GUICtrlCreateMenuItem("Standort Hinzufügen", $Datei)
$SpotEdit = GUICtrlCreateMenuItem("Standort Editieren", $Datei)
$SpotDelete = GUICtrlCreateMenuItem("Standort Entfernen", $Datei)
$MenuItem4 = GUICtrlCreateMenuItem("", $Datei)
$Close = GUICtrlCreateMenuItem("Schließen", $Datei)
$MenuStandorte = GUICtrlCreateMenu("&Standorte")
$Info = GUICtrlCreateMenu("&Info")
$About = GUICtrlCreateMenuItem("About", $Info)
$ChangeLog = GUICtrlCreateMenuItem("Changelog", $Info)
$MenuItem1 = GUICtrlCreateMenuItem("", $Info)
$Update = GUICtrlCreateMenuItem("Check for Update", $Info)
GUICtrlSetState(-1, $GUI_DISABLE)
#EndRegion Main_Dialog
GUISetState(@SW_SHOW)
#Region GUICtrlSetOnEvents
;Main_Menu CTRLs
GUICtrlSetOnEvent($ButtonClose, "Close")
GUICtrlSetOnEvent($Close, "Close")
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
;Standortbuttons
GUICtrlSetOnEvent($ChangeLog, "test")
func test()
MsgBox(0,"",@GUI_CTRLID)
EndFunc
#EndRegion GUICtrlSetOnEvents
[/autoit][autoit][/autoit][autoit][/autoit][autoit]#Region Functions
[/autoit][autoit][/autoit][autoit]Init_Menu()
Func Init_Menu()
$Standort_Anzahl = IniReadSectionNames("standorte.ini")
$i = 1
While $i <= $Standort_Anzahl[0]
GUICtrlCreateMenuItem($Standort_Anzahl[$i], $MenuStandorte)
$i = $i + 1
WEnd
EndFunc ;==>Init_Menu
Func Close()
Exit
EndFunc
#EndRegion Functions
[/autoit][autoit][/autoit][autoit]While 1
Sleep(20)
WEnd
Hier die Standort.ini: