RE: drag'n'drop onto desktop icon ???
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Linderman Sent: May 30, 2005 3:08 PM To: Ken Cornetet Cc: perl-win32-users mailing list; Michael D Schleif Subject: Re: drag'n'drop onto desktop icon ??? [snip] Jack's solution may be best of all, but it gets into magic hex strings and object IDs, which most people don't understand. And although I don't know for sure what he means by any icon with the .pl extension, since icons have .ico extensions, I'm guessing that what he means is that any file with the .pl extension, displayed in Windows Explorer as an icon in a file listing, can then be dropped to. I don't profess to understand it either :-) (if I did - I would definitely be in the wrong profession) I'll probably screw up this explanation too - but here goes. A desktop icon is linked to either a file/program/folder or a shortcut to a file/program/folder. So if we assume that the .pl extension is linked to perl.exe - and the file/program that the icon *represents* has a .pl extension, then any files dropped onto this icon will have their associated full pathnames available in @ARGV of the associated perl script. The class ID I used is the .exe drop handler which is somehow linked magically to shell32.dll. The same handler is used for the following classes: - batfile, cmdfile, comfile, exefile, piffile, scrfile, shcmdfile All my script did was to add it to the perlfile class too. Bills solution effectively does the same thing but through the batfile class. Of course Glenn is correct that with this new handler, a perl program within a file/folder listing in windows explorer will also accept a drop. This makes sense as the desktop is just a folder itself .. J. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: drag'n'drop onto desktop icon ???
-Original Message- From: Jack D. [mailto:[EMAIL PROTECTED] Sent: May 30, 2005 11:57 PM To: 'perl-win32-users mailing list' Subject: RE: drag'n'drop onto desktop icon ??? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Linderman Sent: May 30, 2005 3:08 PM To: Ken Cornetet Cc: perl-win32-users mailing list; Michael D Schleif Subject: Re: drag'n'drop onto desktop icon ??? [snip] Jack's solution may be best of all, but it gets into magic hex strings and object IDs, which most people don't understand. And although I don't know for sure what he means by any icon with the .pl extension, since icons have .ico extensions, I'm guessing that what he means is that any file with the .pl extension, displayed in Windows Explorer as an icon in a file listing, can then be dropped to. I don't profess to understand it either :-) (if I did - I would definitely be in the wrong profession) I'll probably screw up this explanation too - but here goes. A desktop icon is linked to either a file/program/folder or a shortcut to a file/program/folder. So if we assume that the .pl extension is linked to perl.exe - and the file/program that the icon *represents* has a .pl extension, then any files dropped onto this icon will have their associated full pathnames available in @ARGV of the associated perl script. The class ID I used is the .exe drop handler which is somehow linked magically to shell32.dll. The same handler is used for the following classes: - batfile, cmdfile, comfile, exefile, piffile, scrfile, shcmdfile All my script did was to add it to the perlfile class too. Bills solution effectively does the same thing but through the batfile class. Of course Glenn is correct that with this new handler, a perl program within a file/folder listing in windows explorer will also accept a drop. This makes sense as the desktop is just a folder itself .. J. Oops - I forgot - one last thing. Indeed it *is* the short names which are dropped. Put this script in a file on your desktop and drop stuff to see the arguments. ### use Tk; my $mw=tkinit; my $t=$mw-Scrolled('Text')-pack; $t-insert('end',$_\n) for (@ARGV); $t-see('end') MainLoop; ### J. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: drag'n'drop onto desktop icon ???
Create a batch file, and create a shortcut on the desktop to the batch file. The batch file should look like this: C:\perl\bin\perl.exe YourPrelScript.pl %1 %2 %3 %4 %5 %6 %7 %8 %9 Notes: 1. Only works for a max of 9 files dropped on the icon. CMD has a shift operator which, coupled with a for loop, *might* get you around the 9 parameter limit. 2. You could use wperl instead of perl to avoid the black CMD window. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael D Schleif Sent: Monday, May 23, 2005 12:29 AM To: perl-win32-users mailing list Subject: drag'n'drop onto desktop icon ??? I have a perl program that successfully processes a set of text files. So far, the UI is to pass the incoming text file to the program on the command line. Users want an icon on their desktops, and they want to drag the text file onto this icon, in order to process the file. I have not been able to figure out how to do this. What do you think? -- Best Regards, mds mds resource 877.596.8237 - Dare to fix things before they break . . . - Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know . . . -- ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: drag'n'drop onto desktop icon ???
Michael D Schleif wrote: I have a perl program that successfully processes a set of text files. So far, the UI is to pass the incoming text file to the program on the command line. Users want an icon on their desktops, and they want to drag the text file onto this icon, in order to process the file. I have not been able to figure out how to do this. What do you think? Have you tried creating a shortcut to Perl and renaming it to the name of the Perl script and add the path to the perl script as an arg ? Set Properties-Shortcut-Target to something like : C:\Perl\bin\perl.exe C:\Home\Me\test.pl (adjust the arg to point to your script) And test.pl: use strict; use Win32; my $msg = ''; $msg .= $_\n foreach @ARGV; Win32::MsgBox($msg);# print args in MsgBox __END__ -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /-- o // // Castle of Medieval Myth Magic http://www.todbe.com/ -/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: drag'n'drop onto desktop icon ???
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael D Schleif Sent: May 22, 2005 11:29 PM To: perl-win32-users mailing list Subject: drag'n'drop onto desktop icon ??? I have a perl program that successfully processes a set of text files. So far, the UI is to pass the incoming text file to the program on the command line. Users want an icon on their desktops, and they want to drag the text file onto this icon, in order to process the file. I have not been able to figure out how to do this. What do you think? You can add a DropHandler to the registry manually (or just run the perl program provided below) ### use Win32::TieRegistry; $Registry-Delimiter(/); $perlKey = $Registry-{HKEY_CLASSES_ROOT/Perl/}; $perlKey-{shellex/} = { DropHandler/ = { /={86C86720-42A0-1069-A2E8-08002B30309D} }}; ### Once that is done - any icon with the .pl extension should receive the filenames in @ARGV. Jack ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs