northstarex hat geschrieben: 24.11.2025 20:47
.....
Jetzt muss das nur noch mit transparenten PNGs, oder halt mit Alphachannel funzen.
.....
Ja, viel Erfolg. Das ist nicht so meine Baustelle, gibts aber bestimmt was im (dt/en) Forum. Man muss nur die richtigen Suchbegriffe nehmen/finden.
northstarex hat geschrieben: 24.11.2025 20:47
.....
Warum kein guter Stil? Ist doch legitimem was auf den Desktop zu schreiben. Icons und anderes wird ja auch immer neu gesetzt, bzw. geschrieben.
.....
Naja, wie der Name (Windows) schon sagt, erwartet man (der Anwender) alle Informationen in diesen Fenstern. Einfach so auf den Desktop malen, ohne Rücksicht auf die Fenster kann man (aber) machen. (siehe Sinnloses Beispiel, unten).
Darüber hinaus besteht der Desktop auch (nur) aus Fenstern. Beispielsweise werden die Icons in einem Listview Control gezeichnet.
Ich hatte da mal was gepostet, um hinter die Icons zu malen....
Draw to Desktop behind the Icons
Sinnloses Beispiel: Zum Schreiben auf dem Bildschirm
Program ausführen und mit der Maus klicken, oder Linke Maustaste gedrückt halten und Maus schieben.
Code: Alles auswählen
Global mx, my, dtx, dty, hwnd
Procedure WriteTextToDesktop(hwnd, Text$)
Protected hdc, rc.RECT
hdc = GetDCEx_(hwnd, 0, $403) ; #DCX_WINDOW | #DCX_CACHE | #DCX_LOCKWINDOWUPDATE
If hdc
SetBkColor_(hdc, GetPixel_(hdc, mx, my)) ; use the background color from the pixel behind the mouse cursor.
TextOut_(hDC, dtx, dty, Text$, Len(Text$))
ReleaseDC_(hwnd, hdc)
EndIf
EndProcedure
hwnd = GetDesktopWindow_() : Debug "Desktop = " + hwnd
If OpenWindow(0, 0, 0, 320, 80, "Position of the mouse on the desktop", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StickyWindow(0, 1)
TextGadget(0, 10, 4, 300, 20, "")
TextGadget(1, 10, 24, 300, 20, "Write Text direct on the Desktop at Mouse Position!")
AddWindowTimer(0, 0, 25)
Repeat
Event = WaitWindowEvent()
If GetAsyncKeyState_(#VK_LBUTTON) & $8000
dtx = mx : dty = my
EndIf
If Event = #PB_Event_Timer ; Each 10 ms => Let's display the coordinates
mx = DesktopMouseX()
my = DesktopMouseY()
text$ = "Coordinates: " + Str(mx) + "," + Str(my)
SetGadgetText(0, text$)
WriteTextToDesktop(hwnd, text$) ; only on mouse clicks
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
northstarex hat geschrieben: 24.11.2025 20:47
.....
Eigene Codierungsrichtlinien?

.....
Nur weil du fragst, hier ein paar Beispiele(Auszug). (Ich sage nicht dass man das so machen muss..... -- Ich mache es halt so.)
Code: Alles auswählen
;/===
;| File Header ....
;| All texts, names, etc. in code files are written in english.
;\===
EnableExplicit ; use declared variables only
; Use constants instead of direct numbers or text.
#ProgramName$ = "Test"
#ProgramVersion$ = "0.0"
#ProgramCaption$ = "Test Tool "
Enumeration EWindow 1 ; <= Main Enum (leave the 0 for error checks)
#WND_Main
; tbc.
EndEnumeration
Enumeration EGadget 1
#GDT_txtInfo
#GDT_strFilename
#GDT_btnStart
#GDT_btnCancel
; tbc.
EndEnumeration
Enumeration ETimer 1
#TMR_DelayedInit
EndEnumeration
; ....
Enumeration EWindow ; continued
#WND_Trace
EndEnumeration
Enumeration EGadget ; continued
#GDT_Trace_btnClear
#GDT_Trace_btnCopyToClip
#GDT_Trace_lstOutput
EndEnumeration