Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to draw on the Desktop Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
02-Oct-02
Category
System
Language
Delphi 2.x
Views
102
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius 

I'd like to draw on the screen, and not necessarily in the application form. 
Example: When the application is running but the form is minimized, I'd like to be 
able to draw a circle on the desktop.

Answer:

1   procedure THovedForm.Tegn1ButtonClick(Sender: TObject);
2   var
3     DesktopDC: HDC;
4     Rectangle: TRect;
5     pcTekst: PChar;
6   begin
7     DesktopDC := GetWindowDC(GetDesktopWindow);
8     MoveToEx(DesktopDC, 0, 0, nil);
9     LineTo(DesktopDC, Screen.Width, Screen.Height);
10    MoveToEx(DesktopDC, 0, Screen.Height, nil);
11    LineTo(DesktopDC, Screen.Width, 0);
12    pcTekst := 'Finn Tolderlund';
13    SetTextColor(DesktopDC, clBlue);
14    Rectangle.Left := 150;
15    Rectangle.Top := 250;
16    Rectangle.Right := 150 + 100;
17    Rectangle.Bottom := 250 + 100;
18    SetBkMode(DesktopDC, Transparent);
19    DrawTextEx(DesktopDC, pcTekst, -1, Rectangle, DT_CENTER or DT_NOCLIP, nil);
20    ReleaseDC(GetDesktopWindow, DesktopDC);
21  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC