    ______________383

   ,  ShellExecute  . 
    .

    ,      -
 ,         -
  SetLastError:

VOID SetLastError(DWORD dwErrCode)

    dwErrCode     -
 .         
 .

 ShellExecute   ,  
  ,   .     
    ,   - ,
,    -  .  
   FindExecutable,      -
,    .   ,   -
,       ShellAPI.

 FindExecutable   :

void FindExecutable(const char *FileName, const char *Directory,
char *Buffer) ;

      .,   ,
  FileName.  Directory   
.         
 .  Buffer         
  ,        , -
   FileName.

    FindExecutable  , -
 32.    ,    .
    ,      .

    FindExecutable. 

char APchar[254] ;

FindExecutable("Doc.doc",NULL,APchar) ;

  ,    APchar    , 
   Doc.doc, :

C:\\PROGRAM FILES\\MICROSOFT OFFICE\\OFFICE\\WINWORD.EXE

,    Doc.doc     .
   FindExecutable    -
    GetLastError.      -
 32,    .   , , -
  :

int i = GetLastError();

if (i <= 32)
ShowMessage("  .   "+IntToStr(i));

     ,  -
 -    .  C++Builder  API Windows
(      API Windows,   -
      ,  C++Builder)  -
   ,      -
 .  ,    
  .