    _______________381

    ,   -
   .      
  OpenDialog,    

                                       *.;*. corn;*, pit;*, dat
                                        *.*

    Button (  ),    -
           .
  OnClick     :

if (OpenDialogl->Execute())
{

int i = WinExec(OpenDialogl->FileName.c_str(),SW_RESTORE);

switch (i)
(
case 0:ShowMessage("He    ");

break;

case ERROR_BAD_FORMAT:

ShowMessage("  " + OpenDialogl->FiieName);

breaks-
case ERROR_PATH_NOT_FOUND:

ShowMessage("He   " +

ExtractFilePath(OpenDialogl->FileName)) ;

break;

case ERROR_FILE_NOT_FOUND:

ShowMessage("He   " + OpenDialogl->FileName) ;

}
}

         
  Windows  MS-DOS.

6.1.4      
 ShellExecute

       WinExec -
  ShellExecute.       ,
      .     
           -
. ,   ,   .doc, 
Word.     , ,   file.doc  -
 Word         file.doc.  -
   ShellExecute    .
 ,        
.

   ShellExecute     


ttinclude "ShellAPl.h"

  ShellAPI,    . 
C++Builder    .

 ShellExecute    API Windows 
  :

void ShellExecute(HWnd Wnd, const char * Operation,

const char *FileName, const char *Parameters,
const char *Directory, unsigned int ShowCmd);