(declarations)

In Module PicMain

   1 ' PicInfo main module
   2 ' 2006 Aivosto Oy (www.aivosto.com)
   3 '
   4 ' This file is part of a sample project for Project Analyzer.
   5 ' Distribution of this file is only allowed along with Project Analyzer
   6 ' according to the Project Analyzer license terms.
   7 
   8 Option Explicit
   9 
  10 ' Global variable containing the title of this program
  11 Public ProgramTitle As String
  12 
  13 
  14 ' API declarations for FileDialog
  15 Private Declare Function GetOpenFileNameA Lib "comdlg32.dll" (pOpenfilename As OpenFilename) As Long
  16 
  17 ' This API Declare is dead

   ! Dead declaration
  18 Private Declare Function GetSaveFileNameA Lib "comdlg32.dll" (pOpenfilename As OpenFilename) As Long
  19 
  20 Private Type OpenFilename
  21         lStructSize As Long
  22         hwndOwner As Long
  23         hInstance As Long
  24         lpstrFilter As String
  25         lpstrCustomFilter As String
  26         nMaxCustFilter As Long
  27         nFilterIndex As Long
  28         lpstrFile As String
  29         nMaxFile As Long
  30         lpstrFileTitle As String
  31         nMaxFileTitle As Long
  32         lpstrInitialDir As String
  33         lpstrTitle As String
  34         Flags As Long
  35         nFileOffset As Integer
  36         nFileExtension As Integer
  37         lpstrDefExt As String
  38         lCustData As Long
  39         lpfnHook As Long
  40         lpTemplateName As String
  41 End Type
  42 
  43 Public Enum EFileDlgFlags

   ! Dead enum constant: OFN_ALLOWMULTISELECT
  44     OFN_ALLOWMULTISELECT = &H200            ' box allows multiple selections

   ! Dead enum constant: OFN_CREATEPROMPT
    Line too long: 181
  45     OFN_CREATEPROMPT = &H2000               ' If the user specifies a file that does not exist, this flag causes the dialog box to prompt the user for permission to create the file.
  46     OFN_FILEMUSTEXIST = &H1000              ' user can type only names of existing files in the File Name entry field
  47     OFN_HIDEREADONLY = &H4                  ' Hides the Read Only check box.
  48     

   ! Dead enum constant: OFN_NOCHANGEDIR
  49     OFN_NOCHANGEDIR = &H8
  50     ' Restores the current directory to its original value if the user changed the directory while searching for files.
  51     ' Windows NT 4.0/2000/XP: This flag is ineffective for GetOpenFileName.
  52 
  53     

   ! Dead enum constant: OFN_NODEREFERENCELINKS
  54     OFN_NODEREFERENCELINKS = &H100000
  55     ' Directs the dialog box to return the path and file name of the selected shortcut (.LNK) file.
  56     

   ! Dead enum constant: OFN_NONETWORKBUTTON
  57     OFN_NONETWORKBUTTON = &H20000
  58     ' Hides and disables the Network button.
  59 
  60     OFN_NOREADONLYRETURN = &H8000&
  61     ' Specifies that the returned file does not have the Read Only check box selected and is not in a write-protected directory.
  62 
  63 

   ! Dead enum constant: OFN_NOTESTFILECREATE
  64     OFN_NOTESTFILECREATE = &H10000
  65     ' Specifies that the file is not created before the dialog box is closed.
  66     ' This flag should be specified if the application saves the file on a create-nonmodify network share.
  67     ' When an application specifies this flag, the library does not check for write protection, a full disk,
  68     ' an open drive door, or network protection.
  69     
  70     OFN_OVERWRITEPROMPT = &H2
  71     ' Causes the Save As dialog box to generate a message box if the selected file already exists. The user must confirm whether to overwrite the file.
  72 
  73     OFN_PATHMUSTEXIST = &H800
  74     ' Specifies that the user can type only valid paths and file names.
  75     

   ! Dead enum constant: OFN_READONLY
  76     OFN_READONLY = &H1
  77     ' Causes the Read Only check box to be selected initially when the dialog box is created.
  78     ' This flag indicates the state of the Read Only check box when the dialog box is closed.
  79      

   ! Dead enum constant: OFN_SHAREAWARE
  80     OFN_SHAREAWARE = &H4000
  81     ' Specifies that if a call to the OpenFile function fails because of a network sharing violation, the error is ignored and the dialog box returns the selected file name.
  82     
  83     ' Open dialog defaults:
  84     ' File and path must exist
  85     ' No Read Only checkbox is displayed
  86     OFN_OPENDEFAULTS = OFN_FILEMUSTEXIST Or OFN_PATHMUSTEXIST Or OFN_HIDEREADONLY
  87 
  88     ' Save dialog defaults:
  89     ' User must confirm overwrite
  90     ' Path must exist
  91     ' * Read-only files can be selected, caller must use error handling if need to kill/overwrite/append

   ! Dead enum constant: OFN_SAVEDEFAULTS
  92     OFN_SAVEDEFAULTS = OFN_OVERWRITEPROMPT Or OFN_PATHMUSTEXIST Or OFN_HIDEREADONLY Or OFN_NOREADONLYRETURN
  93     
  94 End Enum
  95 
  96 Const MAXFILE = 512 ' Size of file name buffer in chars. Should be at least 256.
  97 
  98 ' Error code retrieval
  99 Private Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long
 100 Private Const CDERR_DIALOGFAILURE = &HFFFF
 101 Private Const CDERR_FINDRESFAILURE = &H6
 102 Private Const CDERR_NOHINSTANCE = &H4
 103 Private Const CDERR_INITIALIZATION = &H2
 104 Private Const CDERR_NOHOOK = &HB
 105 Private Const CDERR_LOCKRESFAILURE = &H8
 106 Private Const CDERR_NOTEMPLATE = &H3
 107 Private Const CDERR_LOADRESFAILURE = &H7
 108 Private Const CDERR_STRUCTSIZE = &H1
 109 Private Const CDERR_LOADSTRFAILURE = &H5
 110 Private Const FNERR_BUFFERTOOSMALL = &H3003
 111 Private Const CDERR_MEMALLOCFAILURE = &H9
 112 Private Const FNERR_INVALIDFILENAME = &H3002
 113 Private Const CDERR_MEMLOCKFAILURE = &HA
 114 Private Const FNERR_SUBCLASSFAILURE = &H3001
 115 
 116