Einzelnen Beitrag anzeigen

HolgerX

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

AW: Taking screenshot behind the form using magnification

  Alt 11. Feb 2018, 10: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