unquiet Posted November 24, 2011 Share Posted November 24, 2011 [center]kodu çalıştırınca tüm butonlar çalışyor fakat sistem tepsisine küçültüp tekrar açınca hiçbir buton çalşımıyor Lütfen Yardım!![/center] [codebox]#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 203, 99, 192, 124) $Button1 = GUICtrlCreateButton("AÇ", 16, 24, 73, 41) $Button2 = GUICtrlCreateButton("KÜÇÜLT", 120, 24, 73, 41) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Run("notepad.exe") Case $Button2 WinSetState($Form1,"",@SW_HIDE) ;---------------------------------------------------- Opt("TrayOnEventMode", 1) ; Use event trapping for tray menu Opt("TrayMenuMode", 3) ; Default tray menu items will not be shown. $hTray_Show_Item = TrayCreateItem("Show") TrayItemSetOnEvent(-1, "To_Tray") TrayCreateItem("") TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "On_Exit") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE To_Tray() EndSwitch WEnd Func On_Exit() Exit EndFunc Func To_Tray() If TrayItemGetText($hTray_Show_Item) = "Show" Then GUISetState(@SW_SHOW, $Form1) TrayItemSetText($hTray_Show_Item, "Hide") Else GUISetState(@SW_HIDE, $Form1) GUISetState(@SW_RESTORE, $Form1) TrayItemSetText($hTray_Show_Item, "Show") EndIf EndFunc Exit EndSwitch WEnd [/codebox] Quote Link to comment Share on other sites More sharing options...
blue_life Posted November 24, 2011 Share Posted November 24, 2011 [codebox]#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayOnEventMode", 1) ; Use event trapping for tray menu Opt("TrayMenuMode", 3) ; Default tray menu items will not be shown. $hTray_Show_Item = TrayCreateItem("Hide") TrayItemSetOnEvent(-1, "To_Tray") TrayCreateItem("") TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "On_Exit") $Form1 = GUICreate("Form1", 203, 99, 192, 124) $Button1 = GUICtrlCreateButton("AÇ", 16, 24, 73, 41) $Button2 = GUICtrlCreateButton("KÜÇÜLT", 120, 24, 73, 41) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE To_Tray() Case $Button1 Run("notepad.exe") Case $Button2 To_Tray() EndSwitch WEnd Func On_Exit() Exit EndFunc ;==>On_Exit Func To_Tray() If TrayItemGetText($hTray_Show_Item) = "Show" Then GUISetState(@SW_SHOW, $Form1) GUISetState(@SW_RESTORE, $Form1) TrayItemSetText($hTray_Show_Item, "Hide") Else GUISetState(@SW_HIDE, $Form1) TrayItemSetText($hTray_Show_Item, "Show") EndIf EndFunc ;==>To_Tray[/codebox] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.