English 中文(简体)
Icon overlay, issue with-030
原标题:Icon overlay issue with Python

我在这个论坛上看到了一些例子和专题,涉及如何用Icon overlay手铐,与Adhur 2.7 &一起执行;这套双赢套方案,但并非对我有用,我不理解为什么。

我制造了DL,我在登记时没有错误。 我也直接用文字进行审判,但同样如此。 从来没有像这个阶层那样。

该守则是:

import win32traceutil

from win32com.shell import shell, shellcon
import pythoncom
import winerror
import os

REG_PATH =r SoftwareMicrosoftWindowsCurrentVersionExplorerShellIconOverlayIdentifiers 
REG_KEY = "GdIconOverlayTest"

class GdClass:
    _reg_clsid_= {512AE200-F075-41E6-97DD-48ECA4311F2E} 
    _reg_progid_= GD.TestServer 
    _reg_desc_= gd desc 
    _public_methods_ = [ GetOverlayInfo , GetPriority , IsMemberOf ]
    _com_interfaces_=[shell.IID_IShellIconOverlayIdentifier, pythoncom.IID_IDispatch]

    def __init__(self):
        pass

    def GetOverlayInfo(self):
        return (os.path.abspath(r C:icons	est.ico ), 0, shellcon.ISIOI_ICONFILE)

    def GetPriority(self):
        return 0

    def IsMemberOf(self, fname, attributes):
        print( ismemberOf , fname, os.path.basename(fname))
        if os.path.basename(fname) == "hello.text":
            return winerror.S_OK
        return winerror.E_FAIL

def DllRegisterServer():
    print "Registering %s" % REG_KEY
    import _winreg
    key = _winreg.CreateKey(_winreg.HKEY_LOCAL_MACHINE, REG_PATH)
    subkey = _winreg.CreateKey(key, GdClass._reg_progid_)
    _winreg.SetValueEx(subkey, None, 0, _winreg.REG_SZ, GdClass._reg_clsid_)
    print "Registration complete: %s" % GdClass._reg_desc_

def DllUnregisterServer():
    print "Unregistering %s" % REG_KEY
    import _winreg
    try:
        key = _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, r"%s\%s" % (REG_PATH, GdClass._reg_progid_))
    except WindowsError, details:
        import errno
        if details.errno != errno.ENOENT:
            raise
    print "Unregistration complete: %s" % GdClass._reg_desc_

if __name__== __main__ :
    from win32com.server import register
    register.UseCommandLine(GdClass,
                            finalize_register = DllRegisterServer,
                            finalize_unregister = DllUnregisterServer)

Hi and thanks for your answer. I have tested with a log file and also win32traceutil. The registration/unregitration messages are logged. The registry entries are also created under:

1/HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerShellIconOverlayIdentifiersGD.TestServer 2/ HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionShell ExtensionsApproved 3/ directly under class root.

我还在“SerOverlayInfo”、“GetPriority”等方法中添加了一些标识,并且是“成员”,但我可以通过探索者看到一个痕迹。

My configuration is: Python 2.7 pywin32-214.win32-py2.7.exe Windows XP SP 2

http://kobiarts.free.fr/python/iconoverlay.zip“rel=“nofollow”>。

问题回答

problem solved. i guess something was badly initialized but now it works.

我想要做的是像 drop光服务。

i 必须能够根据上载情况更新特定档案的icon。 我将为每个州设立一个班级(上载、上载、失败),执行国际开发协会的界面。 ......

i) 是否应当写上目前上下载/上载到——在当地档案中上上上载的档案清单,检查每个档案是否包含在“SiOf”方法中,以确定显示好的icon”。 这样做的最佳途径是,例如将所有档案途径储存在登记处的关键之内?

感谢您的帮助。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签