AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi MagSetWindowFilterList function not remove specified window of screenshot
Thema durchsuchen
Ansicht
Themen-Optionen

MagSetWindowFilterList function not remove specified window of screenshot

Ein Thema von flashcoder · begonnen am 27. Jan 2018 · letzter Beitrag vom 29. Jan 2018
 
flashcoder

Registriert seit: 10. Nov 2013
83 Beiträge
 
#15

AW: MagSetWindowFilterList function not remove specified window of screenshot

  Alt 28. Jan 2018, 13:40
Zitat von Zacherl:
This function works only when Desktop Window Manager (DWM) is off.
@Zacherl,

The C++ example works fine with DWM enable .
And i followed your suggestion below, thank you:

Zitat von Zacherl:
The calling convention of the callback should be stdcall
Delphi-Quellcode:

TMagImageScalingCallback = function (hwnd: HWND; srcdata: Pointer;
    srcheader: MAGIMAGEHEADER; destdata: Pointer; destheader: MAGIMAGEHEADER;
    unclipped: TRect; clipped: TRect; dirty: HRGN): BOOL; stdcall; // definition found in Magnification.pas posted on question

function ImageScaling(hwnd: hwnd; srcdata: Pointer; srcheader: MAGIMAGEHEADER;
  destdata: Pointer; destheader: MAGIMAGEHEADER; unclipped: TRect;
  clipped: TRect; dirty: HRGN): BOOL; stdcall;
var
  lpbmih: TBitmapInfoHeader;
  lpbmi: TBitmapInfo;
  aBitmap: HBITMAP;
  aDC: HDC;
  bmp: TBitmap;
begin
  Fillchar(lpbmih, SizeOf(lpbmih), 0);
  lpbmih.biSize := SizeOf(lpbmih);
  lpbmih.biWidth := srcheader.width;
  lpbmih.biHeight := srcheader.height;

//...
end;

//...

// calling in MagSetImageScalingCallback api

if (not MagSetImageScalingCallback(hwndMag, TMagImageScalingCallback(@ImageScaling))) then
So, like already said, when i put breakpoint inside my ImageScaling function, debug not go to function, then i noted that this callback function not is executed.

Here is how be is C++ code:
Code:

typedef BOOL (CALLBACK* MagImageScalingCallback)(HWND hwnd, void * srcdata, MAGIMAGEHEADER srcheader, void * destdata, MAGIMAGEHEADER destheader, RECT unclipped, RECT clipped, HRGN dirty );

//...

BOOL MagImageScaling(HWND hwnd, void *srcdata, MAGIMAGEHEADER srcheader,
                void *destdata, MAGIMAGEHEADER destheader,
                RECT unclipped, RECT clipped, HRGN dirty)
{
   // Setup the bitmap info header
      bmif.biSize = sizeof(BITMAPINFOHEADER);
      bmif.biHeight = srcheader.height;
      bmif.biWidth = srcheader.width;

//...
}

if (!MagSetImageScalingCallback(hwndMag, (MagImageScalingCallback)MagImageScaling))
  Mit Zitat antworten Zitat
 


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 20:09 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