"xbmuncher" <[EMAIL PROTECTED]> wrote

I want to make a program in python that knows the current url of the active tab in firefox. I want to be able to right click anywhere in my system,
notepad, firefox..etc.. and be able to see an added menu option.
Any pointers on doing this?

This is impossible, sorry.
You can get some of it to work, you might even get all of it to work
some of the time, but you can't get all of it to work all of the time.
You simply don't have that much control, nor should you!

Summary of goals:
1. retrieve url of current tab from firefox

That should be possible with some deep digging into the internals
of FireFox's COM model or, if necessary, into its window tree.

2. add right click option that displays anywhere I right click the mouse in
windows xp, notepad, a browser, desktop..wherever

This is the tricky bit. Every program has the option of creating
its own right-click menu and it may not expose that in such a
way that you can add items to it. Some older Windows apps
draw their own right click menus bypassing the Windows
widget set and for those you have no chance (or if you do you
will likely destroy the apps own menu system!). Even for those
that use the standard Windows mechanisms it might be tricky.
I think you will need to monitor the running task list and every
time a new task starts your code will have to attach its
menu item to that application. Even then things like X windows
under cygwin has its own menuing system quite separate to
Windows and I doubt it will be possible there without also
writing a cygwin/X version of your code.

Messing around with other people's applications is tricky and
trying to do it in a generic way is trickier still.

3. maybe I want to activate an action in windows when I press some key
combinations.. how can I do this with python?

This could be standard windows hot-key functionality.
You can assign hot keys in windows to bring up applications
via the properrties/shortcut dialog.

I don't kow your level of skill with Windows programming
or Python but this may be a lot harder than you think. Its
certainly not a project I'd recommend for a beginner in Python.

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to