Beispiel (WMP, Encarta Suche):

Code: Alles auswählen
Define Shell_Tray.l, ReBar.l, WinRect.RECT, WindowWidth, Event.l
#WindowWidth = 50
Shell_Tray = FindWindow_(@"Shell_TrayWnd",0)
ReBar = FindWindowEx_(Shell_Tray,0,@"ReBarWindow32",0)
If Shell_Tray And ReBar
GetWindowRect_(ReBar,@WinRect)
WindowWidth = WinRect\right - WinRect\left
If OpenWindow(0,WindowWidth - #WindowWidth,1,#WindowWidth,24,"",#PB_Window_BorderLess)
If CreateGadgetList(WindowID(0))
StringGadget(0,1,1,50,50,"")
SetParent_(WindowID(0),ReBar)
Repeat
Event = WaitWindowEvent(100)
GetWindowRect_(ReBar,@WinRect)
WindowWidth = WinRect\right - WinRect\left
ResizeWindow(0,WindowWidth - #WindowWidth,1,#PB_Ignore,#PB_Ignore)
Until Event = #PB_Event_CloseWindow
EndIf
EndIf
EndIf
Hm... mit meinem Design-Theme schien es heute früh so als würde es funktionieren. War ich wohl zu müde...Fluid Byte hat geschrieben:Gleiches Problem:
Code: Alles auswählen
Define Shell_Tray.l, ReBar.l, TrayNotify.l, WinRect.RECT, Event.l
Define ReBarWidth.l, ReBarHeight.l, TrayNotifyX.l, NewReBarWidth.l
#WindowWidth = 50
#WindowHeigth = 24
Shell_Tray = FindWindow_(@"Shell_TrayWnd",0)
ReBar = FindWindowEx_(Shell_Tray,0,@"ReBarWindow32",0)
TrayNotify = FindWindowEx_(Shell_Tray,0,@"TrayNotifyWnd",0)
If Shell_Tray And ReBar And TrayNotify
GetWindowRect_(ReBar,@WinRect)
ReBarWidth = WinRect\right - WinRect\left
ReBarHeight = WinRect\bottom - WinRect\top
GetWindowRect_(TrayNotify,@WinRect)
TrayNotifyX = WinRect\left
ReBarWidth - #WindowWidth - 5
SetWindowPos_(ReBar,0,0,0,ReBarWidth,ReBarHeight,#SWP_NOMOVE | #SWP_NOZORDER)
If OpenWindow(0,TrayNotifyX - #WindowWidth,1,#WindowWidth,#WindowHeigth,"",#PB_Window_BorderLess)
If CreateGadgetList(WindowID(0))
ButtonGadget(0,1,1,#WindowWidth,#WindowHeigth,"test")
SetParent_(WindowID(0),Shell_Tray)
Repeat
Event = WaitWindowEvent(10)
GetWindowRect_(ReBar,@WinRect)
NewReBarWidth = WinRect\right - WinRect\left
ReBarHeight = WinRect\bottom - WinRect\top
If NewReBarWidth <> ReBarWidth
GetWindowRect_(TrayNotify,@WinRect)
TrayNotifyX = WinRect\left
ReBarWidth = NewReBarWidth
ReBarWidth - #WindowWidth - 5
SetWindowPos_(ReBar,0,0,0,ReBarWidth,ReBarHeight,#SWP_NOMOVE | #SWP_NOZORDER)
ResizeWindow(0,TrayNotifyX - #WindowWidth,1,#PB_Ignore,#PB_Ignore)
EndIf
Until Event = #PB_Event_CloseWindow Or Event = #PB_Event_Gadget
SetWindowPos_(ReBar,0,0,0,ReBarWidth + #WindowWidth + 5,ReBarHeight,#SWP_NOMOVE | #SWP_NOZORDER)
EndIf
EndIf
EndIf
mhmm bei mir bleib das Fenster immer an der gleichen Stelle egal wieviele Icons ich hinzufüge.Das Fenster wird nun neu positioniert, wenn Symbolleisten oder Tray-Icons hinzugefügt oder entfernt werden oder wenn die Höhe der Taskleiste geändert wird.
Natürlich könnte man auch einen Hook an die ReBar hängen, aber so müsste es auch schon genügen
Setzt sich das Fenster aber nach dem Start vor den Infobereich?mx03 hat geschrieben:mhmm bei mir bleib das Fenster immer an der gleichen Stelle egal wieviele Icons ich hinzufüge.