Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Version des Printer Dialoges (https://www.delphipraxis.net/210541-version-des-printer-dialoges.html)

haentschman 9. Mai 2022 11:47


Version des Printer Dialoges
 
Liste der Anhänge anzeigen (Anzahl: 3)
Hallöle...8-)

Ich habe eine Funktion die mir den HDC des Printers liefert...soweit so gut. :wink:
Delphi-Quellcode:
function TBla.GetPrinterDC: HDC;
var
  PrintDialog: TPrintDlg;
begin
  FillChar(PrintDialog, SizeOf(PrintDialog), 0);
  PrintDialog.lStructSize := SizeOf(PrintDialog);
  PrintDialog.Flags := PD_RETURNDC or PD_HIDEPRINTTOFILE or PD_DISABLEPRINTTOFILE or PD_NOSELECTION;
  if PrintDlg(PrintDialog) then
    Result := PrintDialog.HDC
  else
    Result := 0;
end;
PS: DynaPDF braucht den HDC für den Druck.

Den Dialog (TPrintDlg) finde ich W95 mäßig. :? ...sprich alt.
TPrintDialog ist auch 'alt'. :? Imho ein Wrapper für TPrintDlg aus der API.

Ich hätte gern etwas "modernes" wie Bild "neu" (MSSQL Studio, Notepad++). Wo finde ich den? Wie komme ich an den HDC?
Oder der Dialog ist VCL mäßig coloriert... Bild FastReport :wink:

Danke für Infos... :wink:

KodeZwerg 9. Mai 2022 12:08

AW: Version des Printer Dialoges
 
Hi, Du könntest Dir über EnumPrinters selbst einen Dialog basteln und per
Delphi-Quellcode:
DeinHDC := CreateDC('Beispiel', printerName, 0, 0);
anbinden.

Vielleicht kommst du über PrintDlg, PrintDlgEx oder PageSetupDlg auch ans Ziel.

haentschman 9. Mai 2022 12:22

AW: Version des Printer Dialoges
 
Danke...:wink:

Irgendwie habe ich das Gefühl, daß jeder seinen Druckdialog baut... :? :zwinker:
Ich gehe aktuell eher in die Richtung "Corporate Design" like FastReport.

TiGü 9. Mai 2022 13:00

AW: Version des Printer Dialoges
 
Liste der Anhänge anzeigen (Anzahl: 1)
Also "Notepad++ 8.3.3" in der 32-Bit Version ruft auch nur laut "Rohitab API Monitor v2" das was du machst, also PrintDlgW.
Ggf. ist das abhängig von den drölftausend Werten, die man im struct LPPRINTDLG ausfüllen kann.

Anhang 55081

Notepad++ übergibt das hier:
Code:
#   Type      Name      Pre-Call Value   
1   LPPRINTDLG   lppd      0x009d0924   
   PRINTDLG      { lStructSize = 66, hwndOwner = 0x000915fc, hDevMode = NULL ...}   
   DWORD      lStructSize   66   
   HWND      hwndOwner   0x000915fc   
   HGLOBAL      hDevMode   NULL   
   HGLOBAL      hDevNames   NULL   
   HDC   hDC      NULL      NULL
   DWORD      Flags      PD_NOSELECTION | PD_RETURNDC | PD_USEDEVMODECOPIES   
   WORD      nFromPage   1   
   WORD      nToPage      1   
   WORD      nMinPage   1   
   WORD      nMaxPage   65535   
   WORD      nCopies      1   
   HINSTANCE   hInstance   0x00400000 "C:\Program Files (x86)\Notepad++\notepad++.exe"  
   LPARAM      lCustData   0   0
   LPPRINTHOOKPROC   lpfnPrintHook   NULL   
   LPSETUPHOOKPROC   lpfnSetupHook   NULL   
   LPCTSTR      lpPrintTemplateName   NULL   
   LPCTSTR      lpSetupTemplateName   NULL   
   HGLOBAL      hPrintTemplate   NULL   
   HGLOBAL      hSetupTemplate   NULL   
            
   BOOL      Return      FALSE

haentschman 9. Mai 2022 13:25

AW: Version des Printer Dialoges
 
Danke für die Info...:wink: Da muß ich mal gucken. :wink:


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:29 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