473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

win32 load icon not from file, but from <something>

I have found a "make a icon in traybar" skript, and it loads its Icon
from a file

hinst = win32gui.GetModuleHandle(None)
iconPathName= "c:/myapp/myapp.ico"
icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE
hicon = win32gui.LoadImage(hinst, str(iconPathName),
win32con.IMAGE_ICON, 0, 0, icon_flags)

that works great.

But now I have to distribute that icon together with the application -
that is one file more to take track. I would like to load this image
from <something>
with something being a string / a cStringIO / something pickled

The obvious

cPickle.dumps(hicon) leads to nothing, cause it only gets the ID of the
hicon :(

Any ideas / recommendations / tipps?

Harald

Aug 10 '06 #1
1 2588
GHUM wrote:
I have found a "make a icon in traybar" skript, and it loads its Icon
from a file

hinst = win32gui.GetModuleHandle(None)
iconPathName= "c:/myapp/myapp.ico"
icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DEFAULTSIZE
hicon = win32gui.LoadImage(hinst, str(iconPathName),
win32con.IMAGE_ICON, 0, 0, icon_flags)

that works great.

But now I have to distribute that icon together with the application -
that is one file more to take track. I would like to load this image
from <something>
with something being a string / a cStringIO / something pickled

The obvious

cPickle.dumps(hicon) leads to nothing, cause it only gets the ID of the
hicon :(

Any ideas / recommendations / tipps?

Harald
Write the data to a temporary file and load it from there.

(Also, iconPathName is already a string, you don't have to call
str(iconPathName).)

HTH,
~Simon

Aug 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Phil Latio | last post by:
I have a number of basic PHP books but they don't cover passing variables into an HTML template which is called into a PHP script. (I am trying to keep the mark-up and the execution code seperate.)...
44
by: seberino | last post by:
Tuples are defined with regards to parentheses ()'s as everyone knows. This causes confusion for 1 item tuples since (5) can be interpreted as a tuple OR as the number 5 in a mathematical...
0
by: vinod | last post by:
Dear Experts, I'm vinod, a happiest member of this forum, i've another doubt please explain me what is information_schema.<table> i'm using this to get some information from database. but i didnt...
4
by: Christopher Pisz | last post by:
I've seen this alot. I imagine the "I", stand for interface. Usually I see two files: SomeClass.h ISomeClass.h Can someone explain this practice and what the differance between the two files...
5
by: Osamede Zhang | last post by:
I just can't understand what appSettings means, how it work thanks for your read osamede
0
by: jfarr | last post by:
Hi all, I must be missing some syntax here, but for the life of me I cannot figure out what it might be. Here is my query; System.Management.ObjectQuery oQuery = new...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.