FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Opening a file that has no associated program
Posts: 24
Joined: Mon Jan 11, 2010 08:18 AM
Opening a file that has no associated program
Posted: Fri Jul 02, 2010 02:58 AM

Dear All / Sir Linares,

    Good Day!

            As per the subject, do you have a sample program in FWH that will tell if a file (i.e. pdf ) has no associated program to run it? Thanks

Best Regards,
Apollo

FWH10.6|BCC5.82|PELLEC|XMATE
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Opening a file that has no associated program
Posted: Fri Jul 02, 2010 07:08 AM
Hi Apollo,

I'm using:
Code (fw): Select all Collapse
   nRetValue:= ShellExecute( 0, cOperation, cPathFilename, cParameters, cDirectory, nShowCommand )


The values of <nRetValue> are:
Code (fw): Select all Collapse
   // › RETURNS
   // nRetValue: if the numeric return value is greater than 32, the function executed successful. Should the return value be less or equal to 32, the value represents a specific error.
   
   #define ERROR_BAD_FORMAT        11  // Datei ist keine Win32 Anwendung           - invalid EXE file
   #define SE_ERR_ACCESSDENIED     5      // Zugriff verweigert
   #define SE_ERR_ASSOCINCOMPLETE  27     // Datei-Assoziation ist unvollstaendig
   #define SE_ERR_DDEBUSY          30     // DDE ist nicht bereit
   #define SE_ERR_DDEFAIL          29     // DDE-Vorgang gescheitert
   #define SE_ERR_DDETIMEOUT       28     // DDE-Zeitlimit wurde erreicht
   #define SE_ERR_DLLNOTFOUND      32     // benoetigte DLL wurde nicht gefunden
   #define SE_ERR_FNF              2      // Datei wurde nicht gefunden                - invalid path or filename
   #define SE_ERR_NOASSOC          31     // Datei ist nicht assoziiert                - invalid action, or no application associated with the specified file
   #define SE_ERR_OOM              8      // Nicht genügend Speicher                   - insufficient memory
   #define SE_ERR_PNF              3      // Pfad wurde nicht gefunden
   #define SE_ERR_SHARE            26     // Sharing-Verletzung

Perhaps 'SE_ERR_NOASSOC' is the Return->Value you are looking for?
Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86

Continue the discussion