2006年02月18日 星期六 20:18
搜了一下没搜到,看Pywin32也好像没有专门的class或function 就是如何添加右键菜单(只针对文件夹即可)并将文件夹的路径作为参数传递到自己的程序? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060218/b476c4e6/attachment.html
2006年02月18日 星期六 20:24
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\CMD\command] @="cmd.exe /k \"cd %L\"" limodou BLOG上的 pywin32有,需要用到注册表 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com> 写道: > > 搜了一下没搜到,看Pywin32也好像没有专门的class或function > > 就是如何添加右键菜单(只针对文件夹即可)并将文件夹的路径作为参数传递到自己的程序? > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- Andelf BLOG:http://blog.sohu.com/members/andelf/ BLOG:http://spaces.msn.com/members/andelf -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060218/d5a83597/attachment.htm
2006年02月18日 星期六 20:35
好的;有没有无需直接操作注册表的? 在06-2-18,Andelf <andelf at gmail.com> 写道: > > Windows Registry Editor Version 5.00 > > [HKEY_CLASSES_ROOT\Directory\shell\CMD\command] > @="cmd.exe /k \"cd %L\"" > limodou BLOG上的 > pywin32有,需要用到注册表 > > > 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com> 写道: > > > > 搜了一下没搜到,看Pywin32也好像没有专门的class或function > > > > 就是如何添加右键菜单(只针对文件夹即可)并将文件夹的路径作为参数传递到自己的程序? > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > -- > Andelf > BLOG:http://blog.sohu.com/members/andelf/ > BLOG: http://spaces.msn.com/members/andelf > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060218/2f0e848f/attachment-0001.html
2006年02月18日 星期六 20:37
不晓得了 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com> 写道: > > 好的;有没有无需直接操作注册表的? > > 在06-2-18,Andelf <andelf at gmail.com> 写道: > > > > Windows Registry Editor Version 5.00 > > > > [HKEY_CLASSES_ROOT\Directory\shell\CMD\command] > > @="cmd.exe /k \"cd %L\"" > > limodou BLOG上的 > > pywin32有,需要用到注册表 > > > > > > 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com > 写道: > > > > > > 搜了一下没搜到,看Pywin32也好像没有专门的class或function > > > > > > 就是如何添加右键菜单(只针对文件夹即可)并将文件夹的路径作为参数传递到自己的程序? > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > -- > > Andelf > > BLOG:http://blog.sohu.com/members/andelf/ > > BLOG: http://spaces.msn.com/members/andelf > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- Andelf BLOG:http://blog.sohu.com/members/andelf/ BLOG:http://spaces.msn.com/members/andelf -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060218/28a5cf07/attachment.htm
2006年02月18日 星期六 20:46
右键菜单肯定是通过注册表实现的。就是注册一种类型给你的程序。可能有专门的windows api来实现。可以查一下msdn. On 2/18/06, Andelf <andelf at gmail.com> wrote: > > 不晓得了 > > 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com> 写道: > > > > 好的;有没有无需直接操作注册表的? > > > > 在06-2-18,Andelf <andelf at gmail.com> 写道: > > > > > > Windows Registry Editor Version 5.00 > > > > > > [HKEY_CLASSES_ROOT\Directory\shell\CMD\command] > > > @="cmd.exe /k \"cd %L\"" > > > limodou BLOG上的 > > > pywin32有,需要用到注册表 > > > > > > > > > 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com > 写道: > > > > > > > > 搜了一下没搜到,看Pywin32也好像没有专门的class或function > > > > > > > > 就是如何添加右键菜单(只针对文件夹即可)并将文件夹的路径作为参数传递到自己的程序? > > > > > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > -- > > > Andelf > > > BLOG:http://blog.sohu.com/members/andelf/ > > > BLOG: http://spaces.msn.com/members/andelf > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > -- > Andelf > BLOG:http://blog.sohu.com/members/andelf/ > BLOG:http://spaces.msn.com/members/andelf > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- 李超群 mobile phone:13759961869 office phone:029-87607341 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060218/0954b772/attachment.html
2006年02月18日 星期六 20:49
pywin32的 win32api模块就是调用windows api了,一样 有几个函数是操作注册表的 呃,不知道limodou的NewEdit是怎么实现注册表操作的 在06-2-18,超群李 <achilles.lee at gmail.com> 写道: > > 右键菜单肯定是通过注册表实现的。就是注册一种类型给你的程序。可能有专门的windows api来实现。可以查一下msdn. > > > On 2/18/06, Andelf <andelf at gmail.com> wrote: > > > > 不晓得了 > > > > 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com > 写道: > > > > > > 好的;有没有无需直接操作注册表的? > > > > > > 在06-2-18,Andelf <andelf at gmail.com> 写道: > > > > > > > > Windows Registry Editor Version 5.00 > > > > > > > > [HKEY_CLASSES_ROOT\Directory\shell\CMD\command] > > > > @="cmd.exe /k \"cd %L\"" > > > > limodou BLOG上的 > > > > pywin32有,需要用到注册表 > > > > > > > > > > > > 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com > 写道: > > > > > > > > > > 搜了一下没搜到,看Pywin32也好像没有专门的class或function > > > > > > > > > > 就是如何添加右键菜单(只针对文件夹即可)并将文件夹的路径作为参数传递到自己的程序? > > > > > > > > > > _______________________________________________ > > > > > python-chinese > > > > > Post: send python-chinese at lists.python.cn > > > > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > > > > > > > > > Unsubscribe: send unsubscribe to > > > > > python-chinese-request at lists.python.cn > > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > > > > > > > > > -- > > > > Andelf > > > > BLOG:http://blog.sohu.com/members/andelf/ > > > > BLOG: http://spaces.msn.com/members/andelf > > > > _______________________________________________ > > > > python-chinese > > > > Post: send python-chinese at lists.python.cn > > > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > > > Unsubscribe: send unsubscribe to > > > > python-chinese-request at lists.python.cn > > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese at lists.python.cn > > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > > Unsubscribe: send unsubscribe to > > > python-chinese-request at lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > > > > > -- > > Andelf > > BLOG:http://blog.sohu.com/members/andelf/ > > BLOG:http://spaces.msn.com/members/andelf > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > -- > 李超群 > mobile phone:13759961869 > office phone:029-87607341 > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- Andelf BLOG:http://blog.sohu.com/members/andelf/ BLOG:http://spaces.msn.com/members/andelf -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060218/afcb9bf6/attachment-0001.htm
2006年02月18日 星期六 20:49
去看一下Limodou的NewEdit源代码,NewEdit实现了这样的功能。 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com> 写道: > > 搜了一下没搜到,看Pywin32也好像没有专门的class或function > > 就是如何添加右键菜单(只针对文件夹即可)并将文件夹的路径作为参数传递到自己的程序? > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- 欢迎访问: http://blog.csdn.net/ccat 刘鑫 March.Liu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060218/f07e3a8f/attachment.html
2006年02月21日 星期二 21:47
从NewEdit源代码中抄了一段,搞定了: def regFolderContext(prompt, cmdLine): import _winreg key = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, 'Directory\\shell', _winreg.KEY_ALL_ACCESS) _winreg.SetValue(key, prompt + '\\command', _winreg.REG_SZ, cmdLine) def unregFolderContext(prompt): import _winreg try: key = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, 'Directory\\shell', _winreg.KEY_ALL_ACCESS) _winreg.DeleteKey(key, prompt + '\\command') _winreg.DeleteKey(key, prompt) except: pass class FolderContextHelper: @staticmethod def reg(): filename = os.path.basename(sys.argv[0]) f, ext = os.path.splitext(filename) if ext == '.exe': command = '"%s" "%%1"' % os.path.normpath(sys.argv[0]) else: path = os.path.normpath(sys.argv[0]) execute = sys.executable.replace('python.exe', 'pythonw.exe') command = '"%s" "%s" "%%1"' % (execute, path) regFolderContext('PyRename', command) @staticmethod def unreg(): unregFolderContext('PyRename') *PyRename* <http://blog.csdn.net/platformlib/archive/2006/02/11/596863.aspx> 也便增加了右键菜单功能 在06-2-18,刘鑫 <march.liu at gmail.com> 写道: > > 去看一下Limodou的NewEdit源代码,NewEdit实现了这样的功能。 > > 在06-2-18,ajax chelsea <ajaxchelsea at gmail.com> 写道: > > > > 搜了一下没搜到,看Pywin32也好像没有专门的class或function > > > > 就是如何添加右键菜单(只针对文件夹即可)并将文件夹的路径作为参数传递到自己的程序? > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > -- > 欢迎访问: > http://blog.csdn.net/ccat > > 刘鑫 > March.Liu > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060221/3c20ed55/attachment-0001.htm
Zeuux © 2025
京ICP备05028076号