Sucede que al llamar a la función _tray que se encarga de crear un icono en la bandeja, los botones de la interfaz principal no me funciona ninguno.
Mi objetivo es : al hacer clic en el botón [x] o el botón [Salir] la interfaz se vaya al icono de la bandeja, y al hacer clic en el TrayIcon en el item Mostrar la interfaz nuevamente aparezca, quisiera saber como solventar esto, a continuación está el código o si alguien me brinda una ayuda en la solución.
Desde ya muy agradecido.
Código: Seleccionar todo
#NoTrayIcon
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIComboBox.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GuiConstantsEx.au3>
#include <EditConstants.au3>
#include <GuiButton.au3>
#include <StaticConstants.au3>
$interfaz = GUICreate("Tray Gui", 250, 140, -1, -1)
$btn1 = GUICtrlCreateButton("Boton 1", 18, 95, 65, 25)
$btn2 = GUICtrlCreateButton("Boton 2", 88, 95, 65, 25)
$Salir = GUICtrlCreateButton("Salir", 158, 95, 65, 25)
$cbUnidades = GUICtrlCreateCombo("Lista", 25, 15, 193, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $CBS_UPPERCASE))
GUISetState(@SW_SHOW)
_tray()
Opt("GUICloseOnESC", 0)
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			If $nMsg = $GUI_EVENT_CLOSE Then
				GUISetState(@SW_HIDE, $interfaz)
				_tray()
			EndIf
		Case $btn1
			MsgBox(64, "Mensaje", "Boton1")
		Case $btn2
			MsgBox(64, "Mensaje", "Boton2")
		Case $Salir
			GUISetState(@SW_HIDE, $interfaz)
			_tray()
	EndSwitch
WEnd
Func _tray()
	Opt("TrayMenuMode", 1) ; Los ítems de menú por defecto (del Script Pausado/Salir) no serán mostrados.
	$itemConfiguracion = TrayCreateItem("Configuración")
	$itemMostrar = TrayCreateItem("Mostrar")
	TrayCreateItem("")
	$itemAcerca = TrayCreateItem("Acerca")
	TrayCreateItem("")
	$itemSalir = TrayCreateItem("Salir")
	TraySetState()
	While 1
		$msg = TrayGetMsg()
		Select
			Case $msg = 0
				ContinueLoop
			Case $msg = $itemMostrar
				GUISetState(@SW_SHOW, $interfaz)
			Case $msg = $itemSalir
				Exit
		EndSelect
	WEnd
EndFunc   ;==>_tray


 me ha servido de mucho.
 me ha servido de mucho.