[python-win32] drag-and-drop with python WSH scripts

Wolf Logan wolf@circle-cross.org
Thu, 15 Aug 2002 14:31:38 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_019B_01C24468.7738BD90
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

i want to be able to drag-and-drop items onto .pys scripts the same way =
you can with .vbs scripts (as described in =
http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/script=
56/html/wsdraganddrop.asp). i believe this is similar to what ian =
bicking was looking to do in =
http://mail.python.org/pipermail/python-win32/2002-April/000323.html=20

after facing a couple hours of frustration and not finding any useful =
pointers on the net, i started poking through the registry. i discovered =
that the reason i couldn't drop items onto .pys files was that there's a =
registry key missing (apparently one of the keys that should be created =
by the process that registers the python scripting engine with WSH). the =
key should be:

HKEY_CLASSES_ROOT\pysFile\ShellEx\DropHandler

and should contain the (Default) string value, set to =
"{60254CA5-953B-11CF-8C96-00AA00B8708C}". this registers the script =
files as "drop targets", with the WSH shell helper handling the =
dropping. dropped items appear in the script as WScript.Arguments, the =
same as they do in any other WSH script.

hope this helps someone else do something useful.

------=_NextPart_000_019B_01C24468.7738BD90
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=3D2>i want to be able to drag-and-drop items onto .pys =
scripts the=20
same way you can with .vbs scripts (as described in </FONT><A=20
href=3D"http://msdn.microsoft.com/library/default.asp?url=3D/library/en-u=
s/script56/html/wsdraganddrop.asp"><FONT=20
size=3D2>http://msdn.microsoft.com/library/default.asp?url=3D/library/en-=
us/script56/html/wsdraganddrop.asp</FONT></A><FONT=20
size=3D2>). i believe this is similar to what ian bicking was looking to =
do in <A=20
href=3D"http://mail.python.org/pipermail/python-win32/2002-April/000323.h=
tml">http://mail.python.org/pipermail/python-win32/2002-April/000323.html=
</A>&nbsp;</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>after facing a couple hours of frustration and not =
finding any=20
useful pointers on the net, i started poking through the registry. i =
discovered=20
that the reason i couldn't drop items onto .pys files was that there's a =

registry key missing (apparently one of the keys that should be created =
by the=20
process that registers the python scripting engine with WSH). the key =
should=20
be:</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT =
size=3D2>HKEY_CLASSES_ROOT\pysFile\ShellEx\DropHandler</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>and should contain the (Default) string value, set =
to=20
"{60254CA5-953B-11CF-8C96-00AA00B8708C}". this registers the script =
files as=20
"drop targets", with the WSH shell helper handling the dropping. dropped =
items=20
appear in the script as WScript.Arguments, the same as they do in any =
other WSH=20
script.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>hope this helps someone else do something=20
useful.</FONT></DIV></BODY></HTML>

------=_NextPart_000_019B_01C24468.7738BD90--