Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _INC_COMMDLG
      7 #define _INC_COMMDLG
      8 
      9 #include <_mingw_unicode.h>
     10 
     11 #ifdef DEFINE_GUID
     12 DEFINE_GUID(IID_IPrintDialogCallback,0x5852a2c3,0x6530,0x11d1,0xb6,0xa3,0x0,0x0,0xf8,0x75,0x7b,0xf9);
     13 DEFINE_GUID(IID_IPrintDialogServices,0x509aaeda,0x5639,0x11d1,0xb6,0xa1,0x0,0x0,0xf8,0x75,0x7b,0xf9);
     14 #endif
     15 
     16 #ifndef GUID_DEFS_ONLY
     17 #include <prsht.h>
     18 #if !defined(_WIN64)
     19 #include <pshpack1.h>
     20 #endif
     21 
     22 #ifdef __cplusplus
     23 extern "C" {
     24 #endif
     25 
     26 #ifndef WINCOMMDLGAPI
     27 #ifndef _COMDLG32_
     28 #define WINCOMMDLGAPI DECLSPEC_IMPORT
     29 #else
     30 #define WINCOMMDLGAPI
     31 #endif
     32 #endif
     33 
     34 #ifndef SNDMSG
     35 #ifdef __cplusplus
     36 #define SNDMSG ::SendMessage
     37 #else
     38 #define SNDMSG SendMessage
     39 #endif
     40 #endif
     41 
     42   typedef UINT_PTR (CALLBACK *LPOFNHOOKPROC) (HWND,UINT,WPARAM,LPARAM);
     43 
     44 #ifndef CDSIZEOF_STRUCT
     45 #define CDSIZEOF_STRUCT(structname,member) (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
     46 #endif
     47 
     48   typedef struct tagOFN_NT4A {
     49     DWORD lStructSize;
     50     HWND hwndOwner;
     51     HINSTANCE hInstance;
     52     LPCSTR lpstrFilter;
     53     LPSTR lpstrCustomFilter;
     54     DWORD nMaxCustFilter;
     55     DWORD nFilterIndex;
     56     LPSTR lpstrFile;
     57     DWORD nMaxFile;
     58     LPSTR lpstrFileTitle;
     59     DWORD nMaxFileTitle;
     60     LPCSTR lpstrInitialDir;
     61     LPCSTR lpstrTitle;
     62     DWORD Flags;
     63     WORD nFileOffset;
     64     WORD nFileExtension;
     65     LPCSTR lpstrDefExt;
     66     LPARAM lCustData;
     67     LPOFNHOOKPROC lpfnHook;
     68     LPCSTR lpTemplateName;
     69   } OPENFILENAME_NT4A,*LPOPENFILENAME_NT4A;
     70   typedef struct tagOFN_NT4W {
     71     DWORD lStructSize;
     72     HWND hwndOwner;
     73     HINSTANCE hInstance;
     74     LPCWSTR lpstrFilter;
     75     LPWSTR lpstrCustomFilter;
     76     DWORD nMaxCustFilter;
     77     DWORD nFilterIndex;
     78     LPWSTR lpstrFile;
     79     DWORD nMaxFile;
     80     LPWSTR lpstrFileTitle;
     81     DWORD nMaxFileTitle;
     82     LPCWSTR lpstrInitialDir;
     83     LPCWSTR lpstrTitle;
     84     DWORD Flags;
     85     WORD nFileOffset;
     86     WORD nFileExtension;
     87     LPCWSTR lpstrDefExt;
     88     LPARAM lCustData;
     89     LPOFNHOOKPROC lpfnHook;
     90     LPCWSTR lpTemplateName;
     91   } OPENFILENAME_NT4W,*LPOPENFILENAME_NT4W;
     92 
     93   __MINGW_TYPEDEF_AW(OPENFILENAME_NT4)
     94   __MINGW_TYPEDEF_AW(LPOPENFILENAME_NT4)
     95 
     96   typedef struct tagOFNA {
     97     DWORD lStructSize;
     98     HWND hwndOwner;
     99     HINSTANCE hInstance;
    100     LPCSTR lpstrFilter;
    101     LPSTR lpstrCustomFilter;
    102     DWORD nMaxCustFilter;
    103     DWORD nFilterIndex;
    104     LPSTR lpstrFile;
    105     DWORD nMaxFile;
    106     LPSTR lpstrFileTitle;
    107     DWORD nMaxFileTitle;
    108     LPCSTR lpstrInitialDir;
    109     LPCSTR lpstrTitle;
    110     DWORD Flags;
    111     WORD nFileOffset;
    112     WORD nFileExtension;
    113     LPCSTR lpstrDefExt;
    114     LPARAM lCustData;
    115     LPOFNHOOKPROC lpfnHook;
    116     LPCSTR lpTemplateName;
    117     void *pvReserved;
    118     DWORD dwReserved;
    119     DWORD FlagsEx;
    120   } OPENFILENAMEA,*LPOPENFILENAMEA;
    121   typedef struct tagOFNW {
    122     DWORD lStructSize;
    123     HWND hwndOwner;
    124     HINSTANCE hInstance;
    125     LPCWSTR lpstrFilter;
    126     LPWSTR lpstrCustomFilter;
    127     DWORD nMaxCustFilter;
    128     DWORD nFilterIndex;
    129     LPWSTR lpstrFile;
    130     DWORD nMaxFile;
    131     LPWSTR lpstrFileTitle;
    132     DWORD nMaxFileTitle;
    133     LPCWSTR lpstrInitialDir;
    134     LPCWSTR lpstrTitle;
    135     DWORD Flags;
    136     WORD nFileOffset;
    137     WORD nFileExtension;
    138     LPCWSTR lpstrDefExt;
    139     LPARAM lCustData;
    140     LPOFNHOOKPROC lpfnHook;
    141     LPCWSTR lpTemplateName;
    142     void *pvReserved;
    143     DWORD dwReserved;
    144     DWORD FlagsEx;
    145   } OPENFILENAMEW,*LPOPENFILENAMEW;
    146 
    147   __MINGW_TYPEDEF_AW(OPENFILENAME)
    148   __MINGW_TYPEDEF_AW(LPOPENFILENAME)
    149 
    150 #define OPENFILENAME_SIZE_VERSION_400A CDSIZEOF_STRUCT(OPENFILENAMEA,lpTemplateName)
    151 #define OPENFILENAME_SIZE_VERSION_400W CDSIZEOF_STRUCT(OPENFILENAMEW,lpTemplateName)
    152 
    153 #define OPENFILENAME_SIZE_VERSION_400 __MINGW_NAME_AW(OPENFILENAME_SIZE_VERSION_400)
    154 
    155   WINCOMMDLGAPI WINBOOL WINAPI GetOpenFileNameA(LPOPENFILENAMEA);
    156   WINCOMMDLGAPI WINBOOL WINAPI GetOpenFileNameW(LPOPENFILENAMEW);
    157 
    158 #define GetOpenFileName __MINGW_NAME_AW(GetOpenFileName)
    159 
    160   WINCOMMDLGAPI WINBOOL WINAPI GetSaveFileNameA(LPOPENFILENAMEA);
    161   WINCOMMDLGAPI WINBOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW);
    162 
    163 #define GetSaveFileName __MINGW_NAME_AW(GetSaveFileName)
    164 
    165   WINCOMMDLGAPI short WINAPI GetFileTitleA(LPCSTR,LPSTR,WORD);
    166   WINCOMMDLGAPI short WINAPI GetFileTitleW(LPCWSTR,LPWSTR,WORD);
    167 
    168 #define GetFileTitle __MINGW_NAME_AW(GetFileTitle)
    169 
    170 #define OFN_READONLY 0x1
    171 #define OFN_OVERWRITEPROMPT 0x2
    172 #define OFN_HIDEREADONLY 0x4
    173 #define OFN_NOCHANGEDIR 0x8
    174 #define OFN_SHOWHELP 0x10
    175 #define OFN_ENABLEHOOK 0x20
    176 #define OFN_ENABLETEMPLATE 0x40
    177 #define OFN_ENABLETEMPLATEHANDLE 0x80
    178 #define OFN_NOVALIDATE 0x100
    179 #define OFN_ALLOWMULTISELECT 0x200
    180 #define OFN_EXTENSIONDIFFERENT 0x400
    181 #define OFN_PATHMUSTEXIST 0x800
    182 #define OFN_FILEMUSTEXIST 0x1000
    183 #define OFN_CREATEPROMPT 0x2000
    184 #define OFN_SHAREAWARE 0x4000
    185 #define OFN_NOREADONLYRETURN 0x8000
    186 #define OFN_NOTESTFILECREATE 0x10000
    187 #define OFN_NONETWORKBUTTON 0x20000
    188 #define OFN_NOLONGNAMES 0x40000
    189 #define OFN_EXPLORER 0x80000
    190 #define OFN_NODEREFERENCELINKS 0x100000
    191 #define OFN_LONGNAMES 0x200000
    192 #define OFN_ENABLEINCLUDENOTIFY 0x400000
    193 #define OFN_ENABLESIZING 0x800000
    194 #define OFN_DONTADDTORECENT 0x2000000
    195 #define OFN_FORCESHOWHIDDEN 0x10000000
    196 #define OFN_EX_NOPLACESBAR 0x1
    197 #define OFN_SHAREFALLTHROUGH 2
    198 #define OFN_SHARENOWARN 1
    199 #define OFN_SHAREWARN 0
    200 
    201   typedef UINT_PTR (CALLBACK *LPCCHOOKPROC) (HWND,UINT,WPARAM,LPARAM);
    202 
    203   typedef struct _OFNOTIFYA {
    204     NMHDR hdr;
    205     LPOPENFILENAMEA lpOFN;
    206     LPSTR pszFile;
    207   } OFNOTIFYA,*LPOFNOTIFYA;
    208 
    209   typedef struct _OFNOTIFYW {
    210     NMHDR hdr;
    211     LPOPENFILENAMEW lpOFN;
    212     LPWSTR pszFile;
    213   } OFNOTIFYW,*LPOFNOTIFYW;
    214 
    215   __MINGW_TYPEDEF_AW(OFNOTIFY)
    216   __MINGW_TYPEDEF_AW(LPOFNOTIFY)
    217 
    218   typedef struct _OFNOTIFYEXA {
    219     NMHDR hdr;
    220     LPOPENFILENAMEA lpOFN;
    221     LPVOID psf;
    222     LPVOID pidl;
    223   } OFNOTIFYEXA,*LPOFNOTIFYEXA;
    224 
    225   typedef struct _OFNOTIFYEXW {
    226     NMHDR hdr;
    227     LPOPENFILENAMEW lpOFN;
    228     LPVOID psf;
    229     LPVOID pidl;
    230   } OFNOTIFYEXW,*LPOFNOTIFYEXW;
    231 
    232   __MINGW_TYPEDEF_AW(OFNOTIFYEX)
    233   __MINGW_TYPEDEF_AW(LPOFNOTIFYEX)
    234 
    235 #define CDN_FIRST (0U-601U)
    236 #define CDN_LAST (0U-699U)
    237 
    238 #define CDN_INITDONE (CDN_FIRST)
    239 #define CDN_SELCHANGE (CDN_FIRST - 1)
    240 #define CDN_FOLDERCHANGE (CDN_FIRST - 2)
    241 #define CDN_SHAREVIOLATION (CDN_FIRST - 3)
    242 #define CDN_HELP (CDN_FIRST - 4)
    243 #define CDN_FILEOK (CDN_FIRST - 5)
    244 #define CDN_TYPECHANGE (CDN_FIRST - 6)
    245 #define CDN_INCLUDEITEM (CDN_FIRST - 7)
    246 
    247 #define CDM_FIRST (WM_USER + 100)
    248 #define CDM_LAST (WM_USER + 200)
    249 
    250 #define CDM_GETSPEC (CDM_FIRST)
    251 #define CommDlg_OpenSave_GetSpecA(_hdlg,_psz,_cbmax) (int)SNDMSG(_hdlg,CDM_GETSPEC,(WPARAM)_cbmax,(LPARAM)(LPSTR)_psz)
    252 #define CommDlg_OpenSave_GetSpecW(_hdlg,_psz,_cbmax) (int)SNDMSG(_hdlg,CDM_GETSPEC,(WPARAM)_cbmax,(LPARAM)(LPWSTR)_psz)
    253 
    254 #define CommDlg_OpenSave_GetSpec __MINGW_NAME_AW(CommDlg_OpenSave_GetSpec)
    255 
    256 #define CDM_GETFILEPATH (CDM_FIRST + 1)
    257 #define CommDlg_OpenSave_GetFilePathA(_hdlg,_psz,_cbmax) (int)SNDMSG(_hdlg,CDM_GETFILEPATH,(WPARAM)_cbmax,(LPARAM)(LPSTR)_psz)
    258 #define CommDlg_OpenSave_GetFilePathW(_hdlg,_psz,_cbmax) (int)SNDMSG(_hdlg,CDM_GETFILEPATH,(WPARAM)_cbmax,(LPARAM)(LPWSTR)_psz)
    259 
    260 #define CommDlg_OpenSave_GetFilePath __MINGW_NAME_AW(CommDlg_OpenSave_GetFilePath)
    261 
    262 #define CDM_GETFOLDERPATH (CDM_FIRST + 2)
    263 #define CommDlg_OpenSave_GetFolderPathA(_hdlg,_psz,_cbmax) (int)SNDMSG(_hdlg,CDM_GETFOLDERPATH,(WPARAM)_cbmax,(LPARAM)(LPSTR)_psz)
    264 #define CommDlg_OpenSave_GetFolderPathW(_hdlg,_psz,_cbmax) (int)SNDMSG(_hdlg,CDM_GETFOLDERPATH,(WPARAM)_cbmax,(LPARAM)(LPWSTR)_psz)
    265 
    266 #define CommDlg_OpenSave_GetFolderPath __MINGW_NAME_AW(CommDlg_OpenSave_GetFolderPath)
    267 
    268 #define CDM_GETFOLDERIDLIST (CDM_FIRST + 3)
    269 #define CommDlg_OpenSave_GetFolderIDList(_hdlg,_pidl,_cbmax) (int)SNDMSG(_hdlg,CDM_GETFOLDERIDLIST,(WPARAM)_cbmax,(LPARAM)(LPVOID)_pidl)
    270 #define CDM_SETCONTROLTEXT (CDM_FIRST + 4)
    271 #define CommDlg_OpenSave_SetControlText(_hdlg,_id,_text) (void)SNDMSG(_hdlg,CDM_SETCONTROLTEXT,(WPARAM)_id,(LPARAM)(LPSTR)_text)
    272 #define CDM_HIDECONTROL (CDM_FIRST + 5)
    273 #define CommDlg_OpenSave_HideControl(_hdlg,_id) (void)SNDMSG(_hdlg,CDM_HIDECONTROL,(WPARAM)_id,0)
    274 #define CDM_SETDEFEXT (CDM_FIRST + 6)
    275 #define CommDlg_OpenSave_SetDefExt(_hdlg,_pszext) (void)SNDMSG(_hdlg,CDM_SETDEFEXT,0,(LPARAM)(LPSTR)_pszext)
    276 
    277   typedef struct tagCHOOSECOLORA {
    278     DWORD lStructSize;
    279     HWND hwndOwner;
    280     HWND hInstance;
    281     COLORREF rgbResult;
    282     COLORREF *lpCustColors;
    283     DWORD Flags;
    284     LPARAM lCustData;
    285     LPCCHOOKPROC lpfnHook;
    286     LPCSTR lpTemplateName;
    287   } CHOOSECOLORA,*LPCHOOSECOLORA;
    288   typedef struct tagCHOOSECOLORW {
    289     DWORD lStructSize;
    290     HWND hwndOwner;
    291     HWND hInstance;
    292     COLORREF rgbResult;
    293     COLORREF *lpCustColors;
    294     DWORD Flags;
    295     LPARAM lCustData;
    296     LPCCHOOKPROC lpfnHook;
    297     LPCWSTR lpTemplateName;
    298   } CHOOSECOLORW,*LPCHOOSECOLORW;
    299 
    300   __MINGW_TYPEDEF_AW(CHOOSECOLOR)
    301   __MINGW_TYPEDEF_AW(LPCHOOSECOLOR)
    302 
    303   WINCOMMDLGAPI WINBOOL WINAPI ChooseColorA(LPCHOOSECOLORA);
    304   WINCOMMDLGAPI WINBOOL WINAPI ChooseColorW(LPCHOOSECOLORW);
    305 
    306 #define ChooseColor __MINGW_NAME_AW(ChooseColor)
    307 
    308 #define CC_RGBINIT 0x1
    309 #define CC_FULLOPEN 0x2
    310 #define CC_PREVENTFULLOPEN 0x4
    311 #define CC_SHOWHELP 0x8
    312 #define CC_ENABLEHOOK 0x10
    313 #define CC_ENABLETEMPLATE 0x20
    314 #define CC_ENABLETEMPLATEHANDLE 0x40
    315 #define CC_SOLIDCOLOR 0x80
    316 #define CC_ANYCOLOR 0x100
    317 
    318   typedef UINT_PTR (CALLBACK *LPFRHOOKPROC) (HWND,UINT,WPARAM,LPARAM);
    319 
    320   typedef struct tagFINDREPLACEA {
    321     DWORD lStructSize;
    322     HWND hwndOwner;
    323     HINSTANCE hInstance;
    324     DWORD Flags;
    325     LPSTR lpstrFindWhat;
    326     LPSTR lpstrReplaceWith;
    327     WORD wFindWhatLen;
    328     WORD wReplaceWithLen;
    329     LPARAM lCustData;
    330     LPFRHOOKPROC lpfnHook;
    331     LPCSTR lpTemplateName;
    332   } FINDREPLACEA,*LPFINDREPLACEA;
    333 
    334   typedef struct tagFINDREPLACEW {
    335     DWORD lStructSize;
    336     HWND hwndOwner;
    337     HINSTANCE hInstance;
    338     DWORD Flags;
    339     LPWSTR lpstrFindWhat;
    340     LPWSTR lpstrReplaceWith;
    341     WORD wFindWhatLen;
    342     WORD wReplaceWithLen;
    343     LPARAM lCustData;
    344     LPFRHOOKPROC lpfnHook;
    345     LPCWSTR lpTemplateName;
    346   } FINDREPLACEW,*LPFINDREPLACEW;
    347 
    348   __MINGW_TYPEDEF_AW(FINDREPLACE)
    349   __MINGW_TYPEDEF_AW(LPFINDREPLACE)
    350 
    351 #define FR_DOWN 0x1
    352 #define FR_WHOLEWORD 0x2
    353 #define FR_MATCHCASE 0x4
    354 #define FR_FINDNEXT 0x8
    355 #define FR_REPLACE 0x10
    356 #define FR_REPLACEALL 0x20
    357 #define FR_DIALOGTERM 0x40
    358 #define FR_SHOWHELP 0x80
    359 #define FR_ENABLEHOOK 0x100
    360 #define FR_ENABLETEMPLATE 0x200
    361 #define FR_NOUPDOWN 0x400
    362 #define FR_NOMATCHCASE 0x800
    363 #define FR_NOWHOLEWORD 0x1000
    364 #define FR_ENABLETEMPLATEHANDLE 0x2000
    365 #define FR_HIDEUPDOWN 0x4000
    366 #define FR_HIDEMATCHCASE 0x8000
    367 #define FR_HIDEWHOLEWORD 0x10000
    368 #define FR_RAW 0x20000
    369 #define FR_MATCHDIAC 0x20000000
    370 #define FR_MATCHKASHIDA 0x40000000
    371 #define FR_MATCHALEFHAMZA 0x80000000
    372 
    373   WINCOMMDLGAPI HWND WINAPI FindTextA(LPFINDREPLACEA);
    374   WINCOMMDLGAPI HWND WINAPI FindTextW(LPFINDREPLACEW);
    375 
    376 #define FindText __MINGW_NAME_AW(FindText)
    377 
    378   WINCOMMDLGAPI HWND WINAPI ReplaceTextA(LPFINDREPLACEA);
    379   WINCOMMDLGAPI HWND WINAPI ReplaceTextW(LPFINDREPLACEW);
    380 
    381 #define ReplaceText __MINGW_NAME_AW(ReplaceText)
    382 
    383   typedef UINT_PTR (CALLBACK *LPCFHOOKPROC) (HWND,UINT,WPARAM,LPARAM);
    384 
    385   typedef struct tagCHOOSEFONTA {
    386     DWORD lStructSize;
    387     HWND hwndOwner;
    388     HDC hDC;
    389     LPLOGFONTA lpLogFont;
    390     INT iPointSize;
    391     DWORD Flags;
    392     COLORREF rgbColors;
    393     LPARAM lCustData;
    394     LPCFHOOKPROC lpfnHook;
    395     LPCSTR lpTemplateName;
    396     HINSTANCE hInstance;
    397     LPSTR lpszStyle;
    398     WORD nFontType;
    399     WORD ___MISSING_ALIGNMENT__;
    400     INT nSizeMin;
    401     INT nSizeMax;
    402   } CHOOSEFONTA,*LPCHOOSEFONTA;
    403 
    404   typedef struct tagCHOOSEFONTW {
    405     DWORD lStructSize;
    406     HWND hwndOwner;
    407     HDC hDC;
    408     LPLOGFONTW lpLogFont;
    409     INT iPointSize;
    410     DWORD Flags;
    411     COLORREF rgbColors;
    412     LPARAM lCustData;
    413     LPCFHOOKPROC lpfnHook;
    414     LPCWSTR lpTemplateName;
    415     HINSTANCE hInstance;
    416     LPWSTR lpszStyle;
    417     WORD nFontType;
    418     WORD ___MISSING_ALIGNMENT__;
    419     INT nSizeMin;
    420     INT nSizeMax;
    421   } CHOOSEFONTW,*LPCHOOSEFONTW;
    422 
    423   __MINGW_TYPEDEF_AW(CHOOSEFONT)
    424   __MINGW_TYPEDEF_AW(LPCHOOSEFONT)
    425 
    426   WINCOMMDLGAPI WINBOOL WINAPI ChooseFontA(LPCHOOSEFONTA);
    427   WINCOMMDLGAPI WINBOOL WINAPI ChooseFontW(LPCHOOSEFONTW);
    428 
    429 #define ChooseFont __MINGW_NAME_AW(ChooseFont)
    430 
    431 #define CF_SCREENFONTS 0x1
    432 #define CF_PRINTERFONTS 0x2
    433 #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
    434 #define CF_SHOWHELP __MSABI_LONG(0x4)
    435 #define CF_ENABLEHOOK __MSABI_LONG(0x8)
    436 #define CF_ENABLETEMPLATE __MSABI_LONG(0x10)
    437 #define CF_ENABLETEMPLATEHANDLE __MSABI_LONG(0x20)
    438 #define CF_INITTOLOGFONTSTRUCT __MSABI_LONG(0x40)
    439 #define CF_USESTYLE __MSABI_LONG(0x80)
    440 #define CF_EFFECTS __MSABI_LONG(0x100)
    441 #define CF_APPLY __MSABI_LONG(0x200)
    442 #define CF_ANSIONLY __MSABI_LONG(0x400)
    443 #define CF_SCRIPTSONLY CF_ANSIONLY
    444 #define CF_NOVECTORFONTS __MSABI_LONG(0x800)
    445 #define CF_NOOEMFONTS CF_NOVECTORFONTS
    446 #define CF_NOSIMULATIONS __MSABI_LONG(0x1000)
    447 #define CF_LIMITSIZE __MSABI_LONG(0x2000)
    448 #define CF_FIXEDPITCHONLY __MSABI_LONG(0x4000)
    449 #define CF_WYSIWYG __MSABI_LONG(0x8000)
    450 #define CF_FORCEFONTEXIST __MSABI_LONG(0x10000)
    451 #define CF_SCALABLEONLY __MSABI_LONG(0x20000)
    452 #define CF_TTONLY __MSABI_LONG(0x40000)
    453 #define CF_NOFACESEL __MSABI_LONG(0x80000)
    454 #define CF_NOSTYLESEL __MSABI_LONG(0x100000)
    455 #define CF_NOSIZESEL __MSABI_LONG(0x200000)
    456 #define CF_SELECTSCRIPT __MSABI_LONG(0x400000)
    457 #define CF_NOSCRIPTSEL __MSABI_LONG(0x800000)
    458 #define CF_NOVERTFONTS __MSABI_LONG(0x1000000)
    459 
    460 #define SIMULATED_FONTTYPE 0x8000
    461 #define PRINTER_FONTTYPE 0x4000
    462 #define SCREEN_FONTTYPE 0x2000
    463 #define BOLD_FONTTYPE 0x100
    464 #define ITALIC_FONTTYPE 0x200
    465 #define REGULAR_FONTTYPE 0x400
    466 
    467 #ifdef WINNT
    468 #define PS_OPENTYPE_FONTTYPE 0x10000
    469 #define TT_OPENTYPE_FONTTYPE 0x20000
    470 #define TYPE1_FONTTYPE 0x40000
    471 #endif
    472 
    473 #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
    474 #define WM_CHOOSEFONT_SETLOGFONT (WM_USER + 101)
    475 #define WM_CHOOSEFONT_SETFLAGS (WM_USER + 102)
    476 
    477 #define LBSELCHSTRINGA "commdlg_LBSelChangedNotify"
    478 #define SHAREVISTRINGA "commdlg_ShareViolation"
    479 #define FILEOKSTRINGA "commdlg_FileNameOK"
    480 #define COLOROKSTRINGA "commdlg_ColorOK"
    481 #define SETRGBSTRINGA "commdlg_SetRGBColor"
    482 #define HELPMSGSTRINGA "commdlg_help"
    483 #define FINDMSGSTRINGA "commdlg_FindReplace"
    484 
    485 #define LBSELCHSTRINGW L"commdlg_LBSelChangedNotify"
    486 #define SHAREVISTRINGW L"commdlg_ShareViolation"
    487 #define FILEOKSTRINGW L"commdlg_FileNameOK"
    488 #define COLOROKSTRINGW L"commdlg_ColorOK"
    489 #define SETRGBSTRINGW L"commdlg_SetRGBColor"
    490 #define HELPMSGSTRINGW L"commdlg_help"
    491 #define FINDMSGSTRINGW L"commdlg_FindReplace"
    492 
    493 #define LBSELCHSTRING __MINGW_NAME_AW(LBSELCHSTRING)
    494 #define SHAREVISTRING __MINGW_NAME_AW(SHAREVISTRING)
    495 #define FILEOKSTRING __MINGW_NAME_AW(FILEOKSTRING)
    496 #define COLOROKSTRING __MINGW_NAME_AW(COLOROKSTRING)
    497 #define SETRGBSTRING __MINGW_NAME_AW(SETRGBSTRING)
    498 #define HELPMSGSTRING __MINGW_NAME_AW(HELPMSGSTRING)
    499 #define FINDMSGSTRING __MINGW_NAME_AW(FINDMSGSTRING)
    500 
    501 #define CD_LBSELNOITEMS -1
    502 #define CD_LBSELCHANGE 0
    503 #define CD_LBSELSUB 1
    504 #define CD_LBSELADD 2
    505 
    506   typedef UINT_PTR (CALLBACK *LPPRINTHOOKPROC) (HWND,UINT,WPARAM,LPARAM);
    507   typedef UINT_PTR (CALLBACK *LPSETUPHOOKPROC) (HWND,UINT,WPARAM,LPARAM);
    508 
    509   typedef struct tagPDA {
    510     DWORD lStructSize;
    511     HWND hwndOwner;
    512     HGLOBAL hDevMode;
    513     HGLOBAL hDevNames;
    514     HDC hDC;
    515     DWORD Flags;
    516     WORD nFromPage;
    517     WORD nToPage;
    518     WORD nMinPage;
    519     WORD nMaxPage;
    520     WORD nCopies;
    521     HINSTANCE hInstance;
    522     LPARAM lCustData;
    523     LPPRINTHOOKPROC lpfnPrintHook;
    524     LPSETUPHOOKPROC lpfnSetupHook;
    525     LPCSTR lpPrintTemplateName;
    526     LPCSTR lpSetupTemplateName;
    527     HGLOBAL hPrintTemplate;
    528     HGLOBAL hSetupTemplate;
    529   } PRINTDLGA,*LPPRINTDLGA;
    530 
    531   typedef struct tagPDW {
    532     DWORD lStructSize;
    533     HWND hwndOwner;
    534     HGLOBAL hDevMode;
    535     HGLOBAL hDevNames;
    536     HDC hDC;
    537     DWORD Flags;
    538     WORD nFromPage;
    539     WORD nToPage;
    540     WORD nMinPage;
    541     WORD nMaxPage;
    542     WORD nCopies;
    543     HINSTANCE hInstance;
    544     LPARAM lCustData;
    545     LPPRINTHOOKPROC lpfnPrintHook;
    546     LPSETUPHOOKPROC lpfnSetupHook;
    547     LPCWSTR lpPrintTemplateName;
    548     LPCWSTR lpSetupTemplateName;
    549     HGLOBAL hPrintTemplate;
    550     HGLOBAL hSetupTemplate;
    551   } PRINTDLGW,*LPPRINTDLGW;
    552 
    553   __MINGW_TYPEDEF_AW(PRINTDLG)
    554   __MINGW_TYPEDEF_AW(LPPRINTDLG)
    555 
    556   WINCOMMDLGAPI WINBOOL WINAPI PrintDlgA(LPPRINTDLGA);
    557   WINCOMMDLGAPI WINBOOL WINAPI PrintDlgW(LPPRINTDLGW);
    558 
    559 #define PrintDlg __MINGW_NAME_AW(PrintDlg)
    560 
    561 #ifdef STDMETHOD
    562 #undef INTERFACE
    563 #define INTERFACE IPrintDialogCallback
    564 
    565   DECLARE_INTERFACE_(IPrintDialogCallback,IUnknown) {
    566     STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE;
    567     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
    568     STDMETHOD_(ULONG,Release) (THIS) PURE;
    569     STDMETHOD(InitDone) (THIS) PURE;
    570     STDMETHOD(SelectionChange) (THIS) PURE;
    571     STDMETHOD(HandleMessage) (THIS_ HWND hDlg,UINT uMsg,WPARAM wParam,LPARAM lParam,LRESULT *pResult) PURE;
    572   };
    573 
    574 #undef INTERFACE
    575 #define INTERFACE IPrintDialogServices
    576   DECLARE_INTERFACE_(IPrintDialogServices,IUnknown) {
    577     STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) PURE;
    578     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
    579     STDMETHOD_(ULONG,Release) (THIS) PURE;
    580     STDMETHOD(GetCurrentDevMode) (THIS_ LPDEVMODE pDevMode,UINT *pcbSize) PURE;
    581     STDMETHOD(GetCurrentPrinterName) (THIS_ LPTSTR pPrinterName,UINT *pcchSize) PURE;
    582     STDMETHOD(GetCurrentPortName) (THIS_ LPTSTR pPortName,UINT *pcchSize) PURE;
    583   };
    584 
    585   typedef struct tagPRINTPAGERANGE {
    586     DWORD nFromPage;
    587     DWORD nToPage;
    588   } PRINTPAGERANGE,*LPPRINTPAGERANGE;
    589 
    590   typedef struct tagPDEXA {
    591     DWORD lStructSize;
    592     HWND hwndOwner;
    593     HGLOBAL hDevMode;
    594     HGLOBAL hDevNames;
    595     HDC hDC;
    596     DWORD Flags;
    597     DWORD Flags2;
    598     DWORD ExclusionFlags;
    599     DWORD nPageRanges;
    600     DWORD nMaxPageRanges;
    601     LPPRINTPAGERANGE lpPageRanges;
    602     DWORD nMinPage;
    603     DWORD nMaxPage;
    604     DWORD nCopies;
    605     HINSTANCE hInstance;
    606     LPCSTR lpPrintTemplateName;
    607     LPUNKNOWN lpCallback;
    608     DWORD nPropertyPages;
    609     HPROPSHEETPAGE *lphPropertyPages;
    610     DWORD nStartPage;
    611     DWORD dwResultAction;
    612   } PRINTDLGEXA,*LPPRINTDLGEXA;
    613 
    614   typedef struct tagPDEXW {
    615     DWORD lStructSize;
    616     HWND hwndOwner;
    617     HGLOBAL hDevMode;
    618     HGLOBAL hDevNames;
    619     HDC hDC;
    620     DWORD Flags;
    621     DWORD Flags2;
    622     DWORD ExclusionFlags;
    623     DWORD nPageRanges;
    624     DWORD nMaxPageRanges;
    625     LPPRINTPAGERANGE lpPageRanges;
    626     DWORD nMinPage;
    627     DWORD nMaxPage;
    628     DWORD nCopies;
    629     HINSTANCE hInstance;
    630     LPCWSTR lpPrintTemplateName;
    631     LPUNKNOWN lpCallback;
    632     DWORD nPropertyPages;
    633     HPROPSHEETPAGE *lphPropertyPages;
    634     DWORD nStartPage;
    635     DWORD dwResultAction;
    636   } PRINTDLGEXW,*LPPRINTDLGEXW;
    637 
    638   __MINGW_TYPEDEF_AW(PRINTDLGEX)
    639   __MINGW_TYPEDEF_AW(LPPRINTDLGEX)
    640 
    641   WINCOMMDLGAPI HRESULT WINAPI PrintDlgExA(LPPRINTDLGEXA);
    642   WINCOMMDLGAPI HRESULT WINAPI PrintDlgExW(LPPRINTDLGEXW);
    643 
    644 #define PrintDlgEx __MINGW_NAME_AW(PrintDlgEx)
    645 #endif
    646 
    647 #define PD_ALLPAGES 0x0
    648 #define PD_SELECTION 0x1
    649 #define PD_PAGENUMS 0x2
    650 #define PD_NOSELECTION 0x4
    651 #define PD_NOPAGENUMS 0x8
    652 #define PD_COLLATE 0x10
    653 #define PD_PRINTTOFILE 0x20
    654 #define PD_PRINTSETUP 0x40
    655 #define PD_NOWARNING 0x80
    656 #define PD_RETURNDC 0x100
    657 #define PD_RETURNIC 0x200
    658 #define PD_RETURNDEFAULT 0x400
    659 #define PD_SHOWHELP 0x800
    660 #define PD_ENABLEPRINTHOOK 0x1000
    661 #define PD_ENABLESETUPHOOK 0x2000
    662 #define PD_ENABLEPRINTTEMPLATE 0x4000
    663 #define PD_ENABLESETUPTEMPLATE 0x8000
    664 #define PD_ENABLEPRINTTEMPLATEHANDLE 0x10000
    665 #define PD_ENABLESETUPTEMPLATEHANDLE 0x20000
    666 #define PD_USEDEVMODECOPIES 0x40000
    667 #define PD_USEDEVMODECOPIESANDCOLLATE 0x40000
    668 #define PD_DISABLEPRINTTOFILE 0x80000
    669 #define PD_HIDEPRINTTOFILE 0x100000
    670 #define PD_NONETWORKBUTTON 0x200000
    671 #define PD_CURRENTPAGE 0x400000
    672 #define PD_NOCURRENTPAGE 0x800000
    673 #define PD_EXCLUSIONFLAGS 0x1000000
    674 #define PD_USELARGETEMPLATE 0x10000000
    675 
    676 #define PD_EXCL_COPIESANDCOLLATE (DM_COPIES | DM_COLLATE)
    677 #define START_PAGE_GENERAL 0xffffffff
    678 
    679 #define PD_RESULT_CANCEL 0
    680 #define PD_RESULT_PRINT 1
    681 #define PD_RESULT_APPLY 2
    682 
    683   typedef struct tagDEVNAMES {
    684     WORD wDriverOffset;
    685     WORD wDeviceOffset;
    686     WORD wOutputOffset;
    687     WORD wDefault;
    688   } DEVNAMES,*LPDEVNAMES;
    689 
    690 #define DN_DEFAULTPRN 0x1
    691 
    692   WINCOMMDLGAPI DWORD WINAPI CommDlgExtendedError(VOID);
    693 
    694 #define WM_PSD_PAGESETUPDLG (WM_USER)
    695 #define WM_PSD_FULLPAGERECT (WM_USER+1)
    696 #define WM_PSD_MINMARGINRECT (WM_USER+2)
    697 #define WM_PSD_MARGINRECT (WM_USER+3)
    698 #define WM_PSD_GREEKTEXTRECT (WM_USER+4)
    699 #define WM_PSD_ENVSTAMPRECT (WM_USER+5)
    700 #define WM_PSD_YAFULLPAGERECT (WM_USER+6)
    701 
    702   typedef UINT_PTR (CALLBACK *LPPAGEPAINTHOOK)(HWND,UINT,WPARAM,LPARAM);
    703   typedef UINT_PTR (CALLBACK *LPPAGESETUPHOOK)(HWND,UINT,WPARAM,LPARAM);
    704 
    705   typedef struct tagPSDA {
    706     DWORD lStructSize;
    707     HWND hwndOwner;
    708     HGLOBAL hDevMode;
    709     HGLOBAL hDevNames;
    710     DWORD Flags;
    711     POINT ptPaperSize;
    712     RECT rtMinMargin;
    713     RECT rtMargin;
    714     HINSTANCE hInstance;
    715     LPARAM lCustData;
    716     LPPAGESETUPHOOK lpfnPageSetupHook;
    717     LPPAGEPAINTHOOK lpfnPagePaintHook;
    718     LPCSTR lpPageSetupTemplateName;
    719     HGLOBAL hPageSetupTemplate;
    720   } PAGESETUPDLGA,*LPPAGESETUPDLGA;
    721 
    722   typedef struct tagPSDW {
    723     DWORD lStructSize;
    724     HWND hwndOwner;
    725     HGLOBAL hDevMode;
    726     HGLOBAL hDevNames;
    727     DWORD Flags;
    728     POINT ptPaperSize;
    729     RECT rtMinMargin;
    730     RECT rtMargin;
    731     HINSTANCE hInstance;
    732     LPARAM lCustData;
    733     LPPAGESETUPHOOK lpfnPageSetupHook;
    734     LPPAGEPAINTHOOK lpfnPagePaintHook;
    735     LPCWSTR lpPageSetupTemplateName;
    736     HGLOBAL hPageSetupTemplate;
    737   } PAGESETUPDLGW,*LPPAGESETUPDLGW;
    738 
    739   __MINGW_TYPEDEF_AW(PAGESETUPDLG)
    740   __MINGW_TYPEDEF_AW(LPPAGESETUPDLG)
    741 
    742   WINCOMMDLGAPI WINBOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA);
    743   WINCOMMDLGAPI WINBOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW);
    744 
    745 #define PageSetupDlg __MINGW_NAME_AW(PageSetupDlg)
    746 
    747 #define PSD_DEFAULTMINMARGINS 0x0
    748 #define PSD_INWININIINTLMEASURE 0x0
    749 #define PSD_MINMARGINS 0x1
    750 #define PSD_MARGINS 0x2
    751 #define PSD_INTHOUSANDTHSOFINCHES 0x4
    752 #define PSD_INHUNDREDTHSOFMILLIMETERS 0x8
    753 #define PSD_DISABLEMARGINS 0x10
    754 #define PSD_DISABLEPRINTER 0x20
    755 #define PSD_NOWARNING 0x80
    756 #define PSD_DISABLEORIENTATION 0x100
    757 #define PSD_RETURNDEFAULT 0x400
    758 #define PSD_DISABLEPAPER 0x200
    759 #define PSD_SHOWHELP 0x800
    760 #define PSD_ENABLEPAGESETUPHOOK 0x2000
    761 #define PSD_ENABLEPAGESETUPTEMPLATE 0x8000
    762 #define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x20000
    763 #define PSD_ENABLEPAGEPAINTHOOK 0x40000
    764 #define PSD_DISABLEPAGEPAINTING 0x80000
    765 #define PSD_NONETWORKBUTTON 0x200000
    766 
    767 #ifdef __cplusplus
    768 }
    769 #endif
    770 
    771 #ifndef _WIN64
    772 #include <poppack.h>
    773 #endif
    774 #endif
    775 #endif
    776