Code: Alles auswählen
Procedure DesktopHandle()
Protected hProgman, hDesktopWnd, hShellViewWin, hWorkerW, hDesktopListView
hProgman = GetShellWindow_()
If hProgman
hShellViewWin = FindWindowEx_(hProgman, 0, "SHELLDLL_DefView", 0)
If hShellViewWin
hDesktopListView = FindWindowEx_(hShellViewWin, 0, "SysListView32", 0)
Else
hDesktopWnd = GetDesktopWindow_()
Repeat
hWorkerW = FindWindowEx_(hDesktopWnd, hWorkerW, "WorkerW", #Null)
hShellViewWin = FindWindowEx_(hWorkerW, 0, "SHELLDLL_DefView", 0)
Until hShellViewWin <> #Null And hWorkerW <> #Null
hDesktopListView = FindWindowEx_(hShellViewWin, 0, "SysListView32", 0)
EndIf
ProcedureReturn hDesktopListView
EndIf
EndProcedure
BlendMode.BLENDFUNCTION
BlendMode\SourceConstantAlpha = 255
BlendMode\AlphaFormat = #AC_SRC_ALPHA
OpenWindow(0, 0, 0, 150, 50, "", #PB_Window_BorderLess|#PB_Window_ScreenCentered|#PB_Window_Invisible, DesktopHandle())
SetWindowLongPtr_(WindowID(0), #GWL_EXSTYLE, GetWindowLongPtr_(WindowID(0), #GWL_EXSTYLE)|#WS_EX_LAYERED|#WS_EX_TRANSPARENT)
HideWindow(0, #False)
SetWindowPos_(WindowID(0), #HWND_BOTTOM, 0, 0, 0, 0, #SWP_NOSIZE|#SWP_NOMOVE)
AddWindowTimer(0, 0, 1000)
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_Timer
Select EventTimer()
Case 0
hWnd = WindowID(0)
GetWindowRect_(hWnd, wRect.RECT)
OffsetRect_(wRect, -wRect\left, -wRect\top)
hdc = GetWindowDC_(hWnd)
mdc = CreateCompatibleDC_(hdc)
CreateImage(0, wRect\right, wRect\bottom, 32, #PB_Image_Transparent)
StartDrawing(ImageOutput(0))
DrawingMode(#PB_2DDrawing_AlphaBlend|#PB_2DDrawing_Outlined)
Box(0, 0, OutputWidth(), OutputHeight(), RGBA(0,0,255,100))
DrawText(10, 10, FormatDate("%hh:%ii:%ss", Date()), RGBA(255,0,0,255), RGBA(0,0,0,0))
x + 1
DrawText(10, 30, "Hello World" + LSet("", x % 4, "."), RGBA(255,0,0,255), RGBA(0,0,0,0))
StopDrawing()
old = SelectObject_(mdc, ImageID(0))
UpdateLayeredWindow_(hWnd, 0, 0, @wRect+8, mdc, @ContextOffset.POINT, 0, @BlendMode, #ULW_ALPHA)
SelectObject_(mdc, old)
DeleteDC_(mdc)
ReleaseDC_(hWnd, hdc)
EndSelect
EndSelect
Until event = #PB_Event_CloseWindow Or GetAsyncKeyState_(#VK_ESCAPE) & 1