473,847 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.GetMod uleHandle(None)
iconPathName= "c:/myapp/myapp.ico"
icon_flags = win32con.LR_LOA DFROMFILE | win32con.LR_DEF AULTSIZE
hicon = win32gui.LoadIm age(hinst, str(iconPathNam e),
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(h icon) leads to nothing, cause it only gets the ID of the
hicon :(

Any ideas / recommendations / tipps?

Harald

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

hinst = win32gui.GetMod uleHandle(None)
iconPathName= "c:/myapp/myapp.ico"
icon_flags = win32con.LR_LOA DFROMFILE | win32con.LR_DEF AULTSIZE
hicon = win32gui.LoadIm age(hinst, str(iconPathNam e),
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(h icon) 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(iconPathNam e).)

HTH,
~Simon

Aug 10 '06 #2

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

Similar topics

5
1538
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.) I have seen <%something%> in an html template page but I am trying to work out how this value is passed. What is this process called? I am sure there must be a lot of online tutorials covering this but I don't seem to be entering the correct...
44
3387
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 expression such as x = (5) * (4+6). Wouldn't it have been better to define tuples with <>'s or {}'s or something else to avoid this confusion?? Perhaps ()'s are a good idea for some other reason I don't know?
0
1290
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 have good idea what exactly it is. please tell me thanks in advance
4
1317
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 should be?
5
1445
by: Osamede Zhang | last post by:
I just can't understand what appSettings means, how it work thanks for your read osamede
0
1077
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 System.Management.ObjectQuery("Select Name, DisplayName from Win32_Service where DisplayName LIKE 'Rescue%' "); Can anyone see what I am doing wrongly here????? Thanks
0
9730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10983
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10648
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10707
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7883
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7056
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4529
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3164
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.