[python-win32] Overlay Icon Question...

Andrea Gavana andrea.gavana at gmail.com
Mon Apr 14 21:44:50 CEST 2008


Hi Tim,

On Mon, Apr 14, 2008 at 5:07 PM, Tim Golden  wrote:
> Andrea Gavana wrote:
> > 1) I have looked the implementation mentioned in the link above, but
> > it is a bit unclear to me: how do I actually *use* this class? All my
> > users have the extension "*.DATA" associated with the Wordpad or
> > Notepad or similar icons, as they use these editors to open these
> > file? Should I tamper the registry where the *.DATA extension is
> > stored? I am really lost here.
>
> > Sorry for the very newbie questions, I am just a beginner with win32all.
> > I have tried to mess around with some code found in CodeProject:
> > http://www.codeproject.com/KB/shell/overlayicon.aspx
> > And with the one in TortoiseSVN source code, but both are way over my head :-(
>
> I'm afraid you haven't chosen a particularly easy entree into
> the world of Windows! Some shell things (that's things which
> affect the appearance and actions of Explorer and the Desktop)
> are fairly easy to effect (and affect), requiring just some simple
> registry manipulation. But the more complex and interesting things
> require what's known as a Shell Namespace Extension.
>
> Basically, you register interest in one or more file types in the registry,
> identifying a specific set of callbacks which the Shell (explorer.exe or
> whatever) calls whenever it sees a file in which you're interested.
> This is the kind of thing which gives context-sensitive menus depending
> on file type and content and icon overlays of the sort you're describing.

Thank you very much for your answer. I am such a newbie with win32all
(I have done only very basic things for my open source wxPython
widgets) that I don't even know where to look for.

> > 2) Can I assign this overlay icon to a particular file (without
> > touching the others with the same extension)? And if so, how?
>
> In principle, yes. I haven't done it myself, but if someone more
> experienced doesn't chip in with an example, I'll try to put one together
> myself. I warn you, though, with this kind of thing you're working within
> Windows: the pywin32 modules are simply wrapping the raw interface.
> So it won't be pretty!

If you could help me sort this out, it would be great. I don't really
care if it is a nice code or not, it's just my users' request and I
would like to be able to prove, once again, the power of Python :-D.

> > 3) Is the problem mentioned in the thread above still present? Will it
> > affect also my GUI, even though it is writte in wxPython?
>
> I must admit to no more than a passing familiarity with wxPython, but I'd
> be rather surprised if it offered something as platform-specific and ticklish
> as icon overlays for the Windows shell. I'd be very glad to be wrong for your
> sake! If wxPython *does* offer overlays using pywin32 code, it will share that
> code's problems; if they have their own implementation then probably not.

I am sorry I didn't explain myself very well: no, wxPython does not
have this thing, I will be using pywin32 pure code for the overlay
icon. wxPython does offer platform indipendent and native-look
widgets: the difference between my application and the one mentioned
in the thread above, is that I won't use pywin32 GUI code at all, as
all the GUI code is provided by wxPython and the underlying platform.
So, in theory, the SaveDialog "freezing" experienced by the thread
above should not happen... in theory...

Thank you for your help and suggestions.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/


More information about the python-win32 mailing list