Silverfrost Logo About Us | Contact Us
 

DEFINE_FILE_EXTENSION@

Platform

Win32(ClearWin+)

Purpose

Allows application registry under Windows 95.

Syntax

 SUBROUTINE DEFINE_FILE_EXTENSION@(EXTNAME, PATH,
+ DESCR, ICON_IDX, NEW )
 CHARACTER*129 NAME, PATH, DESCRIPTION
 INTEGER ICON_INDEX, NEW OPTION

Description

Under Windows 95 it is possible to register an application with the system so that if a data file is opened via Explorer your application will be called to process it.

The EXTNAME variable is a string that contains the extension, the PATH must contain the full path and program name. A text description should be supplied in DESCRIPTION. The ICON_INDEX selects the icon to be used by Windows. If you specify -1 no icon is used otherwise the relevant icon is used. i.e. if you have four icons in your resource, by placing a value of 2 in ICON_INDEX the second icon resource will be used. NEW OPTION option should be set to a non zero value to activate the file type addition to Windows 95.

For example:

   CHARACTER*129 pname
   CALL get_program_name@(pname)
   k=define_file_extension@('.ICO',pname,
  +           'Icon file editor',0,1)

You can obtain the file name passed to your program, by Windows 95 as if you were examining the arguments on the command line.

For example:

     ...
     CHARACTER*129 cmnam@,filetoopen
     filetoopen=cmnam@()
     ...

GET_PROGRAM_NAME@ and CMNAM@ are Silverfrost library functions.

 

 

Copyright © 1999-2017 Silverfrost Limited