Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Dragging a file on to a Windows98/WindowsNT Desktop icon


3 replies to this topic

scott matthews2

scott matthews2
  • Members
  • 13 posts

Posted 07 December 2001 - 22:40

FYI: All I am about to describe works in Windows 2000, but not in Windows 98 or Windows NT.

I have an application that has an Icon on the Windows 98/NT desktop with the following icon properties:

Target:
"C:\Program Files\ROC\JRE13\bin\javaw.exe" -Xbootclasspath/p:boot.jar -jar Design.Jar

Start In: "C:\Program Files\Roc\Formation\Design

When I double-click on the Icon things work great:
My application starts and I am able to select/open files which are used in my application. (For reference, the files that I use all end with a file extension of ".frm")

So far, so good.

Here's where it is Not working:
I want to be able to have the user go to into "My Computer" (or Windows Explorer) and be able to drag a file or file(s) onto the Windows desktop icon and have it pull up my appilcation up and open the dragged file(s).

What I get so far is a box that says "Could not find the main class. Program will exit!".  Note: Please do not dwell on the error message, please continue on as to what is causing the error.

For reference in the following, pretend I am dragging a file named "test.frm" on to the desktop icon.

What it looks like it is doing to me is the following:
It looks like it is ignoring some of the parameters on the Icon Target line and doing the following:
.....\javaw.exe test.frm
When I want it to do the following:
...\javaw.exe -Xbootclasspath/p:boot.jar -jar Design.Jar test.frm

It seems to be skipping everything after the first exe file and ignoring the additional command line arguments.

Again, the above works fine in Windows 2000.  What is the solution to make this work in Windows 98 & NT.

Thanks for your help.


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 08 December 2001 - 00:57

You didn't ask, but wouldn't a more reasonable scenario be to associate the FRM extension, so that the user can simply open the file directly from Explorer.  That way they don't have to mess with the desktop icon.

Under such a scenario one uses %1 to define the passed argument, in your case the FRM filename.

You might want to also try this in the shortcut, but you'll probably have to have your install create since I doubt you'll be able to enter this information directly and re-OK the dialog.

This is a long shot, but you could also try creating a batch file which references your command and %1 and try dropping it directly on there as well as shortcut pointing to it.


scott matthews2

scott matthews2
  • Members
  • 13 posts

Posted 10 December 2001 - 16:13

Although I failed to mention it, I can double-click on a file and have the application launch based on the file extension.  Dragging the files to the desktop icon gives the user an additional option. The user wants to be able to drag multiple files on to an icon just as you can do with Microsoft Word & Excel.

Using a batch file is not an option because this causes a 2nd Window/task to open up because of the Java call I am making (javaw.exe).  This needs to be done without a batch file.

Also, I have tried adding %1 after the command and that does not change things.

I appreciate your response, my fault for not listing what I have tried so far.



Perotin

Perotin
  • Full Members
  • 407 posts

Posted 10 December 2001 - 16:38

Maybe you can use a .bat or .cmd file to be underneath the desktop icon?
The content of the batch file would be
start "C:\Program Files\ROC\JRE13\bin\javaw.exe" -Xbootclasspath/p:boot.jar -jar Design.Jar "%1"
and the dragg'n'dropped file should be replace the %1 so your java application sees path and filename ...