menu in taskbar
menu in taskbar
is it possible to add menu items in the taskbar menu ? (the little menu, opened with a right click over the program button).
I searched the forum, but without success..
thanks.
I searched the forum, but without success..
thanks.
thanks kale. But I don't want to add options in explorer context menu.
I just talking about this menu :
<img border="1" src="http://coma.coma.free.fr/pureforum/menu.gif">
I just talking about this menu :
<img border="1" src="http://coma.coma.free.fr/pureforum/menu.gif">
Hi Coma,
You can use API for modify completely the system menu:
AppendMenu, ModifyMenu, InsertMenu
An example here:
You can use API for modify completely the system menu:
AppendMenu, ModifyMenu, InsertMenu
An example here:
Code: Select all
Global id.l
Procedure MyWindowCallback(WindowID,Message,wParam,lParam)
result=#PB_ProcessPureBasicEvents
Select Message
Case #WM_SYSCOMMAND
Select wParam
Case id
MessageRequester("About", "Cool Menu example 1", 0)
Case id+1
MessageRequester("About", "Cool Menu example 2", 0)
EndSelect
EndSelect
ProcedureReturn result
EndProcedure
Hwnd_window0=OpenWindow(0,200,200,200,200,#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget,"Menu System")
id.l=15
hwnd_systeme=GetSystemMenu_(Hwnd_window0,#False)
AppendMenu_(hwnd_systeme,#Mft_String,id,"Mon Menu 1")
AppendMenu_(hwnd_systeme,#Mft_String,id+1,"Mon Menu 2")
SetWindowCallback(@MyWindowCallback())
Repeat
Select WindowEvent()
Case #PB_Event_CloseWindow
Quit=1
;------------------------------------
; The rest of your code here
;------------------------------------
EndSelect
Until Quit = 1
End-
Killswitch
- Enthusiast

- Posts: 731
- Joined: Wed Apr 21, 2004 7:12 pm
Create a window then hide it.
Create a popup menu using the internal PB commands, for example:
Then use this in a loop to detect right clicks:
This code won't work directly, I've just mdified some code from a project I've done before, but it works pretty well!
Create a popup menu using the internal PB commands, for example:
Code: Select all
If CreatePopupMenu(#Menu_1)
OpenSubMenu("Add...")
MenuItem(#Menu_AddSong,"Song")
MenuItem(#Menu_AddFolder,"Folder")
CloseSubMenu()
OpenSubMenu("Remove...")
MenuItem(#Menu_RemoveSong,"Song")
MenuItem(#Menu_RemoveFolder,"Folder")
CloseSubMenu()
MenuBar()
OpenSubMenu("Tracks")
For t=0 To CountGadgetItems(0)-1
MenuItem(#Last_Item+t+1,Str(t+1)+". "+GetFilePart(GetGadgetItemText(0,t,0)))
Next t
CloseSubMenu()
MenuBar()
MenuItem(#Menu_Play,"Play")
MenuItem(#Menu_Pause,"Pause")
MenuItem(#Menu_Stop,"Stop")
MenuItem(#Menu_Skip,"Skip")
MenuItem(#Menu_Back,"Back")
MenuBar()
OpenSubMenu("Play Mode")
MenuItem(#Menu_Shuffle,"Shuffle")
MenuItem(#Menu_RepeatSingle,"Repeat current")
MenuItem(#Menu_RepeatAll,"Repeat all")
CloseSubMenu()
MenuBar()
OpenSubMenu("Volume")
MenuItem(#Menu_VolumeUp,"Volume Up")
MenuItem(#Menu_VolumeDown,"Volume Down")
MenuItem(#Menu_Mute,"Mute")
MenuItem(#Menu_Volume,"Volume: "+Str(Volume))
DisableMenuItem(#Menu_Volume,1)
CloseSubMenu()
MenuBar()
MenuItem(#Menu_About,"About")
MenuBar()
MenuItem(#Menu_ExitSys,"Exit")
ProcedureReturn 1
Else
ProcedureReturn 0
EndIf
Code: Select all
Select WindowEvent()
Case #PB_Event_Systray
Select EventType()
Case #PB_EventType_RightClick
DisplayPopupMenu(#Menu_1,WindowID(#Main_Window))
EndSelect
EndSelect
~I see one problem with your reasoning: the fact is thats not a chicken~

