Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-10 Thread iMath
I solved it like the following from win32com.shell import shell, shellcon import os def launch_file_explorer(path, files): ''' Given a absolute base path and names of its children (no path), open up one File Explorer window with all the child files selected ''' folder_pidl = sh

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-10 Thread iMath
I solved it like the following from win32com.shell import shell, shellcon import os def launch_file_explorer(path, files): ''' Given a absolute base path and names of its children (no path), open up one File Explorer window with all the child files selected ''' folder_pidl = sh

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-09 Thread iMath
thanks, I found out the reason: this question has no relationship with Win7 or WinXP,but related to the users' system setting . GetDisplayNameOf() only gives the DISPLAY name ,so the filename with or without extension acording to whether the user want to view files in the explorer with extensi

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-08 Thread MRAB
On 08/11/2013 03:30, iMath wrote: When running the following code on WinXP , all is fine , -- from win32com.shell import shell def launch_file_explorer(path, files): folder_pidl = shell.SHILCreateFromPath(path,0)[0] desktop

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-08 Thread iMath
在 2013年11月8日星期五UTC+8下午5时47分43秒,Tim Golden写道: > On 08/11/2013 03:30, iMath wrote: > > > > > > When running the following code on WinXP , all is fine , > > > -- > > > from win32com.shell import shell > > > > > > def launch_file_explo

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-08 Thread iMath
在 2013年11月8日星期五UTC+8下午5时47分43秒,Tim Golden写道: > On 08/11/2013 03:30, iMath wrote: > > > > > > When running the following code on WinXP , all is fine , > > > -- > > > from win32com.shell import shell > > > > > > def launch_file_explo

Re: pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-08 Thread Tim Golden
On 08/11/2013 03:30, iMath wrote: > > When running the following code on WinXP , all is fine , > -- > from win32com.shell import shell > > def launch_file_explorer(path, files): > > folder_pidl = shell.SHILCreateFromPath(path,0)[0]

pywin32 programming error on Win7 with shell.SHGetDesktopFolder, desktop.BindToObject, desktop.GetDisplayNameOf

2013-11-07 Thread iMath
When running the following code on WinXP , all is fine , -- from win32com.shell import shell def launch_file_explorer(path, files): folder_pidl = shell.SHILCreateFromPath(path,0)[0] desktop = shell.SHGetDesktopFolder() shell