also ich mache als eieignis event ein WindowEvent() und ein Sleep_() oder Delay() oder so...
Code: Alles auswählen
If OpenWindow(#Window_Player, 270, 233, 360, 225, #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_MaximizeGadget, "MP3-Player")
SetWindowCallback(@WCB())
;TrayIcon-Load
Image = LoadIcon_(GetModuleHandle_(0), 1)
Repeat
If EventID = #PB_Event_SizeWindow
ResizeGadget(#Playlist, 0, 0, WindowWidth(), WindowHeight() - 60)
For i=#LOAD To #QUIT
If IsGadget(i)
ResizeGadget(i, -1, WindowHeight() - 45, -1, -1)
EndIf
Next
For i=#TIME_Total To #TIME_Current
If IsGadget(i)
ResizeGadget(i, -1, WindowHeight() - 60, -1, -1)
EndIf
Next
EndIf
If IsIconic_(WindowID(#Window_Player)) = 1
HideWindow(#Window_Player, 1)
AddSysTrayIcon(#SysTrayIcon, WindowID(0), Image)
EndIf
Current = GetAudioZState(#AUDIO_ID)
;Code von wegen Abspielen und adden der Lieder usw....
EventID.l = WindowEvent()
If IsAudioZPlaying(#AUDIO_ID) = #False
Delay(10)
EndIf
If IsAudioZPlaying(#AUDIO_ID)
SetGadgetText(#TIME_Current, PositionAudioZTime(Current))
Delay(10)
EndIf
Until Quit=1
EndIf
EDIT
ist bestimt das Delay()
EDIT2
Der StartButton von Windumm verhält sich wie ein Gadget der ständig aktualisiert wird.....
EDIT3:
Der schnipsel:
Code: Alles auswählen
If OpenWindow(0, 270, 233, 360, 225, #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_MaximizeGadget, "MP3-Player")
Repeat
If IsIconic_(WindowID(0)) = 1
HideWindow(0, 1)
AddSysTrayIcon(0, WindowID(0), Image)
EndIf
If WindowEvent() = #PB_EventSysTray
Select EventType()
Case #PB_EventType_LeftDoubleClick
RemoveSysTrayIcon(0)
HideWindow(0, 0)
SetForegroundWindow_(WindowID(0))
ActivateWindow()
;GadgetResize()
Case #PB_EventType_RightClick
DisplayPopupMenu(1,WindowID())
EndSelect
EndIf
Until WindowEvent() = #PB_Event_CloseWindow
EndIf
End
macht das allerdings nicht.... seltsam....
EDIT4:
Aber sobald ich da ein Icon über de Ressource lade flackert das wie verrückt...
Code: Alles auswählen
If OpenWindow(0, 270, 233, 360, 225, #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered | #PB_Window_WindowCentered | #PB_Window_MaximizeGadget, "MP3-Player")
Image = LoadIcon_(GetModuleHandle_(0), 1)
Repeat
If IsIconic_(WindowID(0)) = 1
HideWindow(0, 1)
AddSysTrayIcon(0, WindowID(0), Image)
EndIf
If WindowEvent() = #PB_EventSysTray
Select EventType()
Case #PB_EventType_LeftDoubleClick
RemoveSysTrayIcon(0)
HideWindow(0, 0)
SetForegroundWindow_(WindowID(0))
ActivateWindow()
;GadgetResize()
Case #PB_EventType_RightClick
DisplayPopupMenu(1,WindowID())
EndSelect
EndIf
Until WindowEvent() = #PB_Event_CloseWindow
EndIf
End