Important alert: (current site time 7/16/2013 6:03:45 AM EDT)
 

VB icon

Get the desktop as a CANVAS (So you can draw on it!)

Email
Submitted on: 7/12/2000 9:01:33 AM
By: Niel Corns  
Level: Advanced
User Rating: By 6 Users
Compatibility: Delphi 5, Delphi 4
Views: 18618
author picture
(About the author)
 
     Want to draw on the desktop like a Canvas? You can now! Simply use the proecedre below!
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
!**************************************
! Name: Get the desktop as a CANVAS (So you can draw on it!)
! Description:Want to draw on the desktop like a Canvas? You can now! Simply use the proecedre below!
! By: Niel Corns
!
!This code is copyrighted and has! limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=129&lngWId=7!for details.!**************************************

function windowsDesktopCanvas: TCanvas; 
var 
DC: HDc; 
begin 
 DC := getWindowDC ( GetDeskTopWindow ); 
 result := TCanvas.Create; 
 result.Handle := DC; 
end;


Other 16 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

8/3/2000 8:50:03 AMmissing files!!?!

u should add the code for TCanvas.cla ss*

* - hmm psc wont let me submit .CLA SS
with out the space because it says a$$
(If this comment was disrespectful, please report it.)

 
7/20/2004 12:15:12 PMAlex Schulz

Forgive me if I am wrong, but don't you have to call ReleaseDC when you are done drawing?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.