Custom icons per window class/name patch

Earle F. Philhower III earle@ziplabel.com
Sun May 18 04:35:00 GMT 2003


Hi Ralf,

I did some checking in between packing today and it was relatively simple
to get the res_class and res_name of a window in the winCreateWin function,
but the thing is you can't use any XLib calls:  you're the server itself at
that point, and not a client!

I've done a quick-n-easy icon specifier, namely a file called
c:\windows\xwin.ini .  It's a standard old format text INI file with the
[sections] being the class and identifiers=c:\file.ico being the keys.
If a res_name isn't matched, it uses the _default key for the icon.  If
the res_class isn't matched, the default X icon is used...
Ex:
[XLoad]
_default=z:\tmp\xload.ico

[Fig]
_default=z:\tmp\xfig.ico
file_popup=z:\tmp\file.ico

Note you need Windoze paths since I call the API LoadImage() to get the ICO
into a handle.  Use "xprop" to get the res_name and res_class of a window.

There are 2 new small files, I created them in because they need special
includes that the main files don't need or want.

Feel free to use this as a base to add a nicer UI and maybe use XPMs and other
image formats instead of plain Windoze .icos...


-Earle F. Philhower, III
  earle@ziplabel.com
  cdrlabel - ZipLabel - FlpLabel
  http://www.cdrlabel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icons_patch.tar.bz2
Type: application/octet-stream
Size: 3622 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-xfree/attachments/20030518/c0ca44aa/attachment.obj>


More information about the Cygwin-xfree mailing list