Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

geting the formshot

Posted on 2007-03-21
10
191 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 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