With pdlg_add_sub_dialogs() an application can add its custom subdialogs to the printer dialog to offer special print options (e.g. watermarks, background images etc.).
Declaration: WORD pdlg_add_sub_dialogs( PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialog ); Call: ret = pdlg_add_sub_dialogs( prn_dialog, sub_dialogs ); Variable Argument Meaning Inputs: contrl[0] 205 pdlg_set contrl[1] 1 Entries in intin contrl[3] 2 Entries in addrin intin[0] 3 pdlg_add_sub_dialog addrin[0] prn_dialog Pointer to management structure addrin[1] sub_dialogs List of subdialogs Outputs: contrl[2] 1 Entries in intout contrl[4] 0 Entries in addrout intout[0] ret 0: Error 1: All OK Note: The hooking in of an application's own dialogs is demonstrated in the sample programs PDLGSMP3.C and PDLGSMP4.C. Structure description: #define PDLG_CHG_SUB 0x80000000L #define PDLG_IS_BUTTON 0x40000000L #define PDLG_PREBUTTON 0x20000000L #define PDLG_PB_OK 1 #define PDLG_PB_CANCEL 2 #define PDLG_PB_DEVICE 3 #define PDLG_BUT_OK ( PDLG_PREBUTTON + PDLG_PB_OK ) #define PDLG_BUT_CNCL ( PDLG_PREBUTTON + PDLG_PB_CANCEL ) #define PDLG_BUT_DEV ( PDLG_PREBUTTON + PDLG_PB_DEVICE ) typedef int32 (cdecl *PDLG_INIT)( struct _prn_settings *settings, struct _pdlg_sub *sub ); typedef int32 (cdecl *PDLG_HNDL)( struct _prn_settings *settings, struct _pdlg_sub *sub, int16 exit_obj ); typedef int32 (cdecl *PDLG_RESET)( struct _prn_settings *settings, struct _pdlg_sub *sub ); typedef struct _pdlg_sub /* Subdialog for setting device */ { struct _pdlg_sub *next; /* Pointer to the successor in the list */ int32 length; /* Structure length */ int32 format; /* Data format */ int32 reserved; /* Reserved */ void *drivers; /* Only for internal dialogs */ int16 option_flags; /* Flags, inc. PDLG_PRINTING, PDLG_PREFS */ int16 sub_id; /* Subdialog ID, entered for global subdialogs of pdlg_add() */ DIALOG *dialog; /* Pointer to the structure of the window dialog or 0L */ OBJECT *tree; /* Pointer to the assembled object tree */ int16 index_offset; /* Index offset of the subdialog */ int16 reserved1; int32 reserved2; int32 reserved3; int32 reserved4; PDLG_INIT init_dlg; /* Initialisation function */ PDLG_HNDL do_dlg; /* Handling function */ PDLG_RESET reset_dlg; /* Reset function */ int32 reserved5; OBJECT *sub_icon; /* Pointer to the icon for the list box */ OBJECT *sub_tree; /* Pointer to the object tree of the subdialog */ int32 reserved6; int32 reserved7; int32 private1; /* Dialog's private information */ int32 private2; int32 private3; int32 private4; } PDLG_SUB;