[python-win32] passing args to shell functions in shell.pyd

Mark Hammond mhammond at skippinet.com.au
Wed May 5 18:59:01 EDT 2004


> Since shell is a pyd file, I could not see the real parameter
> list, only
> the description from the Pywin help file.

This helpfile lists the real parameters!  What made you think the parameter
descriptions for that function did not apply to that function?

To your other mail:
> > Yes - just pass them like any other function.
> I would like to pass this dialog the Path to a directory, but the
> pidlRoot
> parameter is a PyIDL Object.
>
> I don't see any functions in the shell that convert a normal path to a
> PyIDL object format, so I just tried passing a string as in
> "C:\\Python23".
>
> This blew up python nad dropped me back in the WIn2K/Dos box
> command line.

Can you give more details here?  I can't make Python blow up like this, and
it it can, it is a serious bug.

I see:

>>> shell.SHBrowseForFolder(0 ,"foo")
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
TypeError: Only sequences (but not strings) are valid ITEMIDLIST objects
(got str).

Which is correct.

> I have a Visual Basic example of how to pass a starting directory to
> SHBrowseForFolder, but I can't seem to duplicate it through the python
> shell extensions.

Can you show us the example?

desktop=shell.SHGetDesktopFolder()
chEaten, pidl, flags = desktop.ParseDisplayName(0, None, "C:\\temp")

Is one way to get the PIDL for a known filename.

Mark.




More information about the Python-win32 mailing list