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 write write on the desktop TDesktopCanvas 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
TDesktopCanvas - write on the desktop 13-Sep-02
Category
System
Language
Delphi 2.x
Views
73
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: William Gerbert 

Answer:

This canvas allows you to access the desktop:


1   type
2     TDesktopCanvas = class(TCanvas)
3     private
4       DC: hDC;
5       function GetWidth: Integer;
6       function GetHeight: Integer;
7     public
8       constructor Create;
9       destructor Destroy; override;
10    published
11      property Width: Integer read GetWidth;
12      property Height: Integer read GetHeight;
13    end;
14  
15    { TDesktopCanvas object }
16  
17  function TDesktopCanvas.GetWidth: Integer;
18  begin
19    Result := GetDeviceCaps(Handle, HORZRES);
20  end;
21  
22  function TDesktopCanvas.GetHeight: Integer;
23  begin
24    Result := GetDeviceCaps(Handle, VERTRES);
25  end;
26  
27  constructor TDesktopCanvas.Create;
28  begin
29    inherited Create;
30    DC := GetDC(0);
31    Handle := DC;
32  end;
33  
34  destructor TDesktopCanvas.Destroy;
35  begin
36    Handle := 0;
37    ReleaseDC(0, DC);
38    inherited Destroy;
39  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