Verfasst: 03.01.2007 18:24
Kein guter Kompromiss.
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
yMin.l
yMax.l
hWnd.l = FindWindow_("shell_traywnd","")
hWndTemp.l
m.POINT
D.RECT
quit.l
SystemParametersInfo_(#SPI_GETWORKAREA,0,@D.RECT,0)
yMin = D\bottom
yMax = GetSystemMetrics_(#SM_CYSCREEN)
hWnd = FindWindow_("shell_traywnd","")
OpenWindow(0,0,0,10,10,"a", #PB_Window_Invisible)
icon$ = #PB_Compiler_Home+"Examples\Sources\Data\CdPlayer.ico"
LoadImage(0, icon$)
AddSysTrayIcon(0, WindowID(0), ImageID(0) )
ShowWindow_(hWnd,#SW_HIDE)
; D\bottom = yMax
; SystemParametersInfo_(#SPI_SETWORKAREA,0,@D.RECT,0)
MoveWindow_(hWnd, 0,yMax-5, D\right-1, yMax-yMin, #True)
Repeat
WaitWindowEvent(100)
GetCursorPos_(@m)
Debug m\y
If m\y > yMax-2
hWndTemp=GetActiveWindow_()
ShowWindow_(hWnd,#SW_SHOW)
;MoveWindow_(hWnd, 0,yMin, D\right-1, yMax-yMin, #True)
; D\bottom = yMin
; SystemParametersInfo_(#SPI_SETWORKAREA,0,@D.RECT,0)
SetActiveWindow_(hWnd)
SetForegroundWindow_(hWnd)
Delay(50)
While m\y > yMin
GetCursorPos_(@m)
SetForegroundWindow_(hWnd)
event=WaitWindowEvent(100)
If event=#PB_Event_SysTray And EventGadget()=0 And EventType()=#PB_EventType_RightClick
; D\bottom = yMin
; SystemParametersInfo_(#SPI_SETWORKAREA,0,@D.RECT,0)
ShowWindow_(hWnd,#SW_SHOW)
End
EndIf
Wend
SetActiveWindow_(hWndTemp)
ShowWindow_(hWnd,#SW_HIDE)
;MoveWindow_(hWnd, 0,yMax-5, D\right-1, yMax-yMin, #True)
EndIf
Until 0