AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Taking screenshot behind the form using magnification
Thema durchsuchen
Ansicht
Themen-Optionen

Taking screenshot behind the form using magnification

Ein Thema von victorlus · begonnen am 9. Feb 2018 · letzter Beitrag vom 11. Feb 2018
Antwort Antwort
Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#1

AW: Taking screenshot behind the form using magnification

  Alt 10. Feb 2018, 14:51
My goal is to be able to capture what's behind the form, which works on win7, win8, win10, if it's very difficult I can pay to do it for myself.
Yeah I understood that, but WHY do you want to do that?
Projekte:
- GitHub (Profil, zyantific)
- zYan Disassembler Engine ( Zydis Online, Zydis GitHub)
  Mit Zitat antworten Zitat
victorlus

Registriert seit: 6. Feb 2018
16 Beiträge
 
#2

AW: Taking screenshot behind the form using magnification

  Alt 10. Feb 2018, 15:49
My goal is to be able to capture what's behind the form, which works on win7, win8, win10, if it's very difficult I can pay to do it for myself.
Yeah I understood that, but WHY do you want to do that?
I need to do this, to monitor what's behind the form
My program will work this way, visible to the client all time, I can see what is behind the form
  Mit Zitat antworten Zitat
Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#3

AW: Taking screenshot behind the form using magnification

  Alt 10. Feb 2018, 15:53
My goal is to be able to capture what's behind the form, which works on win7, win8, win10, if it's very difficult I can pay to do it for myself.
Yeah I understood that, but WHY do you want to do that?
I need to do this, to monitor what's behind the form
My program will work this way, visible to the client all time, I can see what is behind the form
Mhh sorry, I guess I cant help you with that. Not sure whats the purpose of such a program. You could use MSDN-Library durchsuchenPrintWindow for specific windows (you might even be able to compose your own "desktop" by iterating through all visible windows). This should work for background windows, but might not work for minimized ones.
Projekte:
- GitHub (Profil, zyantific)
- zYan Disassembler Engine ( Zydis Online, Zydis GitHub)
  Mit Zitat antworten Zitat
EWeiss
(Gast)

n/a Beiträge
 
#4

AW: Taking screenshot behind the form using magnification

  Alt 10. Feb 2018, 20:29
Zitat:
This should work for background windows, but might not work for minimized ones.
NO that not work.
Zitat:
The PrintWindow function copies a visual window into the specified device context (DC), typically a printer DC.
The Desktop is not a real Window.
And PrintWindow works only for the own Window (or within active Desktop), you can not capture the Background from Desktop that Fails.

and i have tell forget it without minimize, or hide your Form.

nobody can help for that.
but here is what you can see behind the form.

greets

Geändert von EWeiss (11. Jul 2019 um 15:49 Uhr)
  Mit Zitat antworten Zitat
HolgerX

Registriert seit: 10. Apr 2006
Ort: Leverkusen
984 Beiträge
 
Delphi 6 Professional
 
#5

AW: Taking screenshot behind the form using magnification

  Alt 11. Feb 2018, 06:17
Hm..

1.) It is possible to make a ScreenShot without the foreground Application!

2.) The DESKTOP is a Window! It is the Mainwindow of an 'Explorer' instanz, in older Windowsversions 'Progman'!

I made a small demo, where i use PrintWindow!
(Test_ScreenShot_BackGround.zip)
It is made with Delphi 6 and goes to all Apps in Z-Order, starting with the last (Desktop!).

I have tested it in Windows8.1 (Classic Shell).
Angehängte Dateien
Dateityp: zip Test_ScreenShot_BackGround.zip (218,6 KB, 25x aufgerufen)
  Mit Zitat antworten Zitat
EWeiss
(Gast)

n/a Beiträge
 
#6

AW: Taking screenshot behind the form using magnification

  Alt 11. Feb 2018, 08:01
Hm..

1.) It is possible to make a ScreenShot without the foreground Application!

2.) The DESKTOP is a Window! It is the Mainwindow of an 'Explorer' instanz, in older Windowsversions 'Progman'!

I made a small demo, where i use PrintWindow!
(Test_ScreenShot_BackGround.zip)
It is made with Delphi 6 and goes to all Apps in Z-Order, starting with the last (Desktop!).

I have tested it in Windows8.1 (Classic Shell).
Zitat:
It is possible to make a ScreenShot
and your think that is a sreenshot? sorry for me that is nothing
and Fails on W7 Forget it (40% Cpu? )
you should handle WM_PRINT and WM_PRINTCLIENT. (i think you do nothing of both)

Zitat:
The DESKTOP is a Window!
not for me.. then the Handle never changed.
which is only a Container where the real Window are Painting.
what is a Window

greets

Geändert von EWeiss (11. Jul 2019 um 15:49 Uhr)
  Mit Zitat antworten Zitat
HolgerX

Registriert seit: 10. Apr 2006
Ort: Leverkusen
984 Beiträge
 
Delphi 6 Professional
 
#7

AW: Taking screenshot behind the form using magnification

  Alt 11. Feb 2018, 09:45
Hmm..

@EWeiss

1.)

..
you should handle WM_PRINT and WM_PRINTCLIENT. (i think you do nothing of both)

Sorry, you have to read the API-Description by Microsoft correct:

Zitat:
The application that owns the window referenced by hWnd processes the PrintWindow call and renders the image in the device context that is referenced by hdcBlt. The application receives a WM_PRINT message or, if the PW_PRINTCLIENT flag is specified, a WM_PRINTCLIENT message. For more information, see WM_PRINT and WM_PRINTCLIENT.
https://msdn.microsoft.com/de-de/lib...(v=vs.85).aspx


The app with the HWND will receive a WM_PRINT, NOT the caller of PrintWindow!


2.)
Your Screenshoot of your Videoplayer didn't work, of course it use DirectX for the Videoplaying, which is NOT handle by Windows GDI and also NOT could redraw by Microsoft GDI! ('Overlayed Window').



3.)
H := GetWindow(self.Handle, GW_HWNDLAST); // Desktop Give you the LAST Window in the Z-Order, and this IS the Desktopwindow.

Use this Handle only with 'function ScreenshotHidden(wnd: HWND; const bmp: TBitmap): Boolean;' and you will see...

In old Windows the desktop is handled by Progman.exe
(https://en.wikipedia.org/wiki/Program_Manager)

In newer ones it is replaced by explorer.exe
Look in 'Shell' in
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon (per machine)
or
HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon (per user)
and you will see explorer.exe!

In replacing this you could use your own Desktoptool, like kiosksystems do!!!



4.)
A (i think) real Screenshot could only be made with ALL windows including the top one, of course it make a copy of the Screen DC, where all Windows draw itself in the Z-Order!

The only possibility to make somthing neer a Screenshot is to do the same what MS Windows do in refreshing the Screen: Go throu all Windows and let them 'PrintWindow' himself to the Screen DC!

This is used by my 'Testtool'!

Mircosoft do in this way a lot of things with every Windowprint, like round the corners....
That is, why it could look differnt to the screen!
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:10 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz