"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.05.0-linux-x86_64/include/freebasic/win/commdlg.bi" (31 Jan 2016, 39488 Bytes) of package /linux/privat/FreeBASIC-1.05.0-linux-x86_64.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' FreeBASIC binding for mingw-w64-v4.0.4
    2 ''
    3 '' based on the C header files:
    4 ''   This Software is provided under the Zope Public License (ZPL) Version 2.1.
    5 ''
    6 ''   Copyright (c) 2009, 2010 by the mingw-w64 project
    7 ''
    8 ''   See the AUTHORS file for the list of contributors to the mingw-w64 project.
    9 ''
   10 ''   This license has been certified as open source. It has also been designated
   11 ''   as GPL compatible by the Free Software Foundation (FSF).
   12 ''
   13 ''   Redistribution and use in source and binary forms, with or without
   14 ''   modification, are permitted provided that the following conditions are met:
   15 ''
   16 ''     1. Redistributions in source code must retain the accompanying copyright
   17 ''        notice, this list of conditions, and the following disclaimer.
   18 ''     2. Redistributions in binary form must reproduce the accompanying
   19 ''        copyright notice, this list of conditions, and the following disclaimer
   20 ''        in the documentation and/or other materials provided with the
   21 ''        distribution.
   22 ''     3. Names of the copyright holders must not be used to endorse or promote
   23 ''        products derived from this software without prior written permission
   24 ''        from the copyright holders.
   25 ''     4. The right to distribute this software or to use it for any purpose does
   26 ''        not give you the right to use Servicemarks (sm) or Trademarks (tm) of
   27 ''        the copyright holders.  Use of them is covered by separate agreement
   28 ''        with the copyright holders.
   29 ''     5. If any files are modified, you must cause the modified files to carry
   30 ''        prominent notices stating that you changed the files and the date of
   31 ''        any change.
   32 ''
   33 ''   Disclaimer
   34 ''
   35 ''   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
   36 ''   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   37 ''   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
   38 ''   EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
   39 ''   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   40 ''   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
   41 ''   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   42 ''   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   43 ''   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
   44 ''   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   45 ''
   46 '' translated to FreeBASIC by:
   47 ''   Copyright © 2015 FreeBASIC development team
   48 
   49 #pragma once
   50 
   51 #inclib "comdlg32"
   52 
   53 #include once "winapifamily.bi"
   54 #include once "_mingw_unicode.bi"
   55 #include once "prsht.bi"
   56 #include once "rpc.bi"
   57 #include once "rpcndr.bi"
   58 #include once "wtypesbase.bi"
   59 #include once "unknwnbase.bi"
   60 #include once "objidlbase.bi"
   61 
   62 extern "Windows"
   63 
   64 #define _INC_COMMDLG
   65 extern IID_IPrintDialogCallback as const GUID
   66 extern IID_IPrintDialogServices as const GUID
   67 type LPOFNHOOKPROC as function(byval as HWND, byval as UINT, byval as WPARAM, byval as LPARAM) as UINT_PTR
   68 #define CDSIZEOF_STRUCT(structname, member) (clng(cast(LPBYTE, @cptr(structname ptr, 0)->member) - cast(LPBYTE, cptr(structname ptr, 0))) + sizeof(cptr(structname ptr, 0)->member))
   69 
   70 #ifdef __FB_64BIT__
   71     type tagOFN_NT4A
   72         lStructSize as DWORD
   73         hwndOwner as HWND
   74         hInstance as HINSTANCE
   75         lpstrFilter as LPCSTR
   76         lpstrCustomFilter as LPSTR
   77         nMaxCustFilter as DWORD
   78         nFilterIndex as DWORD
   79         lpstrFile as LPSTR
   80         nMaxFile as DWORD
   81         lpstrFileTitle as LPSTR
   82         nMaxFileTitle as DWORD
   83         lpstrInitialDir as LPCSTR
   84         lpstrTitle as LPCSTR
   85         Flags as DWORD
   86         nFileOffset as WORD
   87         nFileExtension as WORD
   88         lpstrDefExt as LPCSTR
   89         lCustData as LPARAM
   90         lpfnHook as LPOFNHOOKPROC
   91         lpTemplateName as LPCSTR
   92     end type
   93 #else
   94     type tagOFN_NT4A field = 1
   95         lStructSize as DWORD
   96         hwndOwner as HWND
   97         hInstance as HINSTANCE
   98         lpstrFilter as LPCSTR
   99         lpstrCustomFilter as LPSTR
  100         nMaxCustFilter as DWORD
  101         nFilterIndex as DWORD
  102         lpstrFile as LPSTR
  103         nMaxFile as DWORD
  104         lpstrFileTitle as LPSTR
  105         nMaxFileTitle as DWORD
  106         lpstrInitialDir as LPCSTR
  107         lpstrTitle as LPCSTR
  108         Flags as DWORD
  109         nFileOffset as WORD
  110         nFileExtension as WORD
  111         lpstrDefExt as LPCSTR
  112         lCustData as LPARAM
  113         lpfnHook as LPOFNHOOKPROC
  114         lpTemplateName as LPCSTR
  115     end type
  116 #endif
  117 
  118 type OPENFILENAME_NT4A as tagOFN_NT4A
  119 type LPOPENFILENAME_NT4A as tagOFN_NT4A ptr
  120 
  121 #ifdef __FB_64BIT__
  122     type tagOFN_NT4W
  123         lStructSize as DWORD
  124         hwndOwner as HWND
  125         hInstance as HINSTANCE
  126         lpstrFilter as LPCWSTR
  127         lpstrCustomFilter as LPWSTR
  128         nMaxCustFilter as DWORD
  129         nFilterIndex as DWORD
  130         lpstrFile as LPWSTR
  131         nMaxFile as DWORD
  132         lpstrFileTitle as LPWSTR
  133         nMaxFileTitle as DWORD
  134         lpstrInitialDir as LPCWSTR
  135         lpstrTitle as LPCWSTR
  136         Flags as DWORD
  137         nFileOffset as WORD
  138         nFileExtension as WORD
  139         lpstrDefExt as LPCWSTR
  140         lCustData as LPARAM
  141         lpfnHook as LPOFNHOOKPROC
  142         lpTemplateName as LPCWSTR
  143     end type
  144 #else
  145     type tagOFN_NT4W field = 1
  146         lStructSize as DWORD
  147         hwndOwner as HWND
  148         hInstance as HINSTANCE
  149         lpstrFilter as LPCWSTR
  150         lpstrCustomFilter as LPWSTR
  151         nMaxCustFilter as DWORD
  152         nFilterIndex as DWORD
  153         lpstrFile as LPWSTR
  154         nMaxFile as DWORD
  155         lpstrFileTitle as LPWSTR
  156         nMaxFileTitle as DWORD
  157         lpstrInitialDir as LPCWSTR
  158         lpstrTitle as LPCWSTR
  159         Flags as DWORD
  160         nFileOffset as WORD
  161         nFileExtension as WORD
  162         lpstrDefExt as LPCWSTR
  163         lCustData as LPARAM
  164         lpfnHook as LPOFNHOOKPROC
  165         lpTemplateName as LPCWSTR
  166     end type
  167 #endif
  168 
  169 type OPENFILENAME_NT4W as tagOFN_NT4W
  170 type LPOPENFILENAME_NT4W as tagOFN_NT4W ptr
  171 
  172 #ifdef UNICODE
  173     type OPENFILENAME_NT4 as OPENFILENAME_NT4W
  174     type LPOPENFILENAME_NT4 as LPOPENFILENAME_NT4W
  175 #else
  176     type OPENFILENAME_NT4 as OPENFILENAME_NT4A
  177     type LPOPENFILENAME_NT4 as LPOPENFILENAME_NT4A
  178 #endif
  179 
  180 #ifdef __FB_64BIT__
  181     type tagOFNA
  182         lStructSize as DWORD
  183         hwndOwner as HWND
  184         hInstance as HINSTANCE
  185         lpstrFilter as LPCSTR
  186         lpstrCustomFilter as LPSTR
  187         nMaxCustFilter as DWORD
  188         nFilterIndex as DWORD
  189         lpstrFile as LPSTR
  190         nMaxFile as DWORD
  191         lpstrFileTitle as LPSTR
  192         nMaxFileTitle as DWORD
  193         lpstrInitialDir as LPCSTR
  194         lpstrTitle as LPCSTR
  195         Flags as DWORD
  196         nFileOffset as WORD
  197         nFileExtension as WORD
  198         lpstrDefExt as LPCSTR
  199         lCustData as LPARAM
  200         lpfnHook as LPOFNHOOKPROC
  201         lpTemplateName as LPCSTR
  202         pvReserved as any ptr
  203         dwReserved as DWORD
  204         FlagsEx as DWORD
  205     end type
  206 #else
  207     type tagOFNA field = 1
  208         lStructSize as DWORD
  209         hwndOwner as HWND
  210         hInstance as HINSTANCE
  211         lpstrFilter as LPCSTR
  212         lpstrCustomFilter as LPSTR
  213         nMaxCustFilter as DWORD
  214         nFilterIndex as DWORD
  215         lpstrFile as LPSTR
  216         nMaxFile as DWORD
  217         lpstrFileTitle as LPSTR
  218         nMaxFileTitle as DWORD
  219         lpstrInitialDir as LPCSTR
  220         lpstrTitle as LPCSTR
  221         Flags as DWORD
  222         nFileOffset as WORD
  223         nFileExtension as WORD
  224         lpstrDefExt as LPCSTR
  225         lCustData as LPARAM
  226         lpfnHook as LPOFNHOOKPROC
  227         lpTemplateName as LPCSTR
  228         pvReserved as any ptr
  229         dwReserved as DWORD
  230         FlagsEx as DWORD
  231     end type
  232 #endif
  233 
  234 type OPENFILENAMEA as tagOFNA
  235 type LPOPENFILENAMEA as tagOFNA ptr
  236 
  237 #ifdef __FB_64BIT__
  238     type tagOFNW
  239         lStructSize as DWORD
  240         hwndOwner as HWND
  241         hInstance as HINSTANCE
  242         lpstrFilter as LPCWSTR
  243         lpstrCustomFilter as LPWSTR
  244         nMaxCustFilter as DWORD
  245         nFilterIndex as DWORD
  246         lpstrFile as LPWSTR
  247         nMaxFile as DWORD
  248         lpstrFileTitle as LPWSTR
  249         nMaxFileTitle as DWORD
  250         lpstrInitialDir as LPCWSTR
  251         lpstrTitle as LPCWSTR
  252         Flags as DWORD
  253         nFileOffset as WORD
  254         nFileExtension as WORD
  255         lpstrDefExt as LPCWSTR
  256         lCustData as LPARAM
  257         lpfnHook as LPOFNHOOKPROC
  258         lpTemplateName as LPCWSTR
  259         pvReserved as any ptr
  260         dwReserved as DWORD
  261         FlagsEx as DWORD
  262     end type
  263 #else
  264     type tagOFNW field = 1
  265         lStructSize as DWORD
  266         hwndOwner as HWND
  267         hInstance as HINSTANCE
  268         lpstrFilter as LPCWSTR
  269         lpstrCustomFilter as LPWSTR
  270         nMaxCustFilter as DWORD
  271         nFilterIndex as DWORD
  272         lpstrFile as LPWSTR
  273         nMaxFile as DWORD
  274         lpstrFileTitle as LPWSTR
  275         nMaxFileTitle as DWORD
  276         lpstrInitialDir as LPCWSTR
  277         lpstrTitle as LPCWSTR
  278         Flags as DWORD
  279         nFileOffset as WORD
  280         nFileExtension as WORD
  281         lpstrDefExt as LPCWSTR
  282         lCustData as LPARAM
  283         lpfnHook as LPOFNHOOKPROC
  284         lpTemplateName as LPCWSTR
  285         pvReserved as any ptr
  286         dwReserved as DWORD
  287         FlagsEx as DWORD
  288     end type
  289 #endif
  290 
  291 type OPENFILENAMEW as tagOFNW
  292 type LPOPENFILENAMEW as tagOFNW ptr
  293 
  294 #ifdef UNICODE
  295     type OPENFILENAME as OPENFILENAMEW
  296     type LPOPENFILENAME as LPOPENFILENAMEW
  297 #else
  298     type OPENFILENAME as OPENFILENAMEA
  299     type LPOPENFILENAME as LPOPENFILENAMEA
  300 #endif
  301 
  302 #define OPENFILENAME_SIZE_VERSION_400A CDSIZEOF_STRUCT(OPENFILENAMEA, lpTemplateName)
  303 #define OPENFILENAME_SIZE_VERSION_400W CDSIZEOF_STRUCT(OPENFILENAMEW, lpTemplateName)
  304 
  305 #ifdef UNICODE
  306     #define OPENFILENAME_SIZE_VERSION_400 OPENFILENAME_SIZE_VERSION_400W
  307 #else
  308     #define OPENFILENAME_SIZE_VERSION_400 OPENFILENAME_SIZE_VERSION_400A
  309 #endif
  310 
  311 declare function GetOpenFileNameA(byval as LPOPENFILENAMEA) as WINBOOL
  312 declare function GetOpenFileNameW(byval as LPOPENFILENAMEW) as WINBOOL
  313 
  314 #ifdef UNICODE
  315     declare function GetOpenFileName alias "GetOpenFileNameW"(byval as LPOPENFILENAMEW) as WINBOOL
  316 #else
  317     declare function GetOpenFileName alias "GetOpenFileNameA"(byval as LPOPENFILENAMEA) as WINBOOL
  318 #endif
  319 
  320 declare function GetSaveFileNameA(byval as LPOPENFILENAMEA) as WINBOOL
  321 declare function GetSaveFileNameW(byval as LPOPENFILENAMEW) as WINBOOL
  322 
  323 #ifdef UNICODE
  324     declare function GetSaveFileName alias "GetSaveFileNameW"(byval as LPOPENFILENAMEW) as WINBOOL
  325 #else
  326     declare function GetSaveFileName alias "GetSaveFileNameA"(byval as LPOPENFILENAMEA) as WINBOOL
  327 #endif
  328 
  329 declare function GetFileTitleA(byval as LPCSTR, byval as LPSTR, byval as WORD) as short
  330 declare function GetFileTitleW(byval as LPCWSTR, byval as LPWSTR, byval as WORD) as short
  331 
  332 #ifdef UNICODE
  333     declare function GetFileTitle alias "GetFileTitleW"(byval as LPCWSTR, byval as LPWSTR, byval as WORD) as short
  334 #else
  335     declare function GetFileTitle alias "GetFileTitleA"(byval as LPCSTR, byval as LPSTR, byval as WORD) as short
  336 #endif
  337 
  338 const OFN_READONLY = &h1
  339 const OFN_OVERWRITEPROMPT = &h2
  340 const OFN_HIDEREADONLY = &h4
  341 const OFN_NOCHANGEDIR = &h8
  342 const OFN_SHOWHELP = &h10
  343 const OFN_ENABLEHOOK = &h20
  344 const OFN_ENABLETEMPLATE = &h40
  345 const OFN_ENABLETEMPLATEHANDLE = &h80
  346 const OFN_NOVALIDATE = &h100
  347 const OFN_ALLOWMULTISELECT = &h200
  348 const OFN_EXTENSIONDIFFERENT = &h400
  349 const OFN_PATHMUSTEXIST = &h800
  350 const OFN_FILEMUSTEXIST = &h1000
  351 const OFN_CREATEPROMPT = &h2000
  352 const OFN_SHAREAWARE = &h4000
  353 const OFN_NOREADONLYRETURN = &h8000
  354 const OFN_NOTESTFILECREATE = &h10000
  355 const OFN_NONETWORKBUTTON = &h20000
  356 const OFN_NOLONGNAMES = &h40000
  357 const OFN_EXPLORER = &h80000
  358 const OFN_NODEREFERENCELINKS = &h100000
  359 const OFN_LONGNAMES = &h200000
  360 const OFN_ENABLEINCLUDENOTIFY = &h400000
  361 const OFN_ENABLESIZING = &h800000
  362 const OFN_DONTADDTORECENT = &h2000000
  363 const OFN_FORCESHOWHIDDEN = &h10000000
  364 const OFN_EX_NOPLACESBAR = &h1
  365 const OFN_SHAREFALLTHROUGH = 2
  366 const OFN_SHARENOWARN = 1
  367 const OFN_SHAREWARN = 0
  368 type LPCCHOOKPROC as function(byval as HWND, byval as UINT, byval as WPARAM, byval as LPARAM) as UINT_PTR
  369 
  370 #ifdef __FB_64BIT__
  371     type _OFNOTIFYA
  372         hdr as NMHDR
  373         lpOFN as LPOPENFILENAMEA
  374         pszFile as LPSTR
  375     end type
  376 #else
  377     type _OFNOTIFYA field = 1
  378         hdr as NMHDR
  379         lpOFN as LPOPENFILENAMEA
  380         pszFile as LPSTR
  381     end type
  382 #endif
  383 
  384 type OFNOTIFYA as _OFNOTIFYA
  385 type LPOFNOTIFYA as _OFNOTIFYA ptr
  386 
  387 #ifdef __FB_64BIT__
  388     type _OFNOTIFYW
  389         hdr as NMHDR
  390         lpOFN as LPOPENFILENAMEW
  391         pszFile as LPWSTR
  392     end type
  393 #else
  394     type _OFNOTIFYW field = 1
  395         hdr as NMHDR
  396         lpOFN as LPOPENFILENAMEW
  397         pszFile as LPWSTR
  398     end type
  399 #endif
  400 
  401 type OFNOTIFYW as _OFNOTIFYW
  402 type LPOFNOTIFYW as _OFNOTIFYW ptr
  403 
  404 #ifdef UNICODE
  405     type OFNOTIFY as OFNOTIFYW
  406     type LPOFNOTIFY as LPOFNOTIFYW
  407 #else
  408     type OFNOTIFY as OFNOTIFYA
  409     type LPOFNOTIFY as LPOFNOTIFYA
  410 #endif
  411 
  412 #ifdef __FB_64BIT__
  413     type _OFNOTIFYEXA
  414         hdr as NMHDR
  415         lpOFN as LPOPENFILENAMEA
  416         psf as LPVOID
  417         pidl as LPVOID
  418     end type
  419 #else
  420     type _OFNOTIFYEXA field = 1
  421         hdr as NMHDR
  422         lpOFN as LPOPENFILENAMEA
  423         psf as LPVOID
  424         pidl as LPVOID
  425     end type
  426 #endif
  427 
  428 type OFNOTIFYEXA as _OFNOTIFYEXA
  429 type LPOFNOTIFYEXA as _OFNOTIFYEXA ptr
  430 
  431 #ifdef __FB_64BIT__
  432     type _OFNOTIFYEXW
  433         hdr as NMHDR
  434         lpOFN as LPOPENFILENAMEW
  435         psf as LPVOID
  436         pidl as LPVOID
  437     end type
  438 #else
  439     type _OFNOTIFYEXW field = 1
  440         hdr as NMHDR
  441         lpOFN as LPOPENFILENAMEW
  442         psf as LPVOID
  443         pidl as LPVOID
  444     end type
  445 #endif
  446 
  447 type OFNOTIFYEXW as _OFNOTIFYEXW
  448 type LPOFNOTIFYEXW as _OFNOTIFYEXW ptr
  449 
  450 #ifdef UNICODE
  451     type OFNOTIFYEX as OFNOTIFYEXW
  452     type LPOFNOTIFYEX as LPOFNOTIFYEXW
  453 #else
  454     type OFNOTIFYEX as OFNOTIFYEXA
  455     type LPOFNOTIFYEX as LPOFNOTIFYEXA
  456 #endif
  457 
  458 const CDN_FIRST = culng(0u - 601u)
  459 const CDN_LAST = culng(0u - 699u)
  460 const CDN_INITDONE = CDN_FIRST
  461 const CDN_SELCHANGE = culng(CDN_FIRST - 1)
  462 const CDN_FOLDERCHANGE = culng(CDN_FIRST - 2)
  463 const CDN_SHAREVIOLATION = culng(CDN_FIRST - 3)
  464 const CDN_HELP = culng(CDN_FIRST - 4)
  465 const CDN_FILEOK = culng(CDN_FIRST - 5)
  466 const CDN_TYPECHANGE = culng(CDN_FIRST - 6)
  467 const CDN_INCLUDEITEM = culng(CDN_FIRST - 7)
  468 const CDM_FIRST = WM_USER + 100
  469 const CDM_LAST = WM_USER + 200
  470 const CDM_GETSPEC = CDM_FIRST
  471 #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) clng(SNDMSG(_hdlg, CDM_GETSPEC, cast(WPARAM, _cbmax), cast(LPARAM, cast(LPSTR, _psz))))
  472 #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) clng(SNDMSG(_hdlg, CDM_GETSPEC, cast(WPARAM, _cbmax), cast(LPARAM, cast(LPWSTR, _psz))))
  473 
  474 #ifdef UNICODE
  475     #define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecW
  476 #else
  477     #define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecA
  478 #endif
  479 
  480 const CDM_GETFILEPATH = CDM_FIRST + 1
  481 #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) clng(SNDMSG(_hdlg, CDM_GETFILEPATH, cast(WPARAM, _cbmax), cast(LPARAM, cast(LPSTR, _psz))))
  482 #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) clng(SNDMSG(_hdlg, CDM_GETFILEPATH, cast(WPARAM, _cbmax), cast(LPARAM, cast(LPWSTR, _psz))))
  483 
  484 #ifdef UNICODE
  485     #define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathW
  486 #else
  487     #define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathA
  488 #endif
  489 
  490 const CDM_GETFOLDERPATH = CDM_FIRST + 2
  491 #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) clng(SNDMSG(_hdlg, CDM_GETFOLDERPATH, cast(WPARAM, _cbmax), cast(LPARAM, cast(LPSTR, _psz))))
  492 #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) clng(SNDMSG(_hdlg, CDM_GETFOLDERPATH, cast(WPARAM, _cbmax), cast(LPARAM, cast(LPWSTR, _psz))))
  493 
  494 #ifdef UNICODE
  495     #define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathW
  496 #else
  497     #define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathA
  498 #endif
  499 
  500 const CDM_GETFOLDERIDLIST = CDM_FIRST + 3
  501 #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) clng(SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, cast(WPARAM, _cbmax), cast(LPARAM, cast(LPVOID, _pidl))))
  502 const CDM_SETCONTROLTEXT = CDM_FIRST + 4
  503 #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) SNDMSG(_hdlg, CDM_SETCONTROLTEXT, cast(WPARAM, _id), cast(LPARAM, cast(LPSTR, _text)))
  504 const CDM_HIDECONTROL = CDM_FIRST + 5
  505 #define CommDlg_OpenSave_HideControl(_hdlg, _id) SNDMSG(_hdlg, CDM_HIDECONTROL, cast(WPARAM, _id), 0)
  506 const CDM_SETDEFEXT = CDM_FIRST + 6
  507 #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) SNDMSG(_hdlg, CDM_SETDEFEXT, 0, cast(LPARAM, cast(LPSTR, _pszext)))
  508 
  509 #ifdef __FB_64BIT__
  510     type tagCHOOSECOLORA
  511         lStructSize as DWORD
  512         hwndOwner as HWND
  513         hInstance as HWND
  514         rgbResult as COLORREF
  515         lpCustColors as COLORREF ptr
  516         Flags as DWORD
  517         lCustData as LPARAM
  518         lpfnHook as LPCCHOOKPROC
  519         lpTemplateName as LPCSTR
  520     end type
  521 #else
  522     type tagCHOOSECOLORA field = 1
  523         lStructSize as DWORD
  524         hwndOwner as HWND
  525         hInstance as HWND
  526         rgbResult as COLORREF
  527         lpCustColors as COLORREF ptr
  528         Flags as DWORD
  529         lCustData as LPARAM
  530         lpfnHook as LPCCHOOKPROC
  531         lpTemplateName as LPCSTR
  532     end type
  533 #endif
  534 
  535 type CHOOSECOLORA as tagCHOOSECOLORA
  536 type LPCHOOSECOLORA as tagCHOOSECOLORA ptr
  537 
  538 #ifdef __FB_64BIT__
  539     type tagCHOOSECOLORW
  540         lStructSize as DWORD
  541         hwndOwner as HWND
  542         hInstance as HWND
  543         rgbResult as COLORREF
  544         lpCustColors as COLORREF ptr
  545         Flags as DWORD
  546         lCustData as LPARAM
  547         lpfnHook as LPCCHOOKPROC
  548         lpTemplateName as LPCWSTR
  549     end type
  550 #else
  551     type tagCHOOSECOLORW field = 1
  552         lStructSize as DWORD
  553         hwndOwner as HWND
  554         hInstance as HWND
  555         rgbResult as COLORREF
  556         lpCustColors as COLORREF ptr
  557         Flags as DWORD
  558         lCustData as LPARAM
  559         lpfnHook as LPCCHOOKPROC
  560         lpTemplateName as LPCWSTR
  561     end type
  562 #endif
  563 
  564 type CHOOSECOLORW as tagCHOOSECOLORW
  565 type LPCHOOSECOLORW as tagCHOOSECOLORW ptr
  566 
  567 #ifdef UNICODE
  568     type CHOOSECOLOR as CHOOSECOLORW
  569     type LPCHOOSECOLOR as LPCHOOSECOLORW
  570 #else
  571     type CHOOSECOLOR as CHOOSECOLORA
  572     type LPCHOOSECOLOR as LPCHOOSECOLORA
  573 #endif
  574 
  575 declare function ChooseColorA(byval as LPCHOOSECOLORA) as WINBOOL
  576 declare function ChooseColorW(byval as LPCHOOSECOLORW) as WINBOOL
  577 
  578 #ifdef UNICODE
  579     declare function ChooseColor alias "ChooseColorW"(byval as LPCHOOSECOLORW) as WINBOOL
  580 #else
  581     declare function ChooseColor alias "ChooseColorA"(byval as LPCHOOSECOLORA) as WINBOOL
  582 #endif
  583 
  584 const CC_RGBINIT = &h1
  585 const CC_FULLOPEN = &h2
  586 const CC_PREVENTFULLOPEN = &h4
  587 const CC_SHOWHELP = &h8
  588 const CC_ENABLEHOOK = &h10
  589 const CC_ENABLETEMPLATE = &h20
  590 const CC_ENABLETEMPLATEHANDLE = &h40
  591 const CC_SOLIDCOLOR = &h80
  592 const CC_ANYCOLOR = &h100
  593 type LPFRHOOKPROC as function(byval as HWND, byval as UINT, byval as WPARAM, byval as LPARAM) as UINT_PTR
  594 
  595 #ifdef __FB_64BIT__
  596     type tagFINDREPLACEA
  597         lStructSize as DWORD
  598         hwndOwner as HWND
  599         hInstance as HINSTANCE
  600         Flags as DWORD
  601         lpstrFindWhat as LPSTR
  602         lpstrReplaceWith as LPSTR
  603         wFindWhatLen as WORD
  604         wReplaceWithLen as WORD
  605         lCustData as LPARAM
  606         lpfnHook as LPFRHOOKPROC
  607         lpTemplateName as LPCSTR
  608     end type
  609 #else
  610     type tagFINDREPLACEA field = 1
  611         lStructSize as DWORD
  612         hwndOwner as HWND
  613         hInstance as HINSTANCE
  614         Flags as DWORD
  615         lpstrFindWhat as LPSTR
  616         lpstrReplaceWith as LPSTR
  617         wFindWhatLen as WORD
  618         wReplaceWithLen as WORD
  619         lCustData as LPARAM
  620         lpfnHook as LPFRHOOKPROC
  621         lpTemplateName as LPCSTR
  622     end type
  623 #endif
  624 
  625 type FINDREPLACEA as tagFINDREPLACEA
  626 type LPFINDREPLACEA as tagFINDREPLACEA ptr
  627 
  628 #ifdef __FB_64BIT__
  629     type tagFINDREPLACEW
  630         lStructSize as DWORD
  631         hwndOwner as HWND
  632         hInstance as HINSTANCE
  633         Flags as DWORD
  634         lpstrFindWhat as LPWSTR
  635         lpstrReplaceWith as LPWSTR
  636         wFindWhatLen as WORD
  637         wReplaceWithLen as WORD
  638         lCustData as LPARAM
  639         lpfnHook as LPFRHOOKPROC
  640         lpTemplateName as LPCWSTR
  641     end type
  642 #else
  643     type tagFINDREPLACEW field = 1
  644         lStructSize as DWORD
  645         hwndOwner as HWND
  646         hInstance as HINSTANCE
  647         Flags as DWORD
  648         lpstrFindWhat as LPWSTR
  649         lpstrReplaceWith as LPWSTR
  650         wFindWhatLen as WORD
  651         wReplaceWithLen as WORD
  652         lCustData as LPARAM
  653         lpfnHook as LPFRHOOKPROC
  654         lpTemplateName as LPCWSTR
  655     end type
  656 #endif
  657 
  658 type FINDREPLACEW as tagFINDREPLACEW
  659 type LPFINDREPLACEW as tagFINDREPLACEW ptr
  660 
  661 #ifdef UNICODE
  662     type FINDREPLACE as FINDREPLACEW
  663     type LPFINDREPLACE as LPFINDREPLACEW
  664 #else
  665     type FINDREPLACE as FINDREPLACEA
  666     type LPFINDREPLACE as LPFINDREPLACEA
  667 #endif
  668 
  669 const FR_DOWN = &h1
  670 const FR_WHOLEWORD = &h2
  671 const FR_MATCHCASE = &h4
  672 const FR_FINDNEXT = &h8
  673 const FR_REPLACE = &h10
  674 const FR_REPLACEALL = &h20
  675 const FR_DIALOGTERM = &h40
  676 const FR_SHOWHELP = &h80
  677 const FR_ENABLEHOOK = &h100
  678 const FR_ENABLETEMPLATE = &h200
  679 const FR_NOUPDOWN = &h400
  680 const FR_NOMATCHCASE = &h800
  681 const FR_NOWHOLEWORD = &h1000
  682 const FR_ENABLETEMPLATEHANDLE = &h2000
  683 const FR_HIDEUPDOWN = &h4000
  684 const FR_HIDEMATCHCASE = &h8000
  685 const FR_HIDEWHOLEWORD = &h10000
  686 const FR_RAW = &h20000
  687 const FR_MATCHDIAC = &h20000000
  688 const FR_MATCHKASHIDA = &h40000000
  689 const FR_MATCHALEFHAMZA = &h80000000
  690 declare function FindTextA(byval as LPFINDREPLACEA) as HWND
  691 declare function FindTextW(byval as LPFINDREPLACEW) as HWND
  692 
  693 #ifdef UNICODE
  694     declare function FindText alias "FindTextW"(byval as LPFINDREPLACEW) as HWND
  695 #else
  696     declare function FindText alias "FindTextA"(byval as LPFINDREPLACEA) as HWND
  697 #endif
  698 
  699 declare function ReplaceTextA(byval as LPFINDREPLACEA) as HWND
  700 declare function ReplaceTextW(byval as LPFINDREPLACEW) as HWND
  701 
  702 #ifdef UNICODE
  703     declare function ReplaceText alias "ReplaceTextW"(byval as LPFINDREPLACEW) as HWND
  704 #else
  705     declare function ReplaceText alias "ReplaceTextA"(byval as LPFINDREPLACEA) as HWND
  706 #endif
  707 
  708 type LPCFHOOKPROC as function(byval as HWND, byval as UINT, byval as WPARAM, byval as LPARAM) as UINT_PTR
  709 
  710 #ifdef __FB_64BIT__
  711     type tagCHOOSEFONTA
  712         lStructSize as DWORD
  713         hwndOwner as HWND
  714         hDC as HDC
  715         lpLogFont as LPLOGFONTA
  716         iPointSize as INT_
  717         Flags as DWORD
  718         rgbColors as COLORREF
  719         lCustData as LPARAM
  720         lpfnHook as LPCFHOOKPROC
  721         lpTemplateName as LPCSTR
  722         hInstance as HINSTANCE
  723         lpszStyle as LPSTR
  724         nFontType as WORD
  725         ___MISSING_ALIGNMENT__ as WORD
  726         nSizeMin as INT_
  727         nSizeMax as INT_
  728     end type
  729 #else
  730     type tagCHOOSEFONTA field = 1
  731         lStructSize as DWORD
  732         hwndOwner as HWND
  733         hDC as HDC
  734         lpLogFont as LPLOGFONTA
  735         iPointSize as INT_
  736         Flags as DWORD
  737         rgbColors as COLORREF
  738         lCustData as LPARAM
  739         lpfnHook as LPCFHOOKPROC
  740         lpTemplateName as LPCSTR
  741         hInstance as HINSTANCE
  742         lpszStyle as LPSTR
  743         nFontType as WORD
  744         ___MISSING_ALIGNMENT__ as WORD
  745         nSizeMin as INT_
  746         nSizeMax as INT_
  747     end type
  748 #endif
  749 
  750 type CHOOSEFONTA as tagCHOOSEFONTA
  751 type LPCHOOSEFONTA as tagCHOOSEFONTA ptr
  752 
  753 #ifdef __FB_64BIT__
  754     type tagCHOOSEFONTW
  755         lStructSize as DWORD
  756         hwndOwner as HWND
  757         hDC as HDC
  758         lpLogFont as LPLOGFONTW
  759         iPointSize as INT_
  760         Flags as DWORD
  761         rgbColors as COLORREF
  762         lCustData as LPARAM
  763         lpfnHook as LPCFHOOKPROC
  764         lpTemplateName as LPCWSTR
  765         hInstance as HINSTANCE
  766         lpszStyle as LPWSTR
  767         nFontType as WORD
  768         ___MISSING_ALIGNMENT__ as WORD
  769         nSizeMin as INT_
  770         nSizeMax as INT_
  771     end type
  772 #else
  773     type tagCHOOSEFONTW field = 1
  774         lStructSize as DWORD
  775         hwndOwner as HWND
  776         hDC as HDC
  777         lpLogFont as LPLOGFONTW
  778         iPointSize as INT_
  779         Flags as DWORD
  780         rgbColors as COLORREF
  781         lCustData as LPARAM
  782         lpfnHook as LPCFHOOKPROC
  783         lpTemplateName as LPCWSTR
  784         hInstance as HINSTANCE
  785         lpszStyle as LPWSTR
  786         nFontType as WORD
  787         ___MISSING_ALIGNMENT__ as WORD
  788         nSizeMin as INT_
  789         nSizeMax as INT_
  790     end type
  791 #endif
  792 
  793 type CHOOSEFONTW as tagCHOOSEFONTW
  794 type LPCHOOSEFONTW as tagCHOOSEFONTW ptr
  795 
  796 #ifdef UNICODE
  797     type CHOOSEFONT as CHOOSEFONTW
  798     type LPCHOOSEFONT as LPCHOOSEFONTW
  799 #else
  800     type CHOOSEFONT as CHOOSEFONTA
  801     type LPCHOOSEFONT as LPCHOOSEFONTA
  802 #endif
  803 
  804 declare function ChooseFontA(byval as LPCHOOSEFONTA) as WINBOOL
  805 declare function ChooseFontW(byval as LPCHOOSEFONTW) as WINBOOL
  806 
  807 #ifdef UNICODE
  808     declare function ChooseFont alias "ChooseFontW"(byval as LPCHOOSEFONTW) as WINBOOL
  809 #else
  810     declare function ChooseFont alias "ChooseFontA"(byval as LPCHOOSEFONTA) as WINBOOL
  811 #endif
  812 
  813 const CF_SCREENFONTS = &h1
  814 const CF_PRINTERFONTS = &h2
  815 const CF_BOTH = CF_SCREENFONTS or CF_PRINTERFONTS
  816 const CF_SHOWHELP = &h4
  817 const CF_ENABLEHOOK = &h8
  818 const CF_ENABLETEMPLATE = &h10
  819 const CF_ENABLETEMPLATEHANDLE = &h20
  820 const CF_INITTOLOGFONTSTRUCT = &h40
  821 const CF_USESTYLE = &h80
  822 const CF_EFFECTS = &h100
  823 const CF_APPLY = &h200
  824 const CF_ANSIONLY = &h400
  825 const CF_SCRIPTSONLY = CF_ANSIONLY
  826 const CF_NOVECTORFONTS = &h800
  827 const CF_NOOEMFONTS = CF_NOVECTORFONTS
  828 const CF_NOSIMULATIONS = &h1000
  829 const CF_LIMITSIZE = &h2000
  830 const CF_FIXEDPITCHONLY = &h4000
  831 const CF_WYSIWYG = &h8000
  832 const CF_FORCEFONTEXIST = &h10000
  833 const CF_SCALABLEONLY = &h20000
  834 const CF_TTONLY = &h40000
  835 const CF_NOFACESEL = &h80000
  836 const CF_NOSTYLESEL = &h100000
  837 const CF_NOSIZESEL = &h200000
  838 const CF_SELECTSCRIPT = &h400000
  839 const CF_NOSCRIPTSEL = &h800000
  840 const CF_NOVERTFONTS = &h1000000
  841 
  842 #if _WIN32_WINNT = &h0602
  843     const CF_INACTIVEFONTS = &h02000000
  844 #endif
  845 
  846 const SIMULATED_FONTTYPE = &h8000
  847 const PRINTER_FONTTYPE = &h4000
  848 const SCREEN_FONTTYPE = &h2000
  849 const BOLD_FONTTYPE = &h100
  850 const ITALIC_FONTTYPE = &h200
  851 const REGULAR_FONTTYPE = &h400
  852 const PS_OPENTYPE_FONTTYPE = &h10000
  853 const TT_OPENTYPE_FONTTYPE = &h20000
  854 const TYPE1_FONTTYPE = &h40000
  855 
  856 #if _WIN32_WINNT = &h0602
  857     const SYMBOL_FONTTYPE = &h80000
  858 #endif
  859 
  860 const WM_CHOOSEFONT_GETLOGFONT = WM_USER + 1
  861 const WM_CHOOSEFONT_SETLOGFONT = WM_USER + 101
  862 const WM_CHOOSEFONT_SETFLAGS = WM_USER + 102
  863 #define LBSELCHSTRINGA "commdlg_LBSelChangedNotify"
  864 #define SHAREVISTRINGA "commdlg_ShareViolation"
  865 #define FILEOKSTRINGA "commdlg_FileNameOK"
  866 #define COLOROKSTRINGA "commdlg_ColorOK"
  867 #define SETRGBSTRINGA "commdlg_SetRGBColor"
  868 #define HELPMSGSTRINGA "commdlg_help"
  869 #define FINDMSGSTRINGA "commdlg_FindReplace"
  870 #define LBSELCHSTRINGW wstr("commdlg_LBSelChangedNotify")
  871 #define SHAREVISTRINGW wstr("commdlg_ShareViolation")
  872 #define FILEOKSTRINGW wstr("commdlg_FileNameOK")
  873 #define COLOROKSTRINGW wstr("commdlg_ColorOK")
  874 #define SETRGBSTRINGW wstr("commdlg_SetRGBColor")
  875 #define HELPMSGSTRINGW wstr("commdlg_help")
  876 #define FINDMSGSTRINGW wstr("commdlg_FindReplace")
  877 
  878 #ifdef UNICODE
  879     #define LBSELCHSTRING LBSELCHSTRINGW
  880     #define SHAREVISTRING SHAREVISTRINGW
  881     #define FILEOKSTRING FILEOKSTRINGW
  882     #define COLOROKSTRING COLOROKSTRINGW
  883     #define SETRGBSTRING SETRGBSTRINGW
  884     #define HELPMSGSTRING HELPMSGSTRINGW
  885     #define FINDMSGSTRING FINDMSGSTRINGW
  886 #else
  887     #define LBSELCHSTRING LBSELCHSTRINGA
  888     #define SHAREVISTRING SHAREVISTRINGA
  889     #define FILEOKSTRING FILEOKSTRINGA
  890     #define COLOROKSTRING COLOROKSTRINGA
  891     #define SETRGBSTRING SETRGBSTRINGA
  892     #define HELPMSGSTRING HELPMSGSTRINGA
  893     #define FINDMSGSTRING FINDMSGSTRINGA
  894 #endif
  895 
  896 const CD_LBSELNOITEMS = -1
  897 const CD_LBSELCHANGE = 0
  898 const CD_LBSELSUB = 1
  899 const CD_LBSELADD = 2
  900 type LPPRINTHOOKPROC as function(byval as HWND, byval as UINT, byval as WPARAM, byval as LPARAM) as UINT_PTR
  901 type LPSETUPHOOKPROC as function(byval as HWND, byval as UINT, byval as WPARAM, byval as LPARAM) as UINT_PTR
  902 
  903 #ifdef __FB_64BIT__
  904     type tagPDA
  905         lStructSize as DWORD
  906         hwndOwner as HWND
  907         hDevMode as HGLOBAL
  908         hDevNames as HGLOBAL
  909         hDC as HDC
  910         Flags as DWORD
  911         nFromPage as WORD
  912         nToPage as WORD
  913         nMinPage as WORD
  914         nMaxPage as WORD
  915         nCopies as WORD
  916         hInstance as HINSTANCE
  917         lCustData as LPARAM
  918         lpfnPrintHook as LPPRINTHOOKPROC
  919         lpfnSetupHook as LPSETUPHOOKPROC
  920         lpPrintTemplateName as LPCSTR
  921         lpSetupTemplateName as LPCSTR
  922         hPrintTemplate as HGLOBAL
  923         hSetupTemplate as HGLOBAL
  924     end type
  925 #else
  926     type tagPDA field = 1
  927         lStructSize as DWORD
  928         hwndOwner as HWND
  929         hDevMode as HGLOBAL
  930         hDevNames as HGLOBAL
  931         hDC as HDC
  932         Flags as DWORD
  933         nFromPage as WORD
  934         nToPage as WORD
  935         nMinPage as WORD
  936         nMaxPage as WORD
  937         nCopies as WORD
  938         hInstance as HINSTANCE
  939         lCustData as LPARAM
  940         lpfnPrintHook as LPPRINTHOOKPROC
  941         lpfnSetupHook as LPSETUPHOOKPROC
  942         lpPrintTemplateName as LPCSTR
  943         lpSetupTemplateName as LPCSTR
  944         hPrintTemplate as HGLOBAL
  945         hSetupTemplate as HGLOBAL
  946     end type
  947 #endif
  948 
  949 type PRINTDLGA as tagPDA
  950 type LPPRINTDLGA as tagPDA ptr
  951 
  952 #ifdef __FB_64BIT__
  953     type tagPDW
  954         lStructSize as DWORD
  955         hwndOwner as HWND
  956         hDevMode as HGLOBAL
  957         hDevNames as HGLOBAL
  958         hDC as HDC
  959         Flags as DWORD
  960         nFromPage as WORD
  961         nToPage as WORD
  962         nMinPage as WORD
  963         nMaxPage as WORD
  964         nCopies as WORD
  965         hInstance as HINSTANCE
  966         lCustData as LPARAM
  967         lpfnPrintHook as LPPRINTHOOKPROC
  968         lpfnSetupHook as LPSETUPHOOKPROC
  969         lpPrintTemplateName as LPCWSTR
  970         lpSetupTemplateName as LPCWSTR
  971         hPrintTemplate as HGLOBAL
  972         hSetupTemplate as HGLOBAL
  973     end type
  974 #else
  975     type tagPDW field = 1
  976         lStructSize as DWORD
  977         hwndOwner as HWND
  978         hDevMode as HGLOBAL
  979         hDevNames as HGLOBAL
  980         hDC as HDC
  981         Flags as DWORD
  982         nFromPage as WORD
  983         nToPage as WORD
  984         nMinPage as WORD
  985         nMaxPage as WORD
  986         nCopies as WORD
  987         hInstance as HINSTANCE
  988         lCustData as LPARAM
  989         lpfnPrintHook as LPPRINTHOOKPROC
  990         lpfnSetupHook as LPSETUPHOOKPROC
  991         lpPrintTemplateName as LPCWSTR
  992         lpSetupTemplateName as LPCWSTR
  993         hPrintTemplate as HGLOBAL
  994         hSetupTemplate as HGLOBAL
  995     end type
  996 #endif
  997 
  998 type PRINTDLGW as tagPDW
  999 type LPPRINTDLGW as tagPDW ptr
 1000 
 1001 #ifdef UNICODE
 1002     type PRINTDLG as PRINTDLGW
 1003     type LPPRINTDLG as LPPRINTDLGW
 1004 #else
 1005     type PRINTDLG as PRINTDLGA
 1006     type LPPRINTDLG as LPPRINTDLGA
 1007 #endif
 1008 
 1009 declare function PrintDlgA(byval as LPPRINTDLGA) as WINBOOL
 1010 declare function PrintDlgW(byval as LPPRINTDLGW) as WINBOOL
 1011 
 1012 #ifdef UNICODE
 1013     declare function PrintDlg alias "PrintDlgW"(byval as LPPRINTDLGW) as WINBOOL
 1014 #else
 1015     declare function PrintDlg alias "PrintDlgA"(byval as LPPRINTDLGA) as WINBOOL
 1016 #endif
 1017 
 1018 type IPrintDialogCallbackVtbl as IPrintDialogCallbackVtbl_
 1019 
 1020 #ifdef __FB_64BIT__
 1021     type IPrintDialogCallback
 1022         lpVtbl as IPrintDialogCallbackVtbl ptr
 1023     end type
 1024 
 1025     type IPrintDialogCallbackVtbl_
 1026         QueryInterface as function(byval This as IPrintDialogCallback ptr, byval riid as const IID const ptr, byval ppvObj as LPVOID ptr) as HRESULT
 1027         AddRef as function(byval This as IPrintDialogCallback ptr) as ULONG
 1028         Release as function(byval This as IPrintDialogCallback ptr) as ULONG
 1029         InitDone as function(byval This as IPrintDialogCallback ptr) as HRESULT
 1030         SelectionChange as function(byval This as IPrintDialogCallback ptr) as HRESULT
 1031         HandleMessage as function(byval This as IPrintDialogCallback ptr, byval hDlg as HWND, byval uMsg as UINT, byval wParam as WPARAM, byval lParam as LPARAM, byval pResult as LRESULT ptr) as HRESULT
 1032     end type
 1033 #else
 1034     type IPrintDialogCallback field = 1
 1035         lpVtbl as IPrintDialogCallbackVtbl ptr
 1036     end type
 1037 
 1038     type IPrintDialogCallbackVtbl_ field = 1
 1039         QueryInterface as function(byval This as IPrintDialogCallback ptr, byval riid as const IID const ptr, byval ppvObj as LPVOID ptr) as HRESULT
 1040         AddRef as function(byval This as IPrintDialogCallback ptr) as ULONG
 1041         Release as function(byval This as IPrintDialogCallback ptr) as ULONG
 1042         InitDone as function(byval This as IPrintDialogCallback ptr) as HRESULT
 1043         SelectionChange as function(byval This as IPrintDialogCallback ptr) as HRESULT
 1044         HandleMessage as function(byval This as IPrintDialogCallback ptr, byval hDlg as HWND, byval uMsg as UINT, byval wParam as WPARAM, byval lParam as LPARAM, byval pResult as LRESULT ptr) as HRESULT
 1045     end type
 1046 #endif
 1047 
 1048 type IPrintDialogServicesVtbl as IPrintDialogServicesVtbl_
 1049 
 1050 #ifdef __FB_64BIT__
 1051     type IPrintDialogServices
 1052         lpVtbl as IPrintDialogServicesVtbl ptr
 1053     end type
 1054 
 1055     type IPrintDialogServicesVtbl_
 1056         QueryInterface as function(byval This as IPrintDialogServices ptr, byval riid as const IID const ptr, byval ppvObj as LPVOID ptr) as HRESULT
 1057         AddRef as function(byval This as IPrintDialogServices ptr) as ULONG
 1058         Release as function(byval This as IPrintDialogServices ptr) as ULONG
 1059         GetCurrentDevMode as function(byval This as IPrintDialogServices ptr, byval pDevMode as LPDEVMODE, byval pcbSize as UINT ptr) as HRESULT
 1060         GetCurrentPrinterName as function(byval This as IPrintDialogServices ptr, byval pPrinterName as LPTSTR, byval pcchSize as UINT ptr) as HRESULT
 1061         GetCurrentPortName as function(byval This as IPrintDialogServices ptr, byval pPortName as LPTSTR, byval pcchSize as UINT ptr) as HRESULT
 1062     end type
 1063 
 1064     type tagPRINTPAGERANGE
 1065         nFromPage as DWORD
 1066         nToPage as DWORD
 1067     end type
 1068 #else
 1069     type IPrintDialogServices field = 1
 1070         lpVtbl as IPrintDialogServicesVtbl ptr
 1071     end type
 1072 
 1073     type IPrintDialogServicesVtbl_ field = 1
 1074         QueryInterface as function(byval This as IPrintDialogServices ptr, byval riid as const IID const ptr, byval ppvObj as LPVOID ptr) as HRESULT
 1075         AddRef as function(byval This as IPrintDialogServices ptr) as ULONG
 1076         Release as function(byval This as IPrintDialogServices ptr) as ULONG
 1077         GetCurrentDevMode as function(byval This as IPrintDialogServices ptr, byval pDevMode as LPDEVMODE, byval pcbSize as UINT ptr) as HRESULT
 1078         GetCurrentPrinterName as function(byval This as IPrintDialogServices ptr, byval pPrinterName as LPTSTR, byval pcchSize as UINT ptr) as HRESULT
 1079         GetCurrentPortName as function(byval This as IPrintDialogServices ptr, byval pPortName as LPTSTR, byval pcchSize as UINT ptr) as HRESULT
 1080     end type
 1081 
 1082     type tagPRINTPAGERANGE field = 1
 1083         nFromPage as DWORD
 1084         nToPage as DWORD
 1085     end type
 1086 #endif
 1087 
 1088 type PRINTPAGERANGE as tagPRINTPAGERANGE
 1089 type LPPRINTPAGERANGE as tagPRINTPAGERANGE ptr
 1090 
 1091 #ifdef __FB_64BIT__
 1092     type tagPDEXA
 1093         lStructSize as DWORD
 1094         hwndOwner as HWND
 1095         hDevMode as HGLOBAL
 1096         hDevNames as HGLOBAL
 1097         hDC as HDC
 1098         Flags as DWORD
 1099         Flags2 as DWORD
 1100         ExclusionFlags as DWORD
 1101         nPageRanges as DWORD
 1102         nMaxPageRanges as DWORD
 1103         lpPageRanges as LPPRINTPAGERANGE
 1104         nMinPage as DWORD
 1105         nMaxPage as DWORD
 1106         nCopies as DWORD
 1107         hInstance as HINSTANCE
 1108         lpPrintTemplateName as LPCSTR
 1109         lpCallback as LPUNKNOWN
 1110         nPropertyPages as DWORD
 1111         lphPropertyPages as HPROPSHEETPAGE ptr
 1112         nStartPage as DWORD
 1113         dwResultAction as DWORD
 1114     end type
 1115 #else
 1116     type tagPDEXA field = 1
 1117         lStructSize as DWORD
 1118         hwndOwner as HWND
 1119         hDevMode as HGLOBAL
 1120         hDevNames as HGLOBAL
 1121         hDC as HDC
 1122         Flags as DWORD
 1123         Flags2 as DWORD
 1124         ExclusionFlags as DWORD
 1125         nPageRanges as DWORD
 1126         nMaxPageRanges as DWORD
 1127         lpPageRanges as LPPRINTPAGERANGE
 1128         nMinPage as DWORD
 1129         nMaxPage as DWORD
 1130         nCopies as DWORD
 1131         hInstance as HINSTANCE
 1132         lpPrintTemplateName as LPCSTR
 1133         lpCallback as LPUNKNOWN
 1134         nPropertyPages as DWORD
 1135         lphPropertyPages as HPROPSHEETPAGE ptr
 1136         nStartPage as DWORD
 1137         dwResultAction as DWORD
 1138     end type
 1139 #endif
 1140 
 1141 type PRINTDLGEXA as tagPDEXA
 1142 type LPPRINTDLGEXA as tagPDEXA ptr
 1143 
 1144 #ifdef __FB_64BIT__
 1145     type tagPDEXW
 1146         lStructSize as DWORD
 1147         hwndOwner as HWND
 1148         hDevMode as HGLOBAL
 1149         hDevNames as HGLOBAL
 1150         hDC as HDC
 1151         Flags as DWORD
 1152         Flags2 as DWORD
 1153         ExclusionFlags as DWORD
 1154         nPageRanges as DWORD
 1155         nMaxPageRanges as DWORD
 1156         lpPageRanges as LPPRINTPAGERANGE
 1157         nMinPage as DWORD
 1158         nMaxPage as DWORD
 1159         nCopies as DWORD
 1160         hInstance as HINSTANCE
 1161         lpPrintTemplateName as LPCWSTR
 1162         lpCallback as LPUNKNOWN
 1163         nPropertyPages as DWORD
 1164         lphPropertyPages as HPROPSHEETPAGE ptr
 1165         nStartPage as DWORD
 1166         dwResultAction as DWORD
 1167     end type
 1168 #else
 1169     type tagPDEXW field = 1
 1170         lStructSize as DWORD
 1171         hwndOwner as HWND
 1172         hDevMode as HGLOBAL
 1173         hDevNames as HGLOBAL
 1174         hDC as HDC
 1175         Flags as DWORD
 1176         Flags2 as DWORD
 1177         ExclusionFlags as DWORD
 1178         nPageRanges as DWORD
 1179         nMaxPageRanges as DWORD
 1180         lpPageRanges as LPPRINTPAGERANGE
 1181         nMinPage as DWORD
 1182         nMaxPage as DWORD
 1183         nCopies as DWORD
 1184         hInstance as HINSTANCE
 1185         lpPrintTemplateName as LPCWSTR
 1186         lpCallback as LPUNKNOWN
 1187         nPropertyPages as DWORD
 1188         lphPropertyPages as HPROPSHEETPAGE ptr
 1189         nStartPage as DWORD
 1190         dwResultAction as DWORD
 1191     end type
 1192 #endif
 1193 
 1194 type PRINTDLGEXW as tagPDEXW
 1195 type LPPRINTDLGEXW as tagPDEXW ptr
 1196 
 1197 #ifdef UNICODE
 1198     type PRINTDLGEX as PRINTDLGEXW
 1199     type LPPRINTDLGEX as LPPRINTDLGEXW
 1200 #else
 1201     type PRINTDLGEX as PRINTDLGEXA
 1202     type LPPRINTDLGEX as LPPRINTDLGEXA
 1203 #endif
 1204 
 1205 declare function PrintDlgExA(byval as LPPRINTDLGEXA) as HRESULT
 1206 declare function PrintDlgExW(byval as LPPRINTDLGEXW) as HRESULT
 1207 
 1208 #ifdef UNICODE
 1209     declare function PrintDlgEx alias "PrintDlgExW"(byval as LPPRINTDLGEXW) as HRESULT
 1210 #else
 1211     declare function PrintDlgEx alias "PrintDlgExA"(byval as LPPRINTDLGEXA) as HRESULT
 1212 #endif
 1213 
 1214 const PD_ALLPAGES = &h0
 1215 const PD_SELECTION = &h1
 1216 const PD_PAGENUMS = &h2
 1217 const PD_NOSELECTION = &h4
 1218 const PD_NOPAGENUMS = &h8
 1219 const PD_COLLATE = &h10
 1220 const PD_PRINTTOFILE = &h20
 1221 const PD_PRINTSETUP = &h40
 1222 const PD_NOWARNING = &h80
 1223 const PD_RETURNDC = &h100
 1224 const PD_RETURNIC = &h200
 1225 const PD_RETURNDEFAULT = &h400
 1226 const PD_SHOWHELP = &h800
 1227 const PD_ENABLEPRINTHOOK = &h1000
 1228 const PD_ENABLESETUPHOOK = &h2000
 1229 const PD_ENABLEPRINTTEMPLATE = &h4000
 1230 const PD_ENABLESETUPTEMPLATE = &h8000
 1231 const PD_ENABLEPRINTTEMPLATEHANDLE = &h10000
 1232 const PD_ENABLESETUPTEMPLATEHANDLE = &h20000
 1233 const PD_USEDEVMODECOPIES = &h40000
 1234 const PD_USEDEVMODECOPIESANDCOLLATE = &h40000
 1235 const PD_DISABLEPRINTTOFILE = &h80000
 1236 const PD_HIDEPRINTTOFILE = &h100000
 1237 const PD_NONETWORKBUTTON = &h200000
 1238 const PD_CURRENTPAGE = &h400000
 1239 const PD_NOCURRENTPAGE = &h800000
 1240 const PD_EXCLUSIONFLAGS = &h1000000
 1241 const PD_USELARGETEMPLATE = &h10000000
 1242 const PD_EXCL_COPIESANDCOLLATE = DM_COPIES or DM_COLLATE
 1243 const START_PAGE_GENERAL = &hffffffff
 1244 const PD_RESULT_CANCEL = 0
 1245 const PD_RESULT_PRINT = 1
 1246 const PD_RESULT_APPLY = 2
 1247 
 1248 #ifdef __FB_64BIT__
 1249     type tagDEVNAMES
 1250         wDriverOffset as WORD
 1251         wDeviceOffset as WORD
 1252         wOutputOffset as WORD
 1253         wDefault as WORD
 1254     end type
 1255 #else
 1256     type tagDEVNAMES field = 1
 1257         wDriverOffset as WORD
 1258         wDeviceOffset as WORD
 1259         wOutputOffset as WORD
 1260         wDefault as WORD
 1261     end type
 1262 #endif
 1263 
 1264 type DEVNAMES as tagDEVNAMES
 1265 type LPDEVNAMES as tagDEVNAMES ptr
 1266 const DN_DEFAULTPRN = &h1
 1267 declare function CommDlgExtendedError() as DWORD
 1268 const WM_PSD_PAGESETUPDLG = WM_USER
 1269 const WM_PSD_FULLPAGERECT = WM_USER + 1
 1270 const WM_PSD_MINMARGINRECT = WM_USER + 2
 1271 const WM_PSD_MARGINRECT = WM_USER + 3
 1272 const WM_PSD_GREEKTEXTRECT = WM_USER + 4
 1273 const WM_PSD_ENVSTAMPRECT = WM_USER + 5
 1274 const WM_PSD_YAFULLPAGERECT = WM_USER + 6
 1275 type LPPAGEPAINTHOOK as function(byval as HWND, byval as UINT, byval as WPARAM, byval as LPARAM) as UINT_PTR
 1276 type LPPAGESETUPHOOK as function(byval as HWND, byval as UINT, byval as WPARAM, byval as LPARAM) as UINT_PTR
 1277 
 1278 #ifdef __FB_64BIT__
 1279     type tagPSDA
 1280         lStructSize as DWORD
 1281         hwndOwner as HWND
 1282         hDevMode as HGLOBAL
 1283         hDevNames as HGLOBAL
 1284         Flags as DWORD
 1285         ptPaperSize as POINT
 1286         rtMinMargin as RECT
 1287         rtMargin as RECT
 1288         hInstance as HINSTANCE
 1289         lCustData as LPARAM
 1290         lpfnPageSetupHook as LPPAGESETUPHOOK
 1291         lpfnPagePaintHook as LPPAGEPAINTHOOK
 1292         lpPageSetupTemplateName as LPCSTR
 1293         hPageSetupTemplate as HGLOBAL
 1294     end type
 1295 #else
 1296     type tagPSDA field = 1
 1297         lStructSize as DWORD
 1298         hwndOwner as HWND
 1299         hDevMode as HGLOBAL
 1300         hDevNames as HGLOBAL
 1301         Flags as DWORD
 1302         ptPaperSize as POINT
 1303         rtMinMargin as RECT
 1304         rtMargin as RECT
 1305         hInstance as HINSTANCE
 1306         lCustData as LPARAM
 1307         lpfnPageSetupHook as LPPAGESETUPHOOK
 1308         lpfnPagePaintHook as LPPAGEPAINTHOOK
 1309         lpPageSetupTemplateName as LPCSTR
 1310         hPageSetupTemplate as HGLOBAL
 1311     end type
 1312 #endif
 1313 
 1314 type PAGESETUPDLGA as tagPSDA
 1315 type LPPAGESETUPDLGA as tagPSDA ptr
 1316 
 1317 #ifdef __FB_64BIT__
 1318     type tagPSDW
 1319         lStructSize as DWORD
 1320         hwndOwner as HWND
 1321         hDevMode as HGLOBAL
 1322         hDevNames as HGLOBAL
 1323         Flags as DWORD
 1324         ptPaperSize as POINT
 1325         rtMinMargin as RECT
 1326         rtMargin as RECT
 1327         hInstance as HINSTANCE
 1328         lCustData as LPARAM
 1329         lpfnPageSetupHook as LPPAGESETUPHOOK
 1330         lpfnPagePaintHook as LPPAGEPAINTHOOK
 1331         lpPageSetupTemplateName as LPCWSTR
 1332         hPageSetupTemplate as HGLOBAL
 1333     end type
 1334 #else
 1335     type tagPSDW field = 1
 1336         lStructSize as DWORD
 1337         hwndOwner as HWND
 1338         hDevMode as HGLOBAL
 1339         hDevNames as HGLOBAL
 1340         Flags as DWORD
 1341         ptPaperSize as POINT
 1342         rtMinMargin as RECT
 1343         rtMargin as RECT
 1344         hInstance as HINSTANCE
 1345         lCustData as LPARAM
 1346         lpfnPageSetupHook as LPPAGESETUPHOOK
 1347         lpfnPagePaintHook as LPPAGEPAINTHOOK
 1348         lpPageSetupTemplateName as LPCWSTR
 1349         hPageSetupTemplate as HGLOBAL
 1350     end type
 1351 #endif
 1352 
 1353 type PAGESETUPDLGW as tagPSDW
 1354 type LPPAGESETUPDLGW as tagPSDW ptr
 1355 
 1356 #ifdef UNICODE
 1357     type PAGESETUPDLG as PAGESETUPDLGW
 1358     type LPPAGESETUPDLG as LPPAGESETUPDLGW
 1359 #else
 1360     type PAGESETUPDLG as PAGESETUPDLGA
 1361     type LPPAGESETUPDLG as LPPAGESETUPDLGA
 1362 #endif
 1363 
 1364 declare function PageSetupDlgA(byval as LPPAGESETUPDLGA) as WINBOOL
 1365 declare function PageSetupDlgW(byval as LPPAGESETUPDLGW) as WINBOOL
 1366 
 1367 #ifdef UNICODE
 1368     declare function PageSetupDlg alias "PageSetupDlgW"(byval as LPPAGESETUPDLGW) as WINBOOL
 1369 #else
 1370     declare function PageSetupDlg alias "PageSetupDlgA"(byval as LPPAGESETUPDLGA) as WINBOOL
 1371 #endif
 1372 
 1373 const PSD_DEFAULTMINMARGINS = &h0
 1374 const PSD_INWININIINTLMEASURE = &h0
 1375 const PSD_MINMARGINS = &h1
 1376 const PSD_MARGINS = &h2
 1377 const PSD_INTHOUSANDTHSOFINCHES = &h4
 1378 const PSD_INHUNDREDTHSOFMILLIMETERS = &h8
 1379 const PSD_DISABLEMARGINS = &h10
 1380 const PSD_DISABLEPRINTER = &h20
 1381 const PSD_NOWARNING = &h80
 1382 const PSD_DISABLEORIENTATION = &h100
 1383 const PSD_RETURNDEFAULT = &h400
 1384 const PSD_DISABLEPAPER = &h200
 1385 const PSD_SHOWHELP = &h800
 1386 const PSD_ENABLEPAGESETUPHOOK = &h2000
 1387 const PSD_ENABLEPAGESETUPTEMPLATE = &h8000
 1388 const PSD_ENABLEPAGESETUPTEMPLATEHANDLE = &h20000
 1389 const PSD_ENABLEPAGEPAINTHOOK = &h40000
 1390 const PSD_DISABLEPAGEPAINTING = &h80000
 1391 const PSD_NONETWORKBUTTON = &h200000
 1392 
 1393 end extern