Thanks Glenn!
That indeed solved this issue :-)
Only problem is that it draws over my other windows also and when I drag a
window over the text, it draws on the other window...
Any ideas on how I can draw on the desktop only? So when a window is over a
part of the text, it draws only the visible text and the rest is hidden...
This is the code:
var
Handle: HWND;
Dc: HDC;
ACanvas: TCanvas;
begin
Handle := GetDesktopWindow;
Dc := GetWindowDC(Handle) ;
ACanvas := TCanvas.Create;
try
ACanvas.Handle := DC;
BeginPath(ACanvas.Handle) ;
ACanvas.Font.Color := clRed;
ACanvas.Font.Name := 'Tahoma';
ACanvas.Font.Size := 30;
SetBkMode(ACanvas.Handle, TRANSPARENT) ;
EndPath(ACanvas.Handle) ;
ACanvas.TextOut(0, 0, "Draw some text") ;
finally
ReleaseDC(Handle, ACanvas.Handle) ;
ACanvas.Free;
end;
end;
Greets,
Nick
----- Original Message -----
From: "Glenn B. Lawler" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, September 16, 2005 11:34 PM
Subject: RE: [delphi-en] Paint on desktop...
> Nick,
>
>> I'm trying to paint a string on the desktop, this works with the code
>> below
>> but when a window is over the text it disappears from the desktop?
>> Is there some way of making sure that it stays there and is only deleted
>> when the application is closed?
>
> I believe you would need to create a message hook that checks for
> WM_PAINT sent to the desktop, then redraw whatever you have
> each time.
>
> Glenn Lawler
>
>
>
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED]
> Yahoo! Groups Links
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/