จะต้องใช้ฟังก์ชั่นอะไรบ้างครับ
2 posters
ถ้าจะใส่ icon ลงใน Tray ต้องทำอย่างไร
max30012540- PSsix Member High Class
-
จำนวนข้อความ : 98
ความนิยม : 10
เข้าร่วมเมื่อ : 10/10/2011
อายุ : 26
POS- PSsix
-
จำนวนข้อความ : 1152
ความนิยม : 326
เข้าร่วมเมื่อ : 19/07/2010
ใช้คำสั่ง 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- PSsix Member High Class
-
จำนวนข้อความ : 98
ความนิยม : 10
เข้าร่วมเมื่อ : 10/10/2011
อายุ : 26
ขออภัยครับ ที่ตั้งคำถามไม่ชัดเจอ คือ อยากจะใส่ icon ลงใน Traymanu อะครับ
POS- PSsix
-
จำนวนข้อความ : 1152
ความนิยม : 326
เข้าร่วมเมื่อ : 19/07/2010
- 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
- ModernMenuRaw.zip
- ModernMenuRaw.au3
- You don't have permission to download attachments.
- (16 Kb) Downloaded 27 times
max30012540- PSsix Member High Class
-
จำนวนข้อความ : 98
ความนิยม : 10
เข้าร่วมเมื่อ : 10/10/2011
อายุ : 26
ขอบคุณมากๆครับ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
|
|