home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Source / Rtl / Win / COMMDLG.PAS < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  36KB  |  1,011 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Run-time Library                 }
  5. {       Win32 Common Dialogs interface unit             }
  6. {                                                       }
  7. {       Copyright (c) 1985-1999, Microsoft Corporation  }
  8. {                                                       }
  9. {       Translator: Inprise Corporation                 }
  10. {                                                       }
  11. {*******************************************************}
  12.  
  13. unit CommDlg;
  14.  
  15. {$WEAKPACKAGEUNIT}
  16.  
  17. {$HPPEMIT '#include <commdlg.h>'}
  18.  
  19. interface
  20.  
  21. uses Windows, Messages, ShlObj;
  22.  
  23. type
  24.   POpenFilenameA = ^TOpenFilenameA;
  25.   POpenFilenameW = ^TOpenFilenameW;
  26.   POpenFilename = POpenFilenameA;
  27.   {$EXTERNALSYM tagOFNA}
  28.   tagOFNA = packed record
  29.     lStructSize: DWORD;
  30.     hWndOwner: HWND;
  31.     hInstance: HINST;
  32.     lpstrFilter: PAnsiChar;
  33.     lpstrCustomFilter: PAnsiChar;
  34.     nMaxCustFilter: DWORD;
  35.     nFilterIndex: DWORD;
  36.     lpstrFile: PAnsiChar;
  37.     nMaxFile: DWORD;
  38.     lpstrFileTitle: PAnsiChar;
  39.     nMaxFileTitle: DWORD;
  40.     lpstrInitialDir: PAnsiChar;
  41.     lpstrTitle: PAnsiChar;
  42.     Flags: DWORD;
  43.     nFileOffset: Word;
  44.     nFileExtension: Word;
  45.     lpstrDefExt: PAnsiChar;
  46.     lCustData: LPARAM;
  47.     lpfnHook: function(Wnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  48.     lpTemplateName: PAnsiChar;
  49.   end;
  50.   {$EXTERNALSYM tagOFNW}
  51.   tagOFNW = packed record
  52.     lStructSize: DWORD;
  53.     hWndOwner: HWND;
  54.     hInstance: HINST;
  55.     lpstrFilter: PWideChar;
  56.     lpstrCustomFilter: PWideChar;
  57.     nMaxCustFilter: DWORD;
  58.     nFilterIndex: DWORD;
  59.     lpstrFile: PWideChar;
  60.     nMaxFile: DWORD;
  61.     lpstrFileTitle: PWideChar;
  62.     nMaxFileTitle: DWORD;
  63.     lpstrInitialDir: PWideChar;
  64.     lpstrTitle: PWideChar;
  65.     Flags: DWORD;
  66.     nFileOffset: Word;
  67.     nFileExtension: Word;
  68.     lpstrDefExt: PWideChar;
  69.     lCustData: LPARAM;
  70.     lpfnHook: function(Wnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  71.     lpTemplateName: PWideChar;
  72.   end;
  73.   {$EXTERNALSYM tagOFN}
  74.   tagOFN = tagOFNA;
  75.   TOpenFilenameA = tagOFNA;
  76.   TOpenFilenameW = tagOFNW;
  77.   TOpenFilename = TOpenFilenameA;
  78.   {$EXTERNALSYM OPENFILENAMEA}
  79.   OPENFILENAMEA = tagOFNA;
  80.   {$EXTERNALSYM OPENFILENAMEW}
  81.   OPENFILENAMEW = tagOFNW;
  82.   {$EXTERNALSYM OPENFILENAME}
  83.   OPENFILENAME = OPENFILENAMEA;
  84.  
  85. {$EXTERNALSYM GetOpenFileNameA}
  86. function GetOpenFileNameA(var OpenFile: TOpenFilenameA): Bool; stdcall;
  87. {$EXTERNALSYM GetOpenFileNameW}
  88. function GetOpenFileNameW(var OpenFile: TOpenFilenameW): Bool; stdcall;
  89. {$EXTERNALSYM GetOpenFileName}
  90. function GetOpenFileName(var OpenFile: TOpenFilename): Bool; stdcall;
  91. {$EXTERNALSYM GetSaveFileNameA}
  92. function GetSaveFileNameA(var OpenFile: TOpenFilenameA): Bool; stdcall;
  93. {$EXTERNALSYM GetSaveFileNameW}
  94. function GetSaveFileNameW(var OpenFile: TOpenFilenameW): Bool; stdcall;
  95. {$EXTERNALSYM GetSaveFileName}
  96. function GetSaveFileName(var OpenFile: TOpenFilename): Bool; stdcall;
  97. {$EXTERNALSYM GetFileTitleA}
  98. function GetFileTitleA(FileName: PAnsiChar; Title: PAnsiChar; TitleSize: Word): Smallint; stdcall;
  99. {$EXTERNALSYM GetFileTitleW}
  100. function GetFileTitleW(FileName: PWideChar; Title: PWideChar; TitleSize: Word): Smallint; stdcall;
  101. {$EXTERNALSYM GetFileTitle}
  102. function GetFileTitle(FileName: PChar; Title: PChar; TitleSize: Word): Smallint; stdcall;
  103.  
  104. const
  105.   {$EXTERNALSYM OFN_READONLY}
  106.   OFN_READONLY = $00000001;
  107.   {$EXTERNALSYM OFN_OVERWRITEPROMPT}
  108.   OFN_OVERWRITEPROMPT = $00000002;
  109.   {$EXTERNALSYM OFN_HIDEREADONLY}
  110.   OFN_HIDEREADONLY = $00000004;
  111.   {$EXTERNALSYM OFN_NOCHANGEDIR}
  112.   OFN_NOCHANGEDIR = $00000008;
  113.   {$EXTERNALSYM OFN_SHOWHELP}
  114.   OFN_SHOWHELP = $00000010;
  115.   {$EXTERNALSYM OFN_ENABLEHOOK}
  116.   OFN_ENABLEHOOK = $00000020;
  117.   {$EXTERNALSYM OFN_ENABLETEMPLATE}
  118.   OFN_ENABLETEMPLATE = $00000040;
  119.   {$EXTERNALSYM OFN_ENABLETEMPLATEHANDLE}
  120.   OFN_ENABLETEMPLATEHANDLE = $00000080;
  121.   {$EXTERNALSYM OFN_NOVALIDATE}
  122.   OFN_NOVALIDATE = $00000100;
  123.   {$EXTERNALSYM OFN_ALLOWMULTISELECT}
  124.   OFN_ALLOWMULTISELECT = $00000200;
  125.   {$EXTERNALSYM OFN_EXTENSIONDIFFERENT}
  126.   OFN_EXTENSIONDIFFERENT = $00000400;
  127.   {$EXTERNALSYM OFN_PATHMUSTEXIST}
  128.   OFN_PATHMUSTEXIST = $00000800;
  129.   {$EXTERNALSYM OFN_FILEMUSTEXIST}
  130.   OFN_FILEMUSTEXIST = $00001000;
  131.   {$EXTERNALSYM OFN_CREATEPROMPT}
  132.   OFN_CREATEPROMPT = $00002000;
  133.   {$EXTERNALSYM OFN_SHAREAWARE}
  134.   OFN_SHAREAWARE = $00004000;
  135.   {$EXTERNALSYM OFN_NOREADONLYRETURN}
  136.   OFN_NOREADONLYRETURN = $00008000;
  137.   {$EXTERNALSYM OFN_NOTESTFILECREATE}
  138.   OFN_NOTESTFILECREATE = $00010000;
  139.   {$EXTERNALSYM OFN_NONETWORKBUTTON}
  140.   OFN_NONETWORKBUTTON = $00020000;
  141.   {$EXTERNALSYM OFN_NOLONGNAMES}
  142.   OFN_NOLONGNAMES = $00040000;
  143.   {$EXTERNALSYM OFN_EXPLORER}
  144.   OFN_EXPLORER = $00080000;
  145.   {$EXTERNALSYM OFN_NODEREFERENCELINKS}
  146.   OFN_NODEREFERENCELINKS = $00100000;
  147.   {$EXTERNALSYM OFN_LONGNAMES}
  148.   OFN_LONGNAMES = $00200000;
  149.   {$EXTERNALSYM OFN_ENABLEINCLUDENOTIFY}
  150.   OFN_ENABLEINCLUDENOTIFY = $00400000;
  151.   {$EXTERNALSYM OFN_ENABLESIZING}
  152.   OFN_ENABLESIZING = $00800000;
  153.  
  154.  
  155. { Return values for the registered message sent to the hook function
  156.   when a sharing violation occurs.  OFN_SHAREFALLTHROUGH allows the
  157.   filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  158.   up no warning (returned when the app has already put up a warning
  159.   message), and OFN_SHAREWARN puts up the default warning message
  160.   for sharing violations.
  161.  
  162.   Note:  Undefined return values map to OFN_SHAREWARN, but are
  163.          reserved for future use. }
  164.  
  165.   {$EXTERNALSYM OFN_SHAREFALLTHROUGH}
  166.   OFN_SHAREFALLTHROUGH = 2;
  167.   {$EXTERNALSYM OFN_SHARENOWARN}
  168.   OFN_SHARENOWARN = 1;
  169.   {$EXTERNALSYM OFN_SHAREWARN}
  170.   OFN_SHAREWARN = 0;
  171.  
  172. type
  173.   POFNotifyA = ^TOFNotifyA;
  174.   POFNotifyW = ^TOFNotifyW;
  175.   POFNotify = POFNotifyA;
  176.   {$EXTERNALSYM _OFNOTIFYA}
  177.   _OFNOTIFYA = packed record
  178.     hdr: TNMHdr;
  179.     lpOFN: POpenFilenameA;
  180.     pszFile: PAnsiChar;
  181.   end;
  182.   {$EXTERNALSYM _OFNOTIFYW}
  183.   _OFNOTIFYW = packed record
  184.     hdr: TNMHdr;
  185.     lpOFN: POpenFilenameW;
  186.     pszFile: PWideChar;
  187.   end;
  188.   {$EXTERNALSYM _OFNOTIFY}
  189.   _OFNOTIFY = _OFNOTIFYA;
  190.   TOFNotifyA = _OFNOTIFYA;
  191.   TOFNotifyW = _OFNOTIFYW;
  192.   TOFNotify = TOFNotifyA;
  193.   {$EXTERNALSYM OFNOTIFYA}
  194.   OFNOTIFYA = _OFNOTIFYA;
  195.   {$EXTERNALSYM OFNOTIFYW}
  196.   OFNOTIFYW = _OFNOTIFYW;
  197.   {$EXTERNALSYM OFNOTIFY}
  198.   OFNOTIFY = OFNOTIFYA;
  199.  
  200.  
  201.   POFNotifyExA = ^TOFNotifyExA;
  202.   POFNotifyExW = ^TOFNotifyExW;
  203.   POFNotifyEx = POFNotifyExA;
  204.   {$EXTERNALSYM _OFNOTIFYEXA}
  205.   _OFNOTIFYEXA = packed record
  206.     hdr: TNMHdr;
  207.     lpOFN: POpenFilenameA;
  208.     psf: IShellFolder;
  209.     pidl: Pointer;
  210.   end;
  211.   {$EXTERNALSYM _OFNOTIFYEXW}
  212.   _OFNOTIFYEXW = packed record
  213.     hdr: TNMHdr;
  214.     lpOFN: POpenFilenameW;
  215.     psf: IShellFolder;
  216.     pidl: Pointer;
  217.   end;
  218.   {$EXTERNALSYM _OFNOTIFYEX}
  219.   _OFNOTIFYEX = _OFNOTIFYEXA;
  220.   TOFNotifyExA = _OFNOTIFYEXA;
  221.   TOFNotifyExW = _OFNOTIFYEXW;
  222.   TOFNotifyEx = TOFNotifyExA;
  223.   {$EXTERNALSYM OFNOTIFYEXA}
  224.   OFNOTIFYEXA = _OFNOTIFYEXA;
  225.   {$EXTERNALSYM OFNOTIFYEXW}
  226.   OFNOTIFYEXW = _OFNOTIFYEXW;
  227.   {$EXTERNALSYM OFNOTIFYEX}
  228.   OFNOTIFYEX = OFNOTIFYEXA;
  229.  
  230. const
  231.   {$EXTERNALSYM CDN_FIRST}
  232.   CDN_FIRST = -601;
  233.   {$EXTERNALSYM CDN_LAST}
  234.   CDN_LAST = -699;
  235.  
  236. { Notifications when Open or Save dialog status changes }
  237.  
  238.   {$EXTERNALSYM CDN_INITDONE}
  239.   CDN_INITDONE = CDN_FIRST - 0;
  240.   {$EXTERNALSYM CDN_SELCHANGE}
  241.   CDN_SELCHANGE = CDN_FIRST - 1;
  242.   {$EXTERNALSYM CDN_FOLDERCHANGE}
  243.   CDN_FOLDERCHANGE = CDN_FIRST - 2;
  244.   {$EXTERNALSYM CDN_SHAREVIOLATION}
  245.   CDN_SHAREVIOLATION = CDN_FIRST - 3;
  246.   {$EXTERNALSYM CDN_HELP}
  247.   CDN_HELP = CDN_FIRST - 4;
  248.   {$EXTERNALSYM CDN_FILEOK}
  249.   CDN_FILEOK = CDN_FIRST - 5;
  250.   {$EXTERNALSYM CDN_TYPECHANGE}
  251.   CDN_TYPECHANGE = CDN_FIRST - 6;
  252.   {$EXTERNALSYM CDN_INCLUDEITEM}
  253.   CDN_INCLUDEITEM = CDN_FIRST - 7;
  254.  
  255.   {$EXTERNALSYM CDM_FIRST}
  256.   CDM_FIRST = WM_USER + 100;
  257.   {$EXTERNALSYM CDM_LAST}
  258.   CDM_LAST = WM_USER + 200;
  259.  
  260. { Messages to query information from the Open or Save dialogs }
  261.  
  262. { lParam = pointer to text buffer that gets filled in
  263.   wParam = max number of characters of the text buffer (including NULL)
  264.   return = < 0 if error; number of characters needed (including NULL) }
  265.  
  266.   {$EXTERNALSYM CDM_GETSPEC}
  267.   CDM_GETSPEC = CDM_FIRST + 0;
  268.  
  269. { lParam = pointer to text buffer that gets filled in
  270.   wParam = max number of characters of the text buffer (including NULL)
  271.   return = < 0 if error; number of characters needed (including NULL) }
  272.  
  273.   {$EXTERNALSYM CDM_GETFILEPATH}
  274.   CDM_GETFILEPATH = CDM_FIRST + 1;
  275.  
  276. { lParam = pointer to text buffer that gets filled in
  277.   wParam = max number of characters of the text buffer (including NULL)
  278.   return = < 0 if error; number of characters needed (including NULL) }
  279.  
  280.   {$EXTERNALSYM CDM_GETFOLDERPATH}
  281.   CDM_GETFOLDERPATH = CDM_FIRST + 2;
  282.  
  283. { lParam = pointer to ITEMIDLIST buffer that gets filled in
  284.   wParam = size of the ITEMIDLIST buffer
  285.   return = < 0 if error; length of buffer needed }
  286.  
  287.   {$EXTERNALSYM CDM_GETFOLDERIDLIST}
  288.   CDM_GETFOLDERIDLIST = CDM_FIRST + 3;
  289.  
  290. { lParam = pointer to a string
  291.   wParam = ID of control to change
  292.   return = not used }
  293.  
  294.   {$EXTERNALSYM CDM_SETCONTROLTEXT}
  295.   CDM_SETCONTROLTEXT = CDM_FIRST + 4;
  296.  
  297. { lParam = not used
  298.   wParam = ID of control to change
  299.   return = not used }
  300.  
  301.   {$EXTERNALSYM CDM_HIDECONTROL}
  302.   CDM_HIDECONTROL = CDM_FIRST + 5;
  303.  
  304. { lParam = pointer to default extension (no dot)
  305.   wParam = not used
  306.   return = not used }
  307.  
  308.   {$EXTERNALSYM CDM_SETDEFEXT}
  309.   CDM_SETDEFEXT = CDM_FIRST + 6;
  310.  
  311. type
  312.   PChooseColorA = ^TChooseColorA;
  313.   PChooseColorW = ^TChooseColorW;
  314.   PChooseColor = PChooseColorA;
  315.   {$EXTERNALSYM tagCHOOSECOLORA}
  316.   tagCHOOSECOLORA = packed record
  317.     lStructSize: DWORD;
  318.     hWndOwner: HWND;
  319.     hInstance: HWND;
  320.     rgbResult: COLORREF;
  321.     lpCustColors: ^COLORREF;
  322.     Flags: DWORD;
  323.     lCustData: LPARAM;
  324.     lpfnHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  325.     lpTemplateName: PAnsiChar;
  326.   end;
  327.   {$EXTERNALSYM tagCHOOSECOLORW}
  328.   tagCHOOSECOLORW = packed record
  329.     lStructSize: DWORD;
  330.     hWndOwner: HWND;
  331.     hInstance: HWND;
  332.     rgbResult: COLORREF;
  333.     lpCustColors: ^COLORREF;
  334.     Flags: DWORD;
  335.     lCustData: LPARAM;
  336.     lpfnHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  337.     lpTemplateName: PWideChar;
  338.   end;
  339.   {$EXTERNALSYM tagCHOOSECOLOR}
  340.   tagCHOOSECOLOR = tagCHOOSECOLORA;
  341.   TChooseColorA = tagCHOOSECOLORA;
  342.   TChooseColorW = tagCHOOSECOLORW;
  343.   TChooseColor = TChooseColorA;
  344.  
  345. {$EXTERNALSYM ChooseColorA}
  346. function ChooseColorA(var CC: TChooseColorA): Bool; stdcall;
  347. {$EXTERNALSYM ChooseColorW}
  348. function ChooseColorW(var CC: TChooseColorW): Bool; stdcall;
  349. {$EXTERNALSYM ChooseColor}
  350. function ChooseColor(var CC: TChooseColor): Bool; stdcall;
  351.  
  352. const
  353.   {$EXTERNALSYM CC_RGBINIT}
  354.   CC_RGBINIT = $00000001;
  355.   {$EXTERNALSYM CC_FULLOPEN}
  356.   CC_FULLOPEN = $00000002;
  357.   {$EXTERNALSYM CC_PREVENTFULLOPEN}
  358.   CC_PREVENTFULLOPEN = $00000004;
  359.   {$EXTERNALSYM CC_SHOWHELP}
  360.   CC_SHOWHELP = $00000008;
  361.   {$EXTERNALSYM CC_ENABLEHOOK}
  362.   CC_ENABLEHOOK = $00000010;
  363.   {$EXTERNALSYM CC_ENABLETEMPLATE}
  364.   CC_ENABLETEMPLATE = $00000020;
  365.   {$EXTERNALSYM CC_ENABLETEMPLATEHANDLE}
  366.   CC_ENABLETEMPLATEHANDLE = $00000040;
  367.   {$EXTERNALSYM CC_SOLIDCOLOR}
  368.   CC_SOLIDCOLOR = $00000080;
  369.   {$EXTERNALSYM CC_ANYCOLOR}
  370.   CC_ANYCOLOR = $00000100;
  371.  
  372. type
  373.   PFindReplaceA = ^TFindReplaceA;
  374.   PFindReplaceW = ^TFindReplaceW;
  375.   PFindReplace = PFindReplaceA;
  376.   {$EXTERNALSYM tagFINDREPLACEA}
  377.   tagFINDREPLACEA = packed record
  378.     lStructSize: DWORD;        { size of this struct $20 }
  379.     hWndOwner: HWND;             { handle to owner's window }
  380.     hInstance: HINST;        { instance handle of.EXE that
  381.                                    contains cust. dlg. template }
  382.     Flags: DWORD;                { one or more of the fr_?? }
  383.     lpstrFindWhat: PAnsiChar;       { ptr. to search string    }
  384.     lpstrReplaceWith: PAnsiChar;    { ptr. to replace string   }
  385.     wFindWhatLen: Word;          { size of find buffer      }
  386.     wReplaceWithLen: Word;       { size of replace buffer   }
  387.     lCustData: LPARAM;           { data passed to hook fn.  }
  388.     lpfnHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  389.                                  { ptr. to hook fn. or nil }
  390.     lpTemplateName: PAnsiChar;     { custom template name     }
  391.   end;
  392.   {$EXTERNALSYM tagFINDREPLACEW}
  393.   tagFINDREPLACEW = packed record
  394.     lStructSize: DWORD;        { size of this struct $20 }
  395.     hWndOwner: HWND;             { handle to owner's window }
  396.     hInstance: HINST;        { instance handle of.EXE that
  397.                                    contains cust. dlg. template }
  398.     Flags: DWORD;                { one or more of the fr_?? }
  399.     lpstrFindWhat: PWideChar;       { ptr. to search string    }
  400.     lpstrReplaceWith: PWideChar;    { ptr. to replace string   }
  401.     wFindWhatLen: Word;          { size of find buffer      }
  402.     wReplaceWithLen: Word;       { size of replace buffer   }
  403.     lCustData: LPARAM;           { data passed to hook fn.  }
  404.     lpfnHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  405.                                  { ptr. to hook fn. or nil }
  406.     lpTemplateName: PWideChar;     { custom template name     }
  407.   end;
  408.   {$EXTERNALSYM tagFINDREPLACE}
  409.   tagFINDREPLACE = tagFINDREPLACEA;
  410.   TFindReplaceA = tagFINDREPLACEA;
  411.   TFindReplaceW = tagFINDREPLACEW;
  412.   TFindReplace = TFindReplaceA;
  413.   {$EXTERNALSYM FINDREPLACEA}
  414.   FINDREPLACEA = tagFINDREPLACEA;
  415.   {$EXTERNALSYM FINDREPLACEW}
  416.   FINDREPLACEW = tagFINDREPLACEW;
  417.   {$EXTERNALSYM FINDREPLACE}
  418.   FINDREPLACE = FINDREPLACEA;
  419.  
  420. const
  421.   {$EXTERNALSYM FR_DOWN}
  422.   FR_DOWN = $00000001;
  423.   {$EXTERNALSYM FR_WHOLEWORD}
  424.   FR_WHOLEWORD = $00000002;
  425.   {$EXTERNALSYM FR_MATCHCASE}
  426.   FR_MATCHCASE = $00000004;
  427.   {$EXTERNALSYM FR_FINDNEXT}
  428.   FR_FINDNEXT = $00000008;
  429.   {$EXTERNALSYM FR_REPLACE}
  430.   FR_REPLACE = $00000010;
  431.   {$EXTERNALSYM FR_REPLACEALL}
  432.   FR_REPLACEALL = $00000020;
  433.   {$EXTERNALSYM FR_DIALOGTERM}
  434.   FR_DIALOGTERM = $00000040;
  435.   {$EXTERNALSYM FR_SHOWHELP}
  436.   FR_SHOWHELP = $00000080;
  437.   {$EXTERNALSYM FR_ENABLEHOOK}
  438.   FR_ENABLEHOOK = $00000100;
  439.   {$EXTERNALSYM FR_ENABLETEMPLATE}
  440.   FR_ENABLETEMPLATE = $00000200;
  441.   {$EXTERNALSYM FR_NOUPDOWN}
  442.   FR_NOUPDOWN = $00000400;
  443.   {$EXTERNALSYM FR_NOMATCHCASE}
  444.   FR_NOMATCHCASE = $00000800;
  445.   {$EXTERNALSYM FR_NOWHOLEWORD}
  446.   FR_NOWHOLEWORD = $00001000;
  447.   {$EXTERNALSYM FR_ENABLETEMPLATEHANDLE}
  448.   FR_ENABLETEMPLATEHANDLE = $00002000;
  449.   {$EXTERNALSYM FR_HIDEUPDOWN}
  450.   FR_HIDEUPDOWN = $00004000;
  451.   {$EXTERNALSYM FR_HIDEMATCHCASE}
  452.   FR_HIDEMATCHCASE = $00008000;
  453.   {$EXTERNALSYM FR_HIDEWHOLEWORD}
  454.   FR_HIDEWHOLEWORD = $00010000;
  455.  
  456. {$EXTERNALSYM FindTextA}
  457. function FindTextA(var FindReplace: TFindReplaceA): HWND; stdcall;
  458. {$EXTERNALSYM FindTextW}
  459. function FindTextW(var FindReplace: TFindReplaceW): HWND; stdcall;
  460. {$EXTERNALSYM FindText}
  461. function FindText(var FindReplace: TFindReplace): HWND; stdcall;
  462. {$EXTERNALSYM ReplaceTextA}
  463. function ReplaceTextA(var FindReplace: TFindReplaceA): HWND; stdcall;
  464. {$EXTERNALSYM ReplaceTextW}
  465. function ReplaceTextW(var FindReplace: TFindReplaceW): HWND; stdcall;
  466. {$EXTERNALSYM ReplaceText}
  467. function ReplaceText(var FindReplace: TFindReplace): HWND; stdcall;
  468.  
  469. type
  470.   PChooseFontA = ^TChooseFontA;
  471.   PChooseFontW = ^TChooseFontW;
  472.   PChooseFont = PChooseFontA;
  473.   {$EXTERNALSYM tagCHOOSEFONTA}
  474.   tagCHOOSEFONTA = packed record
  475.     lStructSize: DWORD;
  476.     hWndOwner: HWnd;            { caller's window handle }
  477.     hDC: HDC;                   { printer DC/IC or nil }
  478.     lpLogFont: PLogFontA;     { pointer to a LOGFONT struct }
  479.     iPointSize: Integer;        { 10 * size in points of selected font }
  480.     Flags: DWORD;               { dialog flags }
  481.     rgbColors: COLORREF;        { returned text color }
  482.     lCustData: LPARAM;          { data passed to hook function }
  483.     lpfnHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  484.                                 { pointer to hook function }
  485.     lpTemplateName: PAnsiChar;    { custom template name }
  486.     hInstance: HINST;       { instance handle of EXE that contains
  487.                                   custom dialog template }
  488.     lpszStyle: PAnsiChar;         { return the style field here
  489.                                   must be lf_FaceSize or bigger }
  490.     nFontType: Word;            { same value reported to the EnumFonts
  491.                                   call back with the extra fonttype_
  492.                                   bits added }
  493.     wReserved: Word;
  494.     nSizeMin: Integer;          { minimum point size allowed and }
  495.     nSizeMax: Integer;          { maximum point size allowed if
  496.                                   cf_LimitSize is used }
  497.   end;
  498.   {$EXTERNALSYM tagCHOOSEFONTW}
  499.   tagCHOOSEFONTW = packed record
  500.     lStructSize: DWORD;
  501.     hWndOwner: HWnd;            { caller's window handle }
  502.     hDC: HDC;                   { printer DC/IC or nil }
  503.     lpLogFont: PLogFontW;     { pointer to a LOGFONT struct }
  504.     iPointSize: Integer;        { 10 * size in points of selected font }
  505.     Flags: DWORD;               { dialog flags }
  506.     rgbColors: COLORREF;        { returned text color }
  507.     lCustData: LPARAM;          { data passed to hook function }
  508.     lpfnHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  509.                                 { pointer to hook function }
  510.     lpTemplateName: PWideChar;    { custom template name }
  511.     hInstance: HINST;       { instance handle of EXE that contains
  512.                                   custom dialog template }
  513.     lpszStyle: PWideChar;         { return the style field here
  514.                                   must be lf_FaceSize or bigger }
  515.     nFontType: Word;            { same value reported to the EnumFonts
  516.                                   call back with the extra fonttype_
  517.                                   bits added }
  518.     wReserved: Word;
  519.     nSizeMin: Integer;          { minimum point size allowed and }
  520.     nSizeMax: Integer;          { maximum point size allowed if
  521.                                   cf_LimitSize is used }
  522.   end;
  523.   {$EXTERNALSYM tagCHOOSEFONT}
  524.   tagCHOOSEFONT = tagCHOOSEFONTA;
  525.   TChooseFontA = tagCHOOSEFONTA;
  526.   TChooseFontW = tagCHOOSEFONTW;
  527.   TChooseFont = TChooseFontA;
  528.  
  529. {$EXTERNALSYM ChooseFontA}
  530. function ChooseFontA(var ChooseFont: TChooseFontA): Bool; stdcall;
  531. {$EXTERNALSYM ChooseFontW}
  532. function ChooseFontW(var ChooseFont: TChooseFontW): Bool; stdcall;
  533. {$EXTERNALSYM ChooseFont}
  534. function ChooseFont(var ChooseFont: TChooseFont): Bool; stdcall;
  535.  
  536. const
  537.   {$EXTERNALSYM CF_SCREENFONTS}
  538.   CF_SCREENFONTS = $00000001;
  539.   {$EXTERNALSYM CF_PRINTERFONTS}
  540.   CF_PRINTERFONTS = $00000002;
  541.   {$EXTERNALSYM CF_BOTH}
  542.   CF_BOTH = CF_SCREENFONTS OR CF_PRINTERFONTS;
  543.   {$EXTERNALSYM CF_SHOWHELP}
  544.   CF_SHOWHELP = $00000004;
  545.   {$EXTERNALSYM CF_ENABLEHOOK}
  546.   CF_ENABLEHOOK = $00000008;
  547.   {$EXTERNALSYM CF_ENABLETEMPLATE}
  548.   CF_ENABLETEMPLATE = $00000010;
  549.   {$EXTERNALSYM CF_ENABLETEMPLATEHANDLE}
  550.   CF_ENABLETEMPLATEHANDLE = $00000020;
  551.   {$EXTERNALSYM CF_INITTOLOGFONTSTRUCT}
  552.   CF_INITTOLOGFONTSTRUCT = $00000040;
  553.   {$EXTERNALSYM CF_USESTYLE}
  554.   CF_USESTYLE = $00000080;
  555.   {$EXTERNALSYM CF_EFFECTS}
  556.   CF_EFFECTS = $00000100;
  557.   {$EXTERNALSYM CF_APPLY}
  558.   CF_APPLY = $00000200;
  559.   {$EXTERNALSYM CF_ANSIONLY}
  560.   CF_ANSIONLY = $00000400;
  561.   {$EXTERNALSYM CF_SCRIPTSONLY}
  562.   CF_SCRIPTSONLY = CF_ANSIONLY;
  563.   {$EXTERNALSYM CF_NOVECTORFONTS}
  564.   CF_NOVECTORFONTS = $00000800;
  565.   {$EXTERNALSYM CF_NOOEMFONTS}
  566.   CF_NOOEMFONTS = CF_NOVECTORFONTS;
  567.   {$EXTERNALSYM CF_NOSIMULATIONS}
  568.   CF_NOSIMULATIONS = $00001000;
  569.   {$EXTERNALSYM CF_LIMITSIZE}
  570.   CF_LIMITSIZE = $00002000;
  571.   {$EXTERNALSYM CF_FIXEDPITCHONLY}
  572.   CF_FIXEDPITCHONLY = $00004000;
  573.   {$EXTERNALSYM CF_WYSIWYG}
  574.   CF_WYSIWYG = $00008000; { must also have CF_SCREENFONTS & CF_PRINTERFONTS }
  575.   {$EXTERNALSYM CF_FORCEFONTEXIST}
  576.   CF_FORCEFONTEXIST = $00010000;
  577.   {$EXTERNALSYM CF_SCALABLEONLY}
  578.   CF_SCALABLEONLY = $00020000;
  579.   {$EXTERNALSYM CF_TTONLY}
  580.   CF_TTONLY = $00040000;
  581.   {$EXTERNALSYM CF_NOFACESEL}
  582.   CF_NOFACESEL = $00080000;
  583.   {$EXTERNALSYM CF_NOSTYLESEL}
  584.   CF_NOSTYLESEL = $00100000;
  585.   {$EXTERNALSYM CF_NOSIZESEL}
  586.   CF_NOSIZESEL = $00200000;
  587.   {$EXTERNALSYM CF_SELECTSCRIPT}
  588.   CF_SELECTSCRIPT = $00400000;
  589.   {$EXTERNALSYM CF_NOSCRIPTSEL}
  590.   CF_NOSCRIPTSEL = $00800000;
  591.   {$EXTERNALSYM CF_NOVERTFONTS}
  592.   CF_NOVERTFONTS = $01000000;
  593.  
  594. { these are extra nFontType bits that are added to what is returned to the
  595.   EnumFonts callback routine }
  596.  
  597.   {$EXTERNALSYM SIMULATED_FONTTYPE}
  598.   SIMULATED_FONTTYPE = $8000;
  599.   {$EXTERNALSYM PRINTER_FONTTYPE}
  600.   PRINTER_FONTTYPE = $4000;
  601.   {$EXTERNALSYM SCREEN_FONTTYPE}
  602.   SCREEN_FONTTYPE = $2000;
  603.   {$EXTERNALSYM BOLD_FONTTYPE}
  604.   BOLD_FONTTYPE = $0100;
  605.   {$EXTERNALSYM ITALIC_FONTTYPE}
  606.   ITALIC_FONTTYPE = $0200;
  607.   {$EXTERNALSYM REGULAR_FONTTYPE}
  608.   REGULAR_FONTTYPE = $0400;
  609.  
  610.   {$EXTERNALSYM OPENTYPE_FONTTYPE}
  611.   OPENTYPE_FONTTYPE = $10000;
  612.   {$EXTERNALSYM TYPE1_FONTTYPE}
  613.   TYPE1_FONTTYPE = $20000;
  614.   {$EXTERNALSYM DSIG_FONTTYPE}
  615.   DSIG_FONTTYPE = $40000;
  616.  
  617.   {$EXTERNALSYM WM_CHOOSEFONT_GETLOGFONT}
  618.   WM_CHOOSEFONT_GETLOGFONT = WM_USER + 1;
  619.   {$EXTERNALSYM WM_CHOOSEFONT_SETLOGFONT}
  620.   WM_CHOOSEFONT_SETLOGFONT = WM_USER + 101; { removed in 4.0 SDK }
  621.   {$EXTERNALSYM WM_CHOOSEFONT_SETFLAGS}
  622.   WM_CHOOSEFONT_SETFLAGS   = WM_USER + 102; { removed in 4.0 SDK }
  623.  
  624. { strings used to obtain unique window message for communication
  625.   between dialog and caller }
  626.  
  627.   {$EXTERNALSYM LBSELCHSTRING}
  628.   LBSELCHSTRING = 'commdlg_LBSelChangedNotify';
  629.   {$EXTERNALSYM SHAREVISTRING}
  630.   SHAREVISTRING = 'commdlg_ShareViolation';
  631.   {$EXTERNALSYM FILEOKSTRING}
  632.   FILEOKSTRING  = 'commdlg_FileNameOK';
  633.   {$EXTERNALSYM COLOROKSTRING}
  634.   COLOROKSTRING = 'commdlg_ColorOK';
  635.   {$EXTERNALSYM SETRGBSTRING}
  636.   SETRGBSTRING  = 'commdlg_SetRGBColor';
  637.   {$EXTERNALSYM FINDMSGSTRING}
  638.   FINDMSGSTRING = 'commdlg_FindReplace';
  639.   {$EXTERNALSYM HELPMSGSTRING}
  640.   HELPMSGSTRING = 'commdlg_help';
  641.  
  642. { HIWORD values for lParam of commdlg_LBSelChangeNotify message }
  643.  
  644. const
  645.   {$EXTERNALSYM CD_LBSELNOITEMS}
  646.   CD_LBSELNOITEMS = -1;
  647.   {$EXTERNALSYM CD_LBSELCHANGE}
  648.   CD_LBSELCHANGE  = 0;
  649.   {$EXTERNALSYM CD_LBSELSUB}
  650.   CD_LBSELSUB     = 1;
  651.   {$EXTERNALSYM CD_LBSELADD}
  652.   CD_LBSELADD     = 2;
  653.  
  654. type
  655.   PPrintDlgA = ^TPrintDlgA;
  656.   PPrintDlgW = ^TPrintDlgW;
  657.   PPrintDlg = PPrintDlgA;
  658.   {$EXTERNALSYM tagPDA}
  659.   tagPDA = packed record
  660.     lStructSize: DWORD;
  661.     hWndOwner: HWND;
  662.     hDevMode: HGLOBAL;
  663.     hDevNames: HGLOBAL;
  664.     hDC: HDC;
  665.     Flags: DWORD;
  666.     nFromPage: Word;
  667.     nToPage: Word;
  668.     nMinPage: Word;
  669.     nMaxPage: Word;
  670.     nCopies: Word;
  671.     hInstance: HINST;
  672.     lCustData: LPARAM;
  673.     lpfnPrintHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  674.     lpfnSetupHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  675.     lpPrintTemplateName: PAnsiChar;
  676.     lpSetupTemplateName: PAnsiChar;
  677.     hPrintTemplate: HGLOBAL;
  678.     hSetupTemplate: HGLOBAL;
  679.   end;
  680.   {$EXTERNALSYM tagPDW}
  681.   tagPDW = packed record
  682.     lStructSize: DWORD;
  683.     hWndOwner: HWND;
  684.     hDevMode: HGLOBAL;
  685.     hDevNames: HGLOBAL;
  686.     hDC: HDC;
  687.     Flags: DWORD;
  688.     nFromPage: Word;
  689.     nToPage: Word;
  690.     nMinPage: Word;
  691.     nMaxPage: Word;
  692.     nCopies: Word;
  693.     hInstance: HINST;
  694.     lCustData: LPARAM;
  695.     lpfnPrintHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  696.     lpfnSetupHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  697.     lpPrintTemplateName: PWideChar;
  698.     lpSetupTemplateName: PWideChar;
  699.     hPrintTemplate: HGLOBAL;
  700.     hSetupTemplate: HGLOBAL;
  701.   end;
  702.   {$EXTERNALSYM tagPD}
  703.   tagPD = tagPDA;
  704.   TPrintDlgA = tagPDA;
  705.   TPrintDlgW = tagPDW;
  706.   TPrintDlg = TPrintDlgA;
  707.  
  708. {$EXTERNALSYM PrintDlgA}
  709. function PrintDlgA(var PrintDlg: TPrintDlgA): Bool; stdcall;
  710. {$EXTERNALSYM PrintDlgW}
  711. function PrintDlgW(var PrintDlg: TPrintDlgW): Bool; stdcall;
  712. {$EXTERNALSYM PrintDlg}
  713. function PrintDlg(var PrintDlg: TPrintDlg): Bool; stdcall;
  714.  
  715. const
  716.   {$EXTERNALSYM PD_ALLPAGES}
  717.   PD_ALLPAGES = $00000000;
  718.   {$EXTERNALSYM PD_SELECTION}
  719.   PD_SELECTION = $00000001;
  720.   {$EXTERNALSYM PD_PAGENUMS}
  721.   PD_PAGENUMS = $00000002;
  722.   {$EXTERNALSYM PD_NOSELECTION}
  723.   PD_NOSELECTION = $00000004;
  724.   {$EXTERNALSYM PD_NOPAGENUMS}
  725.   PD_NOPAGENUMS = $00000008;
  726.   {$EXTERNALSYM PD_COLLATE}
  727.   PD_COLLATE = $00000010;
  728.   {$EXTERNALSYM PD_PRINTTOFILE}
  729.   PD_PRINTTOFILE = $00000020;
  730.   {$EXTERNALSYM PD_PRINTSETUP}
  731.   PD_PRINTSETUP = $00000040;
  732.   {$EXTERNALSYM PD_NOWARNING}
  733.   PD_NOWARNING = $00000080;
  734.   {$EXTERNALSYM PD_RETURNDC}
  735.   PD_RETURNDC = $00000100;
  736.   {$EXTERNALSYM PD_RETURNIC}
  737.   PD_RETURNIC = $00000200;
  738.   {$EXTERNALSYM PD_RETURNDEFAULT}
  739.   PD_RETURNDEFAULT = $00000400;
  740.   {$EXTERNALSYM PD_SHOWHELP}
  741.   PD_SHOWHELP = $00000800;
  742.   {$EXTERNALSYM PD_ENABLEPRINTHOOK}
  743.   PD_ENABLEPRINTHOOK = $00001000;
  744.   {$EXTERNALSYM PD_ENABLESETUPHOOK}
  745.   PD_ENABLESETUPHOOK = $00002000;
  746.   {$EXTERNALSYM PD_ENABLEPRINTTEMPLATE}
  747.   PD_ENABLEPRINTTEMPLATE = $00004000;
  748.   {$EXTERNALSYM PD_ENABLESETUPTEMPLATE}
  749.   PD_ENABLESETUPTEMPLATE = $00008000;
  750.   {$EXTERNALSYM PD_ENABLEPRINTTEMPLATEHANDLE}
  751.   PD_ENABLEPRINTTEMPLATEHANDLE = $00010000;
  752.   {$EXTERNALSYM PD_ENABLESETUPTEMPLATEHANDLE}
  753.   PD_ENABLESETUPTEMPLATEHANDLE = $00020000;
  754.   {$EXTERNALSYM PD_USEDEVMODECOPIES}
  755.   PD_USEDEVMODECOPIES = $00040000;
  756.   {$EXTERNALSYM PD_USEDEVMODECOPIESANDCOLLATE}
  757.   PD_USEDEVMODECOPIESANDCOLLATE = $00040000;
  758.   {$EXTERNALSYM PD_DISABLEPRINTTOFILE}
  759.   PD_DISABLEPRINTTOFILE = $00080000;
  760.   {$EXTERNALSYM PD_HIDEPRINTTOFILE}
  761.   PD_HIDEPRINTTOFILE = $00100000;
  762.   {$EXTERNALSYM PD_NONETWORKBUTTON}
  763.   PD_NONETWORKBUTTON = $00200000;
  764.  
  765. type
  766.   PDevNames = ^TDevNames;
  767.   {$EXTERNALSYM tagDEVNAMES}
  768.   tagDEVNAMES = record
  769.     wDriverOffset: Word;
  770.     wDeviceOffset: Word;
  771.     wOutputOffset: Word;
  772.     wDefault: Word;
  773.   end;
  774.   TDevNames = tagDEVNAMES;
  775.   {$EXTERNALSYM DEVNAMES}
  776.   DEVNAMES = tagDEVNAMES;
  777.  
  778. const
  779.   {$EXTERNALSYM DN_DEFAULTPRN}
  780.   DN_DEFAULTPRN = $0001;
  781.  
  782. {$EXTERNALSYM CommDlgExtendedError}
  783. function CommDlgExtendedError: DWORD; stdcall;
  784.  
  785. const
  786.   {$EXTERNALSYM WM_PSD_PAGESETUPDLG}
  787.   WM_PSD_PAGESETUPDLG     = WM_USER;
  788.   {$EXTERNALSYM WM_PSD_FULLPAGERECT}
  789.   WM_PSD_FULLPAGERECT     = WM_USER + 1;
  790.   {$EXTERNALSYM WM_PSD_MINMARGINRECT}
  791.   WM_PSD_MINMARGINRECT    = WM_USER + 2;
  792.   {$EXTERNALSYM WM_PSD_MARGINRECT}
  793.   WM_PSD_MARGINRECT       = WM_USER + 3;
  794.   {$EXTERNALSYM WM_PSD_GREEKTEXTRECT}
  795.   WM_PSD_GREEKTEXTRECT    = WM_USER + 4;
  796.   {$EXTERNALSYM WM_PSD_ENVSTAMPRECT}
  797.   WM_PSD_ENVSTAMPRECT     = WM_USER + 5;
  798.   {$EXTERNALSYM WM_PSD_YAFULLPAGERECT}
  799.   WM_PSD_YAFULLPAGERECT   = WM_USER + 6;
  800.  
  801. type
  802.   PPageSetupDlgA = ^TPageSetupDlgA;
  803.   PPageSetupDlgW = ^TPageSetupDlgW;
  804.   PPageSetupDlg = PPageSetupDlgA;
  805.   {$EXTERNALSYM tagPSDA}
  806.   tagPSDA = packed record
  807.     lStructSize: DWORD;
  808.     hwndOwner: HWND;
  809.     hDevMode: HGLOBAL;
  810.     hDevNames: HGLOBAL;
  811.     Flags: DWORD;
  812.     ptPaperSize: TPoint;
  813.     rtMinMargin: TRect;
  814.     rtMargin: TRect;
  815.     hInstance: HINST;
  816.     lCustData: LPARAM;
  817.     lpfnPageSetupHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  818.     lpfnPagePaintHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  819.     lpPageSetupTemplateName: PAnsiChar;
  820.     hPageSetupTemplate: HGLOBAL;
  821.   end;
  822.   {$EXTERNALSYM tagPSDW}
  823.   tagPSDW = packed record
  824.     lStructSize: DWORD;
  825.     hwndOwner: HWND;
  826.     hDevMode: HGLOBAL;
  827.     hDevNames: HGLOBAL;
  828.     Flags: DWORD;
  829.     ptPaperSize: TPoint;
  830.     rtMinMargin: TRect;
  831.     rtMargin: TRect;
  832.     hInstance: HINST;
  833.     lCustData: LPARAM;
  834.     lpfnPageSetupHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  835.     lpfnPagePaintHook: function(Wnd: HWND; Message: UINT; wParam: WPARAM; lParam: LPARAM): UINT stdcall;
  836.     lpPageSetupTemplateName: PWideChar;
  837.     hPageSetupTemplate: HGLOBAL;
  838.   end;
  839.   {$EXTERNALSYM tagPSD}
  840.   tagPSD = tagPSDA;
  841.   TPageSetupDlgA = tagPSDA;
  842.   TPageSetupDlgW = tagPSDW;
  843.   TPageSetupDlg = TPageSetupDlgA;
  844.  
  845. {$EXTERNALSYM PageSetupDlgA}
  846. function PageSetupDlgA(var PgSetupDialog: TPageSetupDlgA): BOOL; stdcall;
  847. {$EXTERNALSYM PageSetupDlgW}
  848. function PageSetupDlgW(var PgSetupDialog: TPageSetupDlgW): BOOL; stdcall;
  849. {$EXTERNALSYM PageSetupDlg}
  850. function PageSetupDlg(var PgSetupDialog: TPageSetupDlg): BOOL; stdcall;
  851.  
  852. const
  853.   {$EXTERNALSYM PSD_DEFAULTMINMARGINS}
  854.   PSD_DEFAULTMINMARGINS             = $00000000; { default (printer's) }
  855.   {$EXTERNALSYM PSD_INWININIINTLMEASURE}
  856.   PSD_INWININIINTLMEASURE           = $00000000; { 1st of 4 possible }
  857.  
  858.   {$EXTERNALSYM PSD_MINMARGINS}
  859.   PSD_MINMARGINS                    = $00000001; { use caller's }
  860.   {$EXTERNALSYM PSD_MARGINS}
  861.   PSD_MARGINS                       = $00000002; { use caller's }
  862.   {$EXTERNALSYM PSD_INTHOUSANDTHSOFINCHES}
  863.   PSD_INTHOUSANDTHSOFINCHES         = $00000004; { 2nd of 4 possible }
  864.   {$EXTERNALSYM PSD_INHUNDREDTHSOFMILLIMETERS}
  865.   PSD_INHUNDREDTHSOFMILLIMETERS     = $00000008; { 3rd of 4 possible }
  866.   {$EXTERNALSYM PSD_DISABLEMARGINS}
  867.   PSD_DISABLEMARGINS                = $00000010;
  868.   {$EXTERNALSYM PSD_DISABLEPRINTER}
  869.   PSD_DISABLEPRINTER                = $00000020;
  870.   {$EXTERNALSYM PSD_NOWARNING}
  871.   PSD_NOWARNING                     = $00000080; { must be same as PD_* }
  872.   {$EXTERNALSYM PSD_DISABLEORIENTATION}
  873.   PSD_DISABLEORIENTATION            = $00000100;
  874.   {$EXTERNALSYM PSD_RETURNDEFAULT}
  875.   PSD_RETURNDEFAULT                 = $00000400; { must be same as PD_* }
  876.   {$EXTERNALSYM PSD_DISABLEPAPER}
  877.   PSD_DISABLEPAPER                  = $00000200;
  878.   {$EXTERNALSYM PSD_SHOWHELP}
  879.   PSD_SHOWHELP                      = $00000800; { must be same as PD_* }
  880.   {$EXTERNALSYM PSD_ENABLEPAGESETUPHOOK}
  881.   PSD_ENABLEPAGESETUPHOOK           = $00002000; { must be same as PD_* }
  882.   {$EXTERNALSYM PSD_ENABLEPAGESETUPTEMPLATE}
  883.   PSD_ENABLEPAGESETUPTEMPLATE       = $00008000; { must be same as PD_* }
  884.   {$EXTERNALSYM PSD_ENABLEPAGESETUPTEMPLATEHANDLE}
  885.   PSD_ENABLEPAGESETUPTEMPLATEHANDLE = $00020000; { must be same as PD_* }
  886.   {$EXTERNALSYM PSD_ENABLEPAGEPAINTHOOK}
  887.   PSD_ENABLEPAGEPAINTHOOK           = $00040000;
  888.   {$EXTERNALSYM PSD_DISABLEPAGEPAINTING}
  889.   PSD_DISABLEPAGEPAINTING           = $00080000;
  890.   {$EXTERNALSYM PSD_NONETWORKBUTTON}
  891.   PSD_NONETWORKBUTTON               = $00200000; { must be same as PD_* }
  892.  
  893.  
  894. { Common dialog error return codes }
  895.  
  896. const
  897.   {$EXTERNALSYM CDERR_DIALOGFAILURE}
  898.   CDERR_DIALOGFAILURE    = $FFFF;
  899.  
  900.   {$EXTERNALSYM CDERR_GENERALCODES}
  901.   CDERR_GENERALCODES     = $0000;
  902.   {$EXTERNALSYM CDERR_STRUCTSIZE}
  903.   CDERR_STRUCTSIZE       = $0001;
  904.   {$EXTERNALSYM CDERR_INITIALIZATION}
  905.   CDERR_INITIALIZATION   = $0002;
  906.   {$EXTERNALSYM CDERR_NOTEMPLATE}
  907.   CDERR_NOTEMPLATE       = $0003;
  908.   {$EXTERNALSYM CDERR_NOHINSTANCE}
  909.   CDERR_NOHINSTANCE      = $0004;
  910.   {$EXTERNALSYM CDERR_LOADSTRFAILURE}
  911.   CDERR_LOADSTRFAILURE   = $0005;
  912.   {$EXTERNALSYM CDERR_FINDRESFAILURE}
  913.   CDERR_FINDRESFAILURE   = $0006;
  914.   {$EXTERNALSYM CDERR_LOADRESFAILURE}
  915.   CDERR_LOADRESFAILURE   = $0007;
  916.   {$EXTERNALSYM CDERR_LOCKRESFAILURE}
  917.   CDERR_LOCKRESFAILURE   = $0008;
  918.   {$EXTERNALSYM CDERR_MEMALLOCFAILURE}
  919.   CDERR_MEMALLOCFAILURE  = $0009;
  920.   {$EXTERNALSYM CDERR_MEMLOCKFAILURE}
  921.   CDERR_MEMLOCKFAILURE   = $000A;
  922.   {$EXTERNALSYM CDERR_NOHOOK}
  923.   CDERR_NOHOOK           = $000B;
  924.   {$EXTERNALSYM CDERR_REGISTERMSGFAIL}
  925.   CDERR_REGISTERMSGFAIL  = $000C;
  926.  
  927.   {$EXTERNALSYM PDERR_PRINTERCODES}
  928.   PDERR_PRINTERCODES     = $1000;
  929.   {$EXTERNALSYM PDERR_SETUPFAILURE}
  930.   PDERR_SETUPFAILURE     = $1001;
  931.   {$EXTERNALSYM PDERR_PARSEFAILURE}
  932.   PDERR_PARSEFAILURE     = $1002;
  933.   {$EXTERNALSYM PDERR_RETDEFFAILURE}
  934.   PDERR_RETDEFFAILURE    = $1003;
  935.   {$EXTERNALSYM PDERR_LOADDRVFAILURE}
  936.   PDERR_LOADDRVFAILURE   = $1004;
  937.   {$EXTERNALSYM PDERR_GETDEVMODEFAIL}
  938.   PDERR_GETDEVMODEFAIL   = $1005;
  939.   {$EXTERNALSYM PDERR_INITFAILURE}
  940.   PDERR_INITFAILURE      = $1006;
  941.   {$EXTERNALSYM PDERR_NODEVICES}
  942.   PDERR_NODEVICES        = $1007;
  943.   {$EXTERNALSYM PDERR_NODEFAULTPRN}
  944.   PDERR_NODEFAULTPRN     = $1008;
  945.   {$EXTERNALSYM PDERR_DNDMMISMATCH}
  946.   PDERR_DNDMMISMATCH     = $1009;
  947.   {$EXTERNALSYM PDERR_CREATEICFAILURE}
  948.   PDERR_CREATEICFAILURE  = $100A;
  949.   {$EXTERNALSYM PDERR_PRINTERNOTFOUND}
  950.   PDERR_PRINTERNOTFOUND  = $100B;
  951.   {$EXTERNALSYM PDERR_DEFAULTDIFFERENT}
  952.   PDERR_DEFAULTDIFFERENT = $100C;
  953.  
  954.   {$EXTERNALSYM CFERR_CHOOSEFONTCODES}
  955.   CFERR_CHOOSEFONTCODES  = $2000;
  956.   {$EXTERNALSYM CFERR_NOFONTS}
  957.   CFERR_NOFONTS          = $2001;
  958.   {$EXTERNALSYM CFERR_MAXLESSTHANMIN}
  959.   CFERR_MAXLESSTHANMIN   = $2002;
  960.  
  961.   {$EXTERNALSYM FNERR_FILENAMECODES}
  962.   FNERR_FILENAMECODES    = $3000;
  963.   {$EXTERNALSYM FNERR_SUBCLASSFAILURE}
  964.   FNERR_SUBCLASSFAILURE  = $3001;
  965.   {$EXTERNALSYM FNERR_INVALIDFILENAME}
  966.   FNERR_INVALIDFILENAME  = $3002;
  967.   {$EXTERNALSYM FNERR_BUFFERTOOSMALL}
  968.   FNERR_BUFFERTOOSMALL   = $3003;
  969.  
  970.   {$EXTERNALSYM FRERR_FINDREPLACECODES}
  971.   FRERR_FINDREPLACECODES = $4000;
  972.   {$EXTERNALSYM FRERR_BUFFERLENGTHZERO}
  973.   FRERR_BUFFERLENGTHZERO = $4001;
  974.  
  975.   {$EXTERNALSYM CCERR_CHOOSECOLORCODES}
  976.   CCERR_CHOOSECOLORCODES = $5000;
  977.  
  978. implementation
  979.  
  980. function GetOpenFileNameA;      external 'comdlg32.dll'  name 'GetOpenFileNameA';
  981. function GetOpenFileNameW;      external 'comdlg32.dll'  name 'GetOpenFileNameW';
  982. function GetOpenFileName;      external 'comdlg32.dll'  name 'GetOpenFileNameA';
  983. function GetSaveFileNameA;   external 'comdlg32.dll'  name 'GetSaveFileNameA';
  984. function GetSaveFileNameW;   external 'comdlg32.dll'  name 'GetSaveFileNameW';
  985. function GetSaveFileName;   external 'comdlg32.dll'  name 'GetSaveFileNameA';
  986. function GetFileTitleA;      external 'comdlg32.dll'  name 'GetFileTitleA';
  987. function GetFileTitleW;      external 'comdlg32.dll'  name 'GetFileTitleW';
  988. function GetFileTitle;      external 'comdlg32.dll'  name 'GetFileTitleA';
  989. function ChooseColorA;       external 'comdlg32.dll'  name 'ChooseColorA';
  990. function ChooseColorW;       external 'comdlg32.dll'  name 'ChooseColorW';
  991. function ChooseColor;       external 'comdlg32.dll'  name 'ChooseColorA';
  992. function FindTextA;          external 'comdlg32.dll'  name 'FindTextA';
  993. function FindTextW;          external 'comdlg32.dll'  name 'FindTextW';
  994. function FindText;          external 'comdlg32.dll'  name 'FindTextA';
  995. function ReplaceTextA;       external 'comdlg32.dll'  name 'ReplaceTextA';
  996. function ReplaceTextW;       external 'comdlg32.dll'  name 'ReplaceTextW';
  997. function ReplaceText;       external 'comdlg32.dll'  name 'ReplaceTextA';
  998. function ChooseFontA;        external 'comdlg32.dll'  name 'ChooseFontA';
  999. function ChooseFontW;        external 'comdlg32.dll'  name 'ChooseFontW';
  1000. function ChooseFont;        external 'comdlg32.dll'  name 'ChooseFontA';
  1001. function PrintDlgA;          external 'comdlg32.dll'  name 'PrintDlgA';
  1002. function PrintDlgW;          external 'comdlg32.dll'  name 'PrintDlgW';
  1003. function PrintDlg;          external 'comdlg32.dll'  name 'PrintDlgA';
  1004. function CommDlgExtendedError; external 'comdlg32.dll'  name 'CommDlgExtendedError';
  1005. function PageSetupDlgA;      external 'comdlg32.dll'  name 'PageSetupDlgA';
  1006. function PageSetupDlgW;      external 'comdlg32.dll'  name 'PageSetupDlgW';
  1007. function PageSetupDlg;      external 'comdlg32.dll'  name 'PageSetupDlgA';
  1008.  
  1009. end.
  1010.  
  1011.