× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Just as an fyi, and to get it into the archives:
PrintWindow is not available on the Windows 2000 OS. Not information
made readily available by Microsoft.

Also for the archives, here is my working PrintDlgEx code snippet
(thanks to everyone, especially Mike Bush):

// Printer Dialog Box Data Structure
D pPrintDialogDS S * Inz( *Null )
D PrintDialogDS DS Based( pPrintDialogDS )
Qualified
D lStructSize 10u 0
D hWndOwner 10u 0
D hDevMode 10u 0
D hDevNames 10u 0
D hDC 10u 0
D Flags 10u 0
D Flags2 10u 0
D ExclusionFlags...
D 10u 0
D nPageRanges 10u 0
D nMaxPageRanges...
D 10u 0
D lpPageRanges *
D nMinPage 10u 0
D nMaxPage 10u 0
D nCopies 10u 0
D hInstance 10u 0
D lpPrintTemplateName...
D *
D lpCallBack *
D nPropertyPages...
D 10u 0
D lphPropertyPages...
D *
D nStartPage 10u 0
D dwResultAction...
D 10u 0

// Windows API Constants
D PD_NOPAGENUMS C 8
D PD_RESULT_APPLY...
D C 2
D PD_RESULT_CANCEL...
D C 0
D PD_RESULT_PRINT...
D C 1
D PD_RETURNDC C 256
D START_PAGE_GENERAL...
D C x'FFFFFFFF'

// Global Work Fields
D gResult S 10i 0

// Get the Foreground Window
D GetForeWdw PR 10u 0
ExtProc('GetForegroundWindow')
D dll('User32.dll')
D LinkAge(*StdCall)

// Display the Print Dialog Window
D DspPrintDialog PR 10i 0 ExtProc('PrintDlgExA')
D dll('comdlg32.dll')
D LinkAge(*StdCall)
D pPrintDS * Value

// Initialize the print dialog data structure.
pPrintDialogDS = %alloc( %size( PrintDialogDS ) );
PrintDialogDS.hWndOwner = GetForeWdw();
PrintDialogDS.lStructSize = %size( PrintDialogDS );
PrintDialogDS.hDevNames = x'00';
PrintDialogDS.hDevMode = x'00';
PrintDialogDS.hDC = x'00';
PrintDialogDS.Flags = PD_RETURNDC + PD_NOPAGENUMS;
PrintDialogDS.Flags2 = 0;
PrintDialogDS.ExclusionFlags = 0;
PrintDialogDS.nPageRanges = 0;
PrintDialogDS.nMaxPageRanges = 0;
PrintDialogDS.lpPageRanges = *Null;
PrintDialogDS.nMinPage = 0;
PrintDialogDS.nMaxPage = 0;
PrintDialogDS.nCopies = 1;
PrintDialogDS.hInstance = 0;
PrintDialogDS.lpPrintTemplateName = *Null;
PrintDialogDS.lpCallBack = *Null;
PrintDialogDS.nPropertyPages = 0;
PrintDialogDS.lphPropertyPages = *Null;
PrintDialogDS.nStartPage = START_PAGE_GENERAL;
PrintDialogDS.dwResultAction = 0;

// Display the print dialog box.
// If the user didn't select cancel, print the window.
gResult = DspPrintDialog( pPrintDialogDS );

Kurt Anderson
Application Developer
Highsmith Inc


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.