Delphi-PRAXiS
Seite 3 von 4     123 4      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi MagSetWindowFilterList function not remove specified window of screenshot (https://www.delphipraxis.net/195027-magsetwindowfilterlist-function-not-remove-specified-window-screenshot.html)

flashcoder 28. Jan 2018 20:47

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
I want know why my callback function not is executed :wall: :(

EWeiss 28. Jan 2018 20:57

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Zitat:

Zitat von flashcoder (Beitrag 1392319)
I want know why my callback function not is executed :wall: :(

Win10 Trouble... i think.

greets

flashcoder 28. Jan 2018 21:03

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Zitat:

Zitat von EWeiss
Win10 Trouble... i think.

No, here my enviroment is Windows 7 Ultimate x64.

EWeiss 28. Jan 2018 21:09

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Zitat:

Zitat von flashcoder (Beitrag 1392321)
Zitat:

Zitat von EWeiss
Win10 Trouble... i think.

No, here my enviroment is Windows 7 Ultimate x64.

That is hard
But as I said my code I uploaded here works.
sorry..

greets

flashcoder 28. Jan 2018 21:29

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Zitat:

Zitat von EWeiss
That is hard
But as I said my code I uploaded here works.

The callback function ImageScaling is executed in your test?

Edition:

The callback is working to me now, i discovered that my callback function is executed always that Magnifier window is resized:

Delphi-Quellcode:
function MagImageScalingCallback(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;
  lpbmih.biPlanes := 1;
  lpbmih.biBitCount := Floor(lpbmih.biSizeImage / lpbmih.biHeight /
    lpbmih.biWidth * 8);
  lpbmih.biCompression := BI_RGB;

  Fillchar(lpbmi, SizeOf(lpbmi), 0);
  lpbmi.bmiHeader.biSize := SizeOf(lpbmi.bmiHeader);
  lpbmi.bmiHeader.biWidth := srcheader.width;
  lpbmi.bmiHeader.biHeight := srcheader.height;
  lpbmi.bmiHeader.biPlanes := 1;
  lpbmi.bmiHeader.biBitCount :=
    Floor(lpbmi.bmiHeader.biSizeImage / lpbmi.bmiHeader.biHeight /
    lpbmi.bmiHeader.biWidth * 8);
  lpbmi.bmiHeader.biCompression := BI_RGB;

  aDC := GetWindowDC(hwnd);
  bmp := TBitmap.Create;
  aBitmap := 0;
  try
    aBitmap := CreateDIBitmap(aDC, lpbmih, 0, nil, lpbmi, DIB_RGB_COLORS);
    bmp.handle := aBitmap;
    bmp.SaveToFile('c:\tela.bmp');
  finally
    DeleteObject(aBitmap);
    DeleteDC(aDC);
    bmp.Free;
  end;
  Result := True;
end;

//...

if (not MagSetImageScalingCallback(hwndMag, MagImageScalingCallback)) then
My trouble now is that i'm getting a black image. Some idea how fix?

EWeiss 28. Jan 2018 23:28

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Zitat:

The callback function ImageScaling is executed in your test?
as said..
Zitat:

But as I said my code I uploaded here works.
greets

Zacherl 28. Jan 2018 23:34

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Zitat:

Zitat von EWeiss (Beitrag 1392320)
Zitat:

Zitat von flashcoder (Beitrag 1392319)
I want know why my callback function not is executed :wall: :(

Win10 Trouble... i think.

The (corrected) C++ example works on my Windows 10, but the Delphi code crashes somewhere inside
Delphi-Quellcode:
MagSetWindowSource
(breakpoint inside callback does not trigger) - again, only if I set the callback.

flashcoder 29. Jan 2018 00:14

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Liste der Anhänge anzeigen (Anzahl: 1)
Zitat:

Zitat von Zacherl
The (corrected) C++ example works on my Windows 10, but the Delphi code crashes somewhere inside
Delphi-Quellcode:
MagSetWindowSource

@Zacherl,

Delphi-Quellcode:
MagSetWindowSource
not is necessary, i tested here (Delphi code) without this api and screenshot still is works.

About callback also is working fine here, my callback function is executed when Magnifier window (Form1) is maximized, now i need of some help to fix this trouble of black capture :)

Edition:

Delphi-Quellcode:
MagSetWindowSource
and
Delphi-Quellcode:
MagSetImageScalingCallback
works fine since that (Form1) is maximized. My trouble now really is with the black capture in callback function.

EWeiss 29. Jan 2018 01:05

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Zitat:

Zitat von flashcoder (Beitrag 1392328)
Zitat:

Zitat von Zacherl
The (corrected) C++ example works on my Windows 10, but the Delphi code crashes somewhere inside
Delphi-Quellcode:
MagSetWindowSource

@Zacherl,

Delphi-Quellcode:
MagSetWindowSource
not is necessary, i tested here (Delphi code) without this api and screenshot still is works.

About callback also is working fine here, my callback function is executed when Magnifier window (Form1) is maximized, now i need of some help to fix this trouble of black capture :)

Edition:

Delphi-Quellcode:
MagSetWindowSource
and
Delphi-Quellcode:
MagSetImageScalingCallback
works fine since that (Form1) is maximized. My trouble now really is with the black capture in callback function.

Hi,
sorry your should learn C++ before translate any..
as i see, what your do here? as example

Delphi-Quellcode:
ImageScaling(hwnd: hwnd;

that looks very bad for me.

you can use in C++
Code:
hwnd Hwnd
but not in Delphi to..

should be
Delphi-Quellcode:
ImageScaling(Handle: HWND;

then your set your Window not on TopMost that is bad also... and so on.
read the API then create a application from beginning, just my 2 Cent.

greets

flashcoder 29. Jan 2018 01:12

AW: MagSetWindowFilterList function not remove specified window of screenshot
 
Delphi is case insensitive and is able to know waht is a variable name and a type.


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:22 Uhr.
Seite 3 von 4     123 4      

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