Hi,
ich habe folgenden Code zur überprüfung ob eine Even eingetreten ist:
Spoiler anzeigen
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
GUIDelete($nMsg[1])
Case $Beenden
Exit
Case $Start
_Startmenu()
EndSwitch
Wend
Durch ausführen der Funktion _button() wird immer ein neuer Button generiert. Den Handler des neu erstellen Buttons speichere ich mit einer Beschreibung in einem mehrdimensonalen Array:
Spoiler anzeigen
Func _button($pfad, $name, $typ)
$icon = GUICtrlCreateButton("", 100, 80, 60, 60, BitOR($BS_NOTIFY, $BS_ICON, $WS_GROUP, $WS_TABSTOP, $WS_VISIBLE, $BS_FLAT))
GUICtrlSetImage(-1, @ScriptDir & "\Icons\Ico\" & $pfad, -1)
_Array2DAdd($button, $icon & "|" & $typ & "#" & $name)
EndFunc ;==>_button
Da die Buttons also dynamisch wären der Laufzeit erzeugt werden weiß ich nun nicht wie ich dise bei GUIGetMsg(1) abfangen soll so dass ich mir mit $nMsg[2] dann den Handler bzw. mit $nMsg[0] die Control-ID holen kann und so mir dann im Array die entsprechende aktion raussuchen kann. Ich bräuchte also eine defaultaktion die immer dann ausgeführt wird wenn
1. $nMsg[0] > 0 ist und
2. keine der Case im Select bereits positiv war.