ฟอรั่ม PSsix

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ฟอรั่มของบล็อก http://pssix.blogspot.com


2 posters

    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร

    max30012540
    max30012540
    PSsix Member High Class
    PSsix Member High Class


    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty PSsix Program Coder
    จำนวนข้อความ : 98
    ความนิยม : 10
    เข้าร่วมเมื่อ : 10/10/2011
    อายุ : 26

    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร

    ตั้งหัวข้อ by max30012540 03/04/12, 07:52 pm

    จะต้องใช้ฟังก์ชั่นอะไรบ้างครับ em219
    POS
    POS
    PSsix
    PSsix


    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty
    จำนวนข้อความ : 1152
    ความนิยม : 326
    เข้าร่วมเมื่อ : 19/07/2010

    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty Re: ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร

    ตั้งหัวข้อ by POS 04/04/12, 06:22 am

    ใช้คำสั่ง TraySetIcon


    Code:

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

    $Form1 = GUICreate("PSsix", 240, 97, 192, 124)
    $Button1 = GUICtrlCreateButton("Button1", 40, 24, 75, 45, $BS_ICON)
    GUICtrlSetImage(-1, @SystemDir & "\shell32.dll", 4)
    $Button2 = GUICtrlCreateButton("Button2", 144, 24, 75, 45, $BS_ICON)
    GUICtrlSetImage(-1, @SystemDir & "\shell32.dll", 6)
    GUISetState(@SW_SHOW)


    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
          Case $GUI_EVENT_CLOSE
             Exit

          Case $Button1
       TraySetIcon(@SystemDir & "\shell32.dll", 4)
    Case $Button2
          TraySetIcon(@SystemDir & "\shell32.dll",6)
       EndSwitch
    WEnd
    max30012540
    max30012540
    PSsix Member High Class
    PSsix Member High Class


    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty PSsix Program Coder
    จำนวนข้อความ : 98
    ความนิยม : 10
    เข้าร่วมเมื่อ : 10/10/2011
    อายุ : 26

    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty Re: ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร

    ตั้งหัวข้อ by max30012540 04/04/12, 11:47 am

    ขออภัยครับ ที่ตั้งคำถามไม่ชัดเจอ คือ อยากจะใส่ icon ลงใน Traymanu อะครับ
    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Ok-0f194
    POS
    POS
    PSsix
    PSsix


    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty
    จำนวนข้อความ : 1152
    ความนิยม : 326
    เข้าร่วมเมื่อ : 19/07/2010

    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty Re: ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร

    ตั้งหัวข้อ by POS 05/04/12, 06:06 am

    Code:

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
     #include <ModernMenuRaw.au3>
    #NoTrayIcon

    Opt("GUIOnEventMode", 1)
    Opt("TrayOnEventMode", 1)
    Opt("TrayMenuMode", 1)


    #Region Tray
    $tray = _TrayIconCreate("PSsix")
    _TrayCreateContextMenu($tray)
    _TrayCreateItem("ทดสอบเมนู1")
    _TrayItemSetIcon(-1, "shell32.dll", -4)
    GUICtrlSetOnEvent(-1, "Button1Click")
    _TrayCreateItem("ทดสอบเมนู2")
    _TrayItemSetIcon(-1, "shell32.dll", -6)
    GUICtrlSetOnEvent(-1, "Button1Click")
    _TrayCreateItem("")
    _TrayCreateItem("ทดสอบเมนู3")
    _TrayItemSetIcon(-1, "shell32.dll", -12)
    GUICtrlSetOnEvent(-1, "Button1Click")
    _TrayCreateItem("")
    _TrayCreateItem("ทดสอบเมนู4")
    _TrayItemSetIcon(-1, "shell32.dll", -24)
    GUICtrlSetOnEvent(-1, "Button1Click")

    _TrayIconSetState($tray, @SW_SHOW)

    #EndRegion Tray


    $Form1 = GUICreate("PSsix", 238, 146, 192, 124)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
    GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
    GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
    $Button1 = GUICtrlCreateButton("exit", 144, 16, 75, 25)
    GUICtrlSetOnEvent(-1, "Button1Click")
    GUISetState(@SW_SHOW)


    While 1
       Sleep(100)
    WEnd

    Func Button1Click()
    MsgBox(0,"ออกโปรแกรม","...")
    exit
    EndFunc
    Func Form1Close()
    Exit
    EndFunc
    Func Form1Maximize()

    EndFunc
    Func Form1Minimize()

    EndFunc
    Func Form1Restore()

    EndFunc



    Attachments
    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร AttachmentModernMenuRaw.zip
    ModernMenuRaw.au3
    You don't have permission to download attachments.
    (16 Kb) Downloaded 27 times
    max30012540
    max30012540
    PSsix Member High Class
    PSsix Member High Class


    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty PSsix Program Coder
    จำนวนข้อความ : 98
    ความนิยม : 10
    เข้าร่วมเมื่อ : 10/10/2011
    อายุ : 26

    ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร Empty Re: ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร

    ตั้งหัวข้อ by max30012540 05/04/12, 11:38 am

    POS พิมพ์ว่า:
    Code:

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
     #include <ModernMenuRaw.au3>
    #NoTrayIcon

    Opt("GUIOnEventMode", 1)
    Opt("TrayOnEventMode", 1)
    Opt("TrayMenuMode", 1)


    #Region Tray
    $tray = _TrayIconCreate("PSsix")
    _TrayCreateContextMenu($tray)
    _TrayCreateItem("ทดสอบเมนู1")
    _TrayItemSetIcon(-1, "shell32.dll", -4)
    GUICtrlSetOnEvent(-1, "Button1Click")
    _TrayCreateItem("ทดสอบเมนู2")
    _TrayItemSetIcon(-1, "shell32.dll", -6)
    GUICtrlSetOnEvent(-1, "Button1Click")
    _TrayCreateItem("")
    _TrayCreateItem("ทดสอบเมนู3")
    _TrayItemSetIcon(-1, "shell32.dll", -12)
    GUICtrlSetOnEvent(-1, "Button1Click")
    _TrayCreateItem("")
    _TrayCreateItem("ทดสอบเมนู4")
    _TrayItemSetIcon(-1, "shell32.dll", -24)
    GUICtrlSetOnEvent(-1, "Button1Click")

    _TrayIconSetState($tray, @SW_SHOW)

    #EndRegion Tray


    $Form1 = GUICreate("PSsix", 238, 146, 192, 124)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
    GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
    GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
    $Button1 = GUICtrlCreateButton("exit", 144, 16, 75, 25)
    GUICtrlSetOnEvent(-1, "Button1Click")
    GUISetState(@SW_SHOW)


    While 1
       Sleep(100)
    WEnd

    Func Button1Click()
    MsgBox(0,"ออกโปรแกรม","...")
    exit
    EndFunc
    Func Form1Close()
    Exit
    EndFunc
    Func Form1Maximize()

    EndFunc
    Func Form1Minimize()

    EndFunc
    Func Form1Restore()

    EndFunc



    ขอบคุณมากๆครับ

      เวลาขณะนี้ 26/04/24, 07:07 pm