?
Solved

geting the formshot

Posted on 2007-03-21
10
Medium Priority
?
196 Views
Last Modified: 2013-11-22
Hello,

Is it possible to take a window (form) screenshot in windows xp by reading it's canvas property and will that work if the window is mimimized or covered by another window? I know that you can draw on a form's canvas, read the content and store it as a bitmap and also by reading the canvas of the entire desktop you can get a screenshot, but can you get a formshot?

Thank you, Hrvoje
0
Comment
Question by:hdagelic
  • 5
  • 3
  • 2
10 Comments
 
LVL 15

Expert Comment

by:Jeff Perkins
ID: 18763438
Nope,
If the windows is minimized, you won't get the formshot/screenshot from properties.
Sorry
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18763544
you can use BitBlt() function if you have handle of source canvas,
but when form is not shown or minimized you will not be able to take its snapshot
canvas contents are not stored all the time form is painted when becomes visible thru Paint method
(defined in TCustomControl) when control recives WM_PAINT message

ziolko.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18763556
sorry riteheer i didn't refresh my webbrowser

ziolko.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 15

Expert Comment

by:Jeff Perkins
ID: 18763613
ziolko,
Is np, happens all the time, and just reaffirms the asker is getting good advice and plenty of attetion... <smile>
Good day,
Jappo
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18763651
heh:) i just hope he's here for advice not attention :)

ziolko.
0
 

Author Comment

by:hdagelic
ID: 18763655
Ok, thanks,  that could be solved by intercepting WM_MINIMIZE or something like that and taking the formshot just before. But do you know if it would work if the window is under another window? I know that when you drag another window over a form it clears that area of a form, but it gets repainted... I also find it strange that googleing for formshots returns nothing special.
0
 
LVL 21

Accepted Solution

by:
ziolko earned 375 total points
ID: 18763707
i did this:
BitBlt(Self.Canvas.Handle, 0, 0, Form2.ClientWidth, Form2.ClientHeight, Form2.Canvas.Handle, 0, 0, SRCCOPY);

with form2 partly covered and result was same as on screen so also covered.

window repaints only that region which is visible, so i'm afraid answer is no again

ziolko.
0
 

Author Comment

by:hdagelic
ID: 18763748
You also couldn't get the shots with MDI child forms when reading the parent's canvas. True?
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18763813
i didn't  try it with MDI but basically you can make snapshot of what you can see on monitor.

ziolko.
0
 

Author Comment

by:hdagelic
ID: 18765182
Shure, that's all I need, thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question