[comp.windows.ms] PIF Bug and Double Clicks

bruce@ssc-vax.UUCP (Bruce Stock) (01/16/91)

1)  I have encountered what may be a bug in the PIF interpretation code 
within Windows 3.  It involves the use of the "Optional Parameters" block 
in the PIF Editor.  I normally put a "?" in this block, which per the manual,
causes a nice dialog box to appear when the program is run (so that you 
can enter command line arguments for your DOS program).  This part works 
just fine.  However, when I attempt to associate a datafile type with a 
DOS program having a "?" in the PIF,  no dialog box ever appears when I 
double click the datafile (even if I associate it directly with the PIF).

This surfaced recently when I associated .zip extensions with a PKUNZIP.PIF
which had the "?" in it.  Nada.  Interestingly enough, other parameters in 
the PIF are properly interpreted.

2)  Has anyone figured out how to assign the "double click" function 
to a single click on one of the other mouse buttons?  I get so TIRED of 
double clicking (might as well have a Mac-----h [expletive expurgated] ).

Regards,  Bruce Stock   uw-beaver!ssc-vax!bruce   bruces@atc.boeing.com
E:\>

PDS2@psuvm.psu.edu (Paul D. Shan) (01/17/91)

In article <3572@ssc-bee.ssc-vax.UUCP>, bruce@ssc-vax.UUCP (Bruce Stock) says:
>
>1)  I have encountered what may be a bug in the PIF interpretation code
>within Windows 3.  It involves the use of the "Optional Parameters" block
>in the PIF Editor.  I normally put a "?" in this block, which per the manual,
>causes a nice dialog box to appear when the program is run (so that you
>can enter command line arguments for your DOS program).  This part works
>just fine.  However, when I attempt to associate a datafile type with a
>DOS program having a "?" in the PIF,  no dialog box ever appears when I
>double click the datafile (even if I associate it directly with the PIF).
>
>This surfaced recently when I associated .zip extensions with a PKUNZIP.PIF
>which had the "?" in it.  Nada.  Interestingly enough, other parameters in
>the PIF are properly interpreted.
  I ran into a similar problem while trying to set up PKZIP and ZOO to
decompress files.  I have two temporary directories on my hard disk (the
directories are permanent...their contents are temporary).  They are TEMP and
AAAATEMP.  What I wanted to happen was Associate any file with a .ZIP extension
to PKUNZIP.PIF.  Of course I had to do this through the file manager.  What I
wanted to happen is that for ANY .ZIP file, when double-clicked, the files
would be decompressed into AAAATEMP (the .ZIP files were usually in TEMP)
   The command used to decompress files is:  "PKUNZIP -d :.ZIP C:\AAAATEMP".
And here inlies the problem.  If I put the C:\AAAATEMP in the parameter line of
the PIF, the :.ZIP gets attached to the END of the line, and PKUNZIP bombs.
So I went into WIN.INI with Notepad and changed the association to:
"ZIP=PKUNZIP.PIF -d :.ZIP C:\AAAATEMP"  In Older versions of windows this
worked, but in Windows 3.0 then C:\AAAATEMP gets truncated and the files
decompress into whatever directory I happen to be in at the time the ZIP is
double-clicked.  I lose more ZIP files that way...especially when the ZIP
contains ZIP files.  I solved the problem by having the PIF call a .BAT file,
and supply the name of the ZIP file as the one and only parameter.  So, the
PIF has no parameter line, the Association is normal, and the BAT file contains
only one line:  "PKUNZIP -d %1 C:\AAAATEMP".  This isn't very pretty, but it
works.  For your case, if you put a Question mark in your PIF, and set up a
batch file to decompress things, when you double-click the icon from your
Program Manager (I assume that's why you put the "?" there in the first
place.) it will still ask you for a filename.  But when you associate
the .ZIP extension to that PIF file, and double-click on the file you
want to decompress, the prompt won't come up because you already know
which file to act on, and the prompt isn't needed.  Does this answer
your question, or do I ramble too much?  :-)

Good luck!

Paul D. Shan
Microcomputer and Personal Workstation Support
Center for Academic Computing
12 Willard Building
University Park, PA  16802
(814) 863-4356
PDS2@PSUVM.psu.edu