Jump to content

Sistem Tepsisi(Tray) Sorunu


unquiet
 Share

Recommended Posts

[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]
Link to comment
Share on other sites

[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]

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...