473,396 Members | 1,961 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,396 software developers and data experts.

Associating file types to my Python program

How could I do that? I'm writing an image viewer and I would
want to associate all images to be opened with my proggie when
they are double-clicked.
Jul 18 '05 #1
1 1622

"Psymaster" <ro*********@hotmail.com> wrote in message
news:Xn***********************@130.133.1.4...
How could I do that? I'm writing an image viewer and I would
want to associate all images to be opened with my proggie when
they are double-clicked.


Do you really want to do that? I'd advise going a bit
slow, and just get an item on the context menu for
starters. Look at HKCR\SystemFileAssociations\Image\Shell
and put your command in there. It will pop up on
the context menu for all file extensions that have
a "PercievedType" of "Image", at least under Windows XP.

Then if you want to make some of them the default,
you can go ahead, but that's actually a bit more
difficult since it has to be done file type by file type;
there's no way of doing it wholesale.

Just remember one thing: learn the registry editor
thoroughly first. Appendix A of the Microsoft
Windows XP Registry Guide can be quite helpful
if you want to hack file associations.

John Roth
Jul 18 '05 #2

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

Similar topics

8
by: Jacek Generowicz | last post by:
I am writing an extension type, and wish to add some magic methods which are not catered for by the tp_<whatever> slots (eg tp_init -> __init__) in PyTypeObject. My methods seem to work correctly...
24
by: Matt Feinstein | last post by:
Hi all-- I'm new to Python, and was somewhat taken aback to discover that the core language lacks some basic numerical types (e.g., single-precision float, short integers). I realize that there...
6
by: Peter Hansen | last post by:
Greetings. Im trying to write a program that can be run from the command line. If I want to search for example after a file with the ending .pdf, I should be able to write in the command line:...
9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
6
by: Bill English | last post by:
How do I associate file types with my application, and use its icon? Also is there an event I can use for when my application is loaded by opening those filetypes? Ex. Open a .rtf, and I want my...
0
by: zerodot | last post by:
string keyName; string keyValue; keyName = "MyApp"; keyValue = "My App"; RegistryKey key,subkey; key = Registry.ClassesRoot.CreateSubKey(keyName); key.SetValue("",keyValue); subkey =...
8
by: Penny | last post by:
Hi All, I have a continuous form which shows meetings that consultants have booked for certain timeslots. The text of the field displays a short description of the appointment and I want to set...
1
by: asger_gronnow | last post by:
Hi I'm having trouble associating file types with my app. Associating a file type works as long as the file type is already associated with another program but if the file type doesn't exist...
3
by: bg_ie | last post by:
Hi, Lets say I have a TreeView with nodes that represent objects of a number of different types. Is there a way of associating the Set method of each object with its node in the TreeView? That...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.