Solved

geting the formshot

Posted on 2007-03-21
10
190 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:riteheer
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 15

Expert Comment

by:riteheer
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 125 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 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