What is the size of a blog?
Get Firefox URL?
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Visual Basic Programming > Get Firefox URL? 24 July 2008 18:42:25

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Get Firefox URL?

Learner 24 July 2008 18:42:25
 Does anyone know a way to get the URL from the Firefox Address Bar?
I've seen similar questions archived in Google Groups but no definite
answer with any example code. There MUST be a way. I've tried various
window-spying apps but none of them have shed any light on it. All I've
found is that the Firefox Address Bar seems to be some sort of custom
control that the Win32 API can't touch. :(­


Add comment
Lallous 17 April 2006 01:37:56 permanent link ]
 Hello

I can suggest a way that is sure to work, but requires you to do some
learning first:

1. Learn about plugin development for FireFox and how you can through an FF
plugin get the address bar
2. From that plugin, establish IPC (interprocess communication) with your
main application and pass to it the address bar URL.

HTH
Elias
"Learner" <learner@invalid.co­m> wrote in message
news:444075dd$1@dne­ws.tpgi.com.au...> Does anyone know a way to get the URL from the Firefox Address Bar?> I've seen similar questions archived in Google Groups but no definite> answer with any example code. There MUST be a way. I've tried various> window-spying apps but none of them have shed any light on it. All I've> found is that the Firefox Address Bar seems to be some sort of custom> control that the Win32 API can't touch. :(­>


Add comment
Learner 17 April 2006 05:50:13 permanent link ]
 "lallous" <lallous@lgwm.org> wrote in message
news:4afrplFsveauU1­@individual.net...> Hello>
I can suggest a way that is sure to work, but requires you to do some > learning first:>
1. Learn about plugin development for FireFox and how you can through an > FF plugin get the address bar> 2. From that plugin, establish IPC (interprocess communication) with your > main application and pass to it the address bar URL.>
Elias> "Learner" <learner@invalid.co­m> wrote in message > news:444075dd$1@dne­ws.tpgi.com.au...>> Does anyone know a way to get the URL from the Firefox Address Bar?>> I've seen similar questions archived in Google Groups but no definite>> answer with any example code. There MUST be a way. I've tried various>> window-spying apps but none of them have shed any light on it. All I've>> found is that the Firefox Address Bar seems to be some sort of custom>> control that the Win32 API can't touch. :(­

Thanks, but it can't be done as a plug-in as I can't install anything on the
PC.


Add comment
Alf P. Steinbach 17 April 2006 10:11:29 permanent link ]
 * Learner:>
Thanks, but it can't be done as a plug-in as I can't install anything on the > PC.

A program you're creating is going to be installed. Think about it.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Add comment
Argusy 17 April 2006 16:13:29 permanent link ]
 Oh, Alf, the OP didn't mention anything about writing any programs of any
flavour, VB or otherwise, though he did mention "example code" (which could
imply he may be able to write/assemble something in some language)

His last reply is then confusing. Maybe his PC is controlled by a very tight
IT department.

Learner, unless you can enlighten those in the newsgroup about what you CAN do,
this post could be a bit drawn out

My gut feeling is that you may be looking in the wrong newsgroup for an answer,
if it's not a Classic Visual Basic answer you require

Argusy

Alf P. Steinbach wrote:> * Learner:>
Thanks, but it can't be done as a plug-in as I can't install anything >> on the PC.>
A program you're creating is going to be installed. Think about it.>

Add comment
Mayayana 18 April 2006 01:44:53 permanent link ]
 I got curious about this and checked it out.

(I also took pity because you seem to be
attracting self-righteous open source people
who are usually less interested in helping than
they are interested in "setting others straight"
about trivial issues like top-posting. :)­

I worked out the following that may be useful -
Doable but not easy.....

The main window - everything except title bar -
is the parent window. In Spy++ the only
child windows are the basic webpage view and
the favicon 16 sq. px. window.

In AccExplorer (Active Accessibility view)
it turns out that the toolbar area is a tool bar
object that has the same window handle as the
parent. So the toolbar is not even a window,
much less the location bar.

You can get at it with AA if you want to,
but it's not easy. You have to get the parent
window that has "Mozilla Firefox", then get it's
application child, which has the same name.
Then you have to iterate children to find
the child toolbar...then to that object's
child combo box....and finally to that child's
editable text object. Those are all aspects of one
window with the same hWnd.

If you want to use that method see here for
sample code:

http://www.jsware.n­et/jsware/vbcode.php­3

Active Accessibility was designed for use by
screen readers for the blind. It allows you to
dissect nearly any window, but the AA system
is a bit half-baked. It's tedious to use. On the
bright side, if you need it for something specific,
as you do, you can download the AA SDK, which
includes AccExplorer (like Spy++). With AccExplorer
you can see the window hierarchy and write your
code based on that.
Does anyone know a way to get the URL from the Firefox Address Bar?> I've seen similar questions archived in Google Groups but no definite> answer with any example code. There MUST be a way. I've tried various> window-spying apps but none of them have shed any light on it. All I've> found is that the Firefox Address Bar seems to be some sort of custom> control that the Win32 API can't touch. :(­>


Add comment
Learner 20 April 2006 17:07:45 permanent link ]
 
A program you're creating is going to be installed. Think about it.

Never run an app from a remote location, eh? Tsk. Think about it.


Add comment
Learner 20 April 2006 17:08:54 permanent link ]
 "mayayana" <mayayanaXX1a@mindX­Xspring.com> wrote in message
news:p­%T0g.5702$sq5­.2633@newsread2.news­.atl.earthlink.net..­.>I got curious about this and checked it out.>
(I also took pity because you seem to be> attracting self-righteous open source people> who are usually less interested in helping than> they are interested in "setting others straight"> about trivial issues like top-posting. :)­>
I worked out the following that may be useful -> Doable but not easy.....>
The main window - everything except title bar -> is the parent window. In Spy++ the only> child windows are the basic webpage view and> the favicon 16 sq. px. window.>
In AccExplorer (Active Accessibility view)> it turns out that the toolbar area is a tool bar> object that has the same window handle as the> parent. So the toolbar is not even a window,> much less the location bar.>
You can get at it with AA if you want to,> but it's not easy. You have to get the parent> window that has "Mozilla Firefox", then get it's> application child, which has the same name.> Then you have to iterate children to find> the child toolbar...then to that object's> child combo box....and finally to that child's> editable text object. Those are all aspects of one> window with the same hWnd.>
If you want to use that method see here for> sample code:>
Active Accessibility was designed for use by> screen readers for the blind. It allows you to> dissect nearly any window, but the AA system> is a bit half-baked. It's tedious to use. On the> bright side, if you need it for something specific,> as you do, you can download the AA SDK, which> includes AccExplorer (like Spy++). With AccExplorer> you can see the window hierarchy and write your> code based on that.>
Does anyone know a way to get the URL from the Firefox Address Bar?>> I've seen similar questions archived in Google Groups but no definite>> answer with any example code. There MUST be a way. I've tried various>> window-spying apps but none of them have shed any light on it. All I've>> found is that the Firefox Address Bar seems to be some sort of custom>> control that the Win32 API can't touch. :(­

Thanks mayayana, I will look into your suggestions. I am coding in VB5 Pro
and cross-posted to *.win32 as I don't mind using an API solution. Thanks!


Add comment
Alf P. Steinbach 20 April 2006 17:16:58 permanent link ]
 * Learner:>> A program you're creating is going to be installed. Think about it.>
Never run an app from a remote location, eh? Tsk. Think about it.

Took you some time to come up with that rejoinder, didn't it?

If you can run your own application from the network, but are forbidden
to install it locally, you should talk with your IT department.

Because then they have a security issue.

Also, do heed the advice of "argusy":

"... unless you can enlighten those in the newsgroup about what you
CAN do, this post could be a bit drawn out"

To help you solve your problem we need to know a bit more than you have
provided so far.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Add comment
Dag Sunde 21 April 2006 01:31:04 permanent link ]
 "Frank Adam" <fajp@xxxxoptushome­.com.au> skrev i melding
news:i4vf429u7h3kfk­847c2kpg18soj4a8dkjr­@4ax.com...> On 20 Apr 2006 22:54:37 +0200, "Dag Sunde" <me@dagsunde.com> wrote:>
<snipped/>>>There is (thankfully) a long time since the last time we had>>such a rude person here on c.l.b.v.m...>>
Oh, it hasn't been that long.. and i'm still lurking. ;-)­
You're been at it for so long now Frank, so you're lost the
power to insult. And yoy don't even reach the kneecaps of Neila!

:-D­

--
Dag.


Add comment
Alf P. Steinbach 21 April 2006 01:41:36 permanent link ]
 * Dag Sunde:> * Alf P. Steinbach:>> Read up on netiquette, please.>
Eh?>
Sorry Alf, but I was writing the above in defense/support of you.

Oh.

I was mislead by the phrase "And to you, xxx", which indicated that the
text before that was addressed to someone else, i.e. me.

And I have some times written things that some people have found to be
rude -- I generally don't beat around the bush, but try to "think
straight, talk straight", as one company's motto had it -- so it
/could/ reasonably have been addressed to me, with a historical view.

However, just in case some future employer skims Google's archives for
old postings, I'm generally a very polite and nice person. ;-)­

To wit, I chose to not reply to the OP's last comment, which I think is
in general the best response to such things.


--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Add comment
Grzegorz Wrbel 21 April 2006 10:03:15 permanent link ]
 mayayana wrote:>
Alf's response consisted of a 1-line wisecrack> and a 4-line cranky complaint about posting format.> I was thinking it was *that* sort of thing that doesn't> often show up here.

The "1-line wisecrack" pinpointed an obvious fact, the OP seemed to be missing, that if you can execute your code on a machine you can do almost everything and that may include installation of some of application's components. It's another story that any solution that does not require that is much better.

"4-line cranky complaint about posting format" is actually his signature. It seems to some it can be as annoying as top posting can be for others, but I quess it's a purpose of it.

--
677265676F727940346­E6575726F6E732E636F6­D
Add comment
J French 21 April 2006 10:49:13 permanent link ]
 On Fri, 21 Apr 2006 08:03:15 +0200, =?ISO-8859-1?Q?Grze­gorz_Wr=F3bel?=
</dev/null@localhos­t.localdomain> wrote:
mayayana wrote:>>
Alf's response consisted of a 1-line wisecrack>> and a 4-line cranky complaint about posting format.>> I was thinking it was *that* sort of thing that doesn't>> often show up here.
The "1-line wisecrack" pinpointed an obvious fact, the OP seemed to be missing, that if you can execute your code on a machine you can do almost everything and that may include installation of some of application's components. It's another story that any solution that does not require that is much better.
"4-line cranky complaint about posting format" is actually his signature. It seems to some it can be as annoying as top posting can be for others, but I quess it's a purpose of it.

I think I can see what might be going on, 'Learner' is running his App
off a network drive (or possibly CD ROM)

The local system is completely locked down, possibly 'virtual',
possibly 'unknown', possibly 'self restoring'.

I think Mayana's Windows snooping solution is the best idea.
Here is a simple Snooper that I use for determining whether something
is 'painted' or a control ( I don't have Firefox so I'm not sure
whether it is easy to interrogate) :-

Option Explicit

' Add one Timer

Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos _
Lib "user32" _
(lpPoint As POINTAPI) As Long

Private Declare Function WindowFromPoint _
Lib "user32" _
(ByVal xPoint As Long, _
ByVal yPoint As Long) As Long

Private Declare Function GetClassName _
Lib "user32" _
Alias "GetClassNameA" _
(ByVal hwnd As Long, _
ByVal lpClassName As String, _
ByVal nMaxCount As Long) As Long

Private Declare Function SendMessage _
Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Private Const WM_GETTEXT = &HD


Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 500
End Sub

Private Function WindowInf() As String
Dim Hnd As Long, Buff$, Q&
Dim PT As POINTAPI

GetCursorPos PT
Hnd = WindowFromPoint(PT.­X, PT.Y)

WindowInf = Str$(Hnd)
' ---
Buff$ = Space$(255)
Q& = GetClassName(Hnd, Buff$, Len(Buff$))
WindowInf = WindowInf + ":" + Left$(Buff$, Q)
' ---
Q& = SendMessage(Hnd, WM_GETTEXT, Len(Buff$), ByVal Buff$)
WindowInf = WindowInf + ":" + Left$(Buff$, Q)
Text1.Text = Left$(Buff$, 10)

End Function


Private Sub Timer1_Timer()
Me.Caption = WindowInf
End Sub





Add comment
Learner 21 April 2006 11:48:23 permanent link ]
 
"mayayana" <mayayanaXX1a@mindX­Xspring.com> wrote in message
news:LLV1g.9481$i41­.7278@newsread1.news­.atl.earthlink.net..­.
And to you, "Learner"... with that attitude you're going to have>> a hard time getting help in this NG.>
Interesting that you saw it that way. I don't mean to> start an argument, and of course "Learner" didn't> need to be rude, but he asked a simple question> and got two smug, dismissive answers that were not> particularly relevant, and that implied he didn't know> what he was talking about but might succeed if he's> "willing to learn".

THANK YOU. Someone who can see what's really going on. :)­


Add comment
Grzegorz Wrbel 21 April 2006 12:51:04 permanent link ]
 J French wrote: > I think I can see what might be going on, 'Learner' is running his App> off a network drive (or possibly CD ROM)>
The local system is completely locked down, possibly 'virtual',> possibly 'unknown', possibly 'self restoring'.>
I think Mayana's Windows snooping solution is the best idea.> Here is a simple Snooper that I use for determining whether something> is 'painted' or a control ( I don't have Firefox so I'm not sure> whether it is easy to interrogate) :-

I have Firefox among other browser installed and a quick look in Spy++ reveals that the problem here is that practically all Firefox's "controls" are titless "MozillaWindowClass­" and "MozillaDropShadowW­indowClass" top-level windows. This mess is most likely the result of portability issues ad the fact that this browser has not been designed for a particular platform. Even if you isolate the proper window for once by monitoring window messages it will be hard to build a simple algorithm that finds this specific window.

--
677265676F727940346­E6575726F6E732E636F6­D
Add comment
J French 21 April 2006 13:11:39 permanent link ]
 On Fri, 21 Apr 2006 10:51:04 +0200, =?ISO-8859-2?Q?Grze­gorz_Wr=F3bel?=
</dev/null@localhos­t.localdomain> wrote:
J French wrote:> > I think I can see what might be going on, 'Learner' is running his App>> off a network drive (or possibly CD ROM)>>
The local system is completely locked down, possibly 'virtual',>> possibly 'unknown', possibly 'self restoring'.>>
I think Mayana's Windows snooping solution is the best idea.>> Here is a simple Snooper that I use for determining whether something>> is 'painted' or a control ( I don't have Firefox so I'm not sure>> whether it is easy to interrogate) :-
I have Firefox among other browser installed and a quick look in Spy++> reveals that the problem here is that practically all Firefox's "controls" >are titless "MozillaWindowClass­" and "MozillaDropShadowW­indowClass" >top-level windows. This mess is most likely the result of portability issues >ad the fact that this browser has not been designed for a particular platform. >Even if you isolate the proper window for once by monitoring window >messages it will be hard to build a simple algorithm that finds this specific window.

Hmm ...

Maybe some other info on the Window

GetWindowContextHel­pId
GetClassName - we've tried that
GetWindowLong - and look at GWL_STYLE and GWL_EXSTYLE

There must be something (or some combination of things) that are
unique about that Window
Add comment
Grzegorz Wrbel 21 April 2006 15:10:56 permanent link ]
 J French wrote:
On Fri, 21 Apr 2006 10:51:04 +0200, =?ISO-8859-2?Q?Grze­gorz_Wr=F3bel?=> </dev/null@localhos­t.localdomain> wrote:>
J French wrote:>>
I think I can see what might be going on, 'Learner' is running his App>>>off a network drive (or possibly CD ROM)>>>
The local system is completely locked down, possibly 'virtual',>>>possib­ly 'unknown', possibly 'self restoring'.>>>
I think Mayana's Windows snooping solution is the best idea.>>>Here is a simple Snooper that I use for determining whether something>>>is 'painted' or a control ( I don't have Firefox so I'm not sure>>>whether it is easy to interrogate) :->
I have Firefox among other browser installed and a quick look in Spy++>>reveals that the problem here is that practically all Firefox's "controls" >>are titless "MozillaWindowClass­" and "MozillaDropShadowW­indowClass" >>top-level windows. This mess is most likely the result of portability issues >>ad the fact that this browser has not been designed for a particular platform. >>Even if you isolate the proper window for once by monitoring window >>messages it will be hard to build a simple algorithm that finds this specific window.>
Hmm ...>
Maybe some other info on the Window>
GetWindowContextHel­pId> GetClassName - we've tried that> GetWindowLong - and look at GWL_STYLE and GWL_EXSTYLE>
There must be something (or some combination of things) that are> unique about that Window

If the OP's is going to use this approach, finding something unique about that window is the way to go. But that's the OP's homework.
Then, there still will be a need to face a problem of retrieving the actual url text, since it is not standard combobox.
Looks like quite a lot of ugly, hacking job, for the simple thing.

--
677265676F727940346­E6575726F6E732E636F6­D
Add comment
J French 21 April 2006 16:45:58 permanent link ]
 On Fri, 21 Apr 2006 13:10:56 +0200, =?ISO-8859-1?Q?Grze­gorz_Wr=F3bel?=
</dev/null@localhos­t.localdomain> wrote:
<snip>
If the OP's is going to use this approach, finding something unique about that window is the way to go. But that's the OP's homework.>Then, there still will be a need to face a problem of retrieving the actual url text, since it is not standard combobox.>Looks like quite a lot of ugly, hacking job, for the simple thing.

Have you waved my Window From Point sniffer over the Firefox URL
dropdown Edit

I don't really want to install FireFox myself
Add comment
Mayayana 21 April 2006 17:26:31 permanent link ]
 
Here is a simple Snooper that I use for determining whether something> is 'painted' or a control ( I don't have Firefox so I'm not sure> whether it is easy to interrogate) :->

That's a clever little gizmo. It doesn't show anything
over Firefox, though, except for the extra title bar
text.
I've never understood why it's so hard to track
Windows with the API, but it does seem to
be limited.

I posted the Active Accessibility info.
because the only hWnd with Firefox's address bar
is several levels up. AA identifies several
controls but they're all within the same hWnd. I don't
know what sort of API is inside AA's oleacc.dll, but it
can read virtually anything if one is willing to write
enough code.


Add comment
Mayayana 21 April 2006 17:39:42 permanent link ]
 
Alf's response consisted of a 1-line wisecrack> > and a 4-line cranky complaint about posting format.> > I was thinking it was *that* sort of thing that doesn't> > often show up here.>
The "1-line wisecrack" pinpointed an obvious fact, the OP seemed to be
missing, that if you can execute your code on a machine you can do almost
everything and that may include installation of some of application's
components. It's another story that any solution that does not require that
is much better.>

The OP had already made clear that he wanted a Windows
approach, not a Mozilla approach. Maybe he hasn't thought it
through, but I didn't see any reason to assume that. It just
made sense to me that he's programming in Windows...he
wants a window property...he shouldn't have to get into some
3rd-party API - and support files - to get that.
"4-line cranky complaint about posting format" is actually his signature.
It seems to some it can be as annoying as top posting can be for others, but
I quess it's a purpose of it.>
Signature or not, he put it into his post.
It reminds me of the old "Thank you for not smoking".
A passive-aggressive confrontation that says, "Not
only will I not relate to your smoking, but I also won't
relate to you, your aggression, or my aggression."
It's the sort of thing one usually only sees on Linux
groups where the posters are all short on sunlight
and sleep. :)­

___________________­____________________­
Please respect the newsgroup rules and tell
me that my post is brilliant. Oh...and send money if
you can.
___________________­____________________­



Add comment
J French 21 April 2006 18:16:55 permanent link ]
 On Fri, 21 Apr 2006 13:39:42 GMT, "mayayana"
<mayayanaXX1a@mindX­Xspring.com> wrote:

He is new as hell

- otherwise he would not be rude to old c*nts

Mostly, I reckon he'll get an answer
- we tend to chew on problems

Oddly, I like miscreants who work out well

They tend to get 'smart'
Add comment


Alf P. Steinbach 21 April 2006 18:17:09 permanent link ]
 * mayayana:>
The OP had already made clear that he wanted a Windows> approach, not a Mozilla approach. Maybe he hasn't thought it> through, but I didn't see any reason to assume that. It just> made sense to me that he's programming in Windows...he> wants a window property...he shouldn't have to get into some> 3rd-party API - and support files - to get that.

A few incorrect assumptions: (1) that a pure general Windows approach is
all that's required to interrogate a specific process' state, (2) that
an application-specifi­c approach is necessarily implied by using the
access you have when running as a Windows application, (3) that Firefox'
current URL is available as some kind of API-level window property.

I'll refrain from listing the incorrect, wishful assumptions relating to
motivations and so on.

Incorrect assumption (1) is perhaps the easiest to comprehend the
incorrectness of. Where do you draw the line about using
application-specifi­c knowledge? What is "allowed", in your view? And,
importantly, can you demonstrate that that's enough for the Firefox URL?
Note that /some/ application-specifi­c knowledge is required however
you do this, so you have some very arbitrary line drawn somewhere.

"4-line cranky complaint about posting format" is actually his signature.> It seems to some it can be as annoying as top posting can be for others, but> I quess it's a purpose of it.> Signature or not, he put it into his post.

As noted in another current c.o.m-w.p.win32 thread, where someone asked
for permission to also use the signature, that signature has been
adopted in at least one FAQ for how to post on certain groups, so it's
not the case that people generally find it disagreeable.

You, personally, disagree with my signature, fine.

You label it is a cranky comment about posting format that I used
instead of a proper reply, suppressing the fact that it's a signature
and adding emotional content that you have no basis for inferring:
that's absolutely not fine, that's intentional misrepresentation, unless
you don't know what a signature is, which I don't believe.

Having said that, back to the technical.

Your idea of using accessibility was ingenious, and could have worked.
However, it seems that Firefox 1.5* does not yet support Windows
accessibility. At least, the Windows built-in "Joe" speaks only the
window title and nothing of the contents (note to those who'd like to
experiment: just using that thing messed up my toolbar icons...).

I guess if disk access is prohibited (e.g., there is no local disk) then
one way to proceed technically could be to infuse a DLL into the
Firefox process. But the same thing could be achieved much more easily
using a Firefox extension -- one would just have to convince the IT
department to install that extension. I interpret the OP's reluctance
to discuss these environmental issues as a sign that the question is
really about cracking: there, now I've brought it out into the open.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Add comment
Grzegorz Wrbel 21 April 2006 22:13:21 permanent link ]
 J French wrote:> Have you waved my Window From Point sniffer over the Firefox URL> dropdown Edit>
I don't really want to install FireFox myself

Frankly, I'm not burning with the desire to install Visual Basic for that. :)­

--
677265676F727940346­E6575726F6E732E636F6­D
Add comment


Grzegorz Wrbel 22 April 2006 00:48:32 permanent link ]
 mayayana wrote:>
The OP had already made clear that he wanted a Windows> approach, not a Mozilla approach. Maybe he hasn't thought it> through, but I didn't see any reason to assume that. It just> made sense to me that he's programming in Windows...he> wants a window property...he shouldn't have to get into some> 3rd-party API - and support files - to get that.

This is your subjective perception, as you admited yourself. And I believe your perception misleads you here.
The OP didn't say nor "made clear" in any way he want to use some specific approach. He wrote "He can't" use approach suggested by lallous, because he "can't install anything on the PC". That's entire difference. If he really said he didn't want to install anything because trashing a system with third party components is a bad idea (and he would be right) the discussion would be over.

Alf simply questioned inability of installing anything on a PC. Such inability is quite unusual thing and the OP didn't provide any reason for that. The form he used perhaps wasn't very fortunate but I wouldn't take it as rude. Nor, presumably, would anyone at comp.os.ms-windows.­programmer.win32 where Alf is well known and respected contributor. But I can try to imagine how it could be received by someone at comp.lang.basic.vis­ual.misc who saw his post for the first time. Still it's not the reason for giving him more rude responces nor even starting this off-topic conversation I made the mistake getting involved into. But that's my last off-topic reply in this thread.
Signature or not, he put it into his post.
I really don't know how to comment on this. I was certain you simply didn't notice it's a signature, otherwise you wouldn't comment it.

--
677265676F727940346­E6575726F6E732E636F6­D
Add comment
Mayayana 22 April 2006 17:50:36 permanent link ]
 I got to playing around with the Active Accessibility
approach. I don't know whether this is really a usable
solution, but it's interesting. This is VB6 code. I guess
it's about the same for VB5.
This code would need some adjustments for your
purpose, but this shows it can be done, at least.

As for AA, it's in Windows at least as far back as
Win98, but I'm not certain that it's always installed
by default.

-------------------­--------------------­-------
Set the following code if a form named "F1":

Private Sub bHook_Click()
Hook
End Sub

Private Sub bUnhook_Click()
UnHook
End Sub

Place 2 buttons, as named above, with captions "hook" and
"unhook".

Place a textbox named "Text1"
-------------------­----------------

In a module add this code (Reference to Accessibility needed in
Project -> References. Lib. is oleacc.dll. Set "Show hidden
Objects" in object browser if you want intellisense.)

Public Const EVENT_MIN = 1&
Private Const ROLE_COMBOBOX = &H2E&
Private Const OB_ACCELERATORCHANG­E = &H8012&
Private Const SYS_ALERT = 2&
Public Const WINEVENT_SKIPOWNPRO­CESS = 2&
Public Const OB_REORDER = &H8004&

Private Declare Function SetWinEventHook Lib "user32.dll" (ByVal eventMin As
Long, ByVal eventMax As Long, ByVal hmodWinEventProc As Long, ByVal
pfnWinEventProc As Long, ByVal idProcess As Long, ByVal idThread As Long,
ByVal dwFlags As Long) As Long
Private Declare Function UnhookWinEvent Lib "user32.dll" (ByVal lHandle As
Long) As Long
Private Declare Function AccessibleObjectFro­mEvent Lib "oleacc" (ByVal HWnd
As Long, ByVal dwId As Long, ByVal dwChildId As Long, ppacc As IAccessible,
pvarChild As Variant) As Long

Private LHook As Long

Public Sub Hook()
Dim LRet As Long
LHook = SetWinEventHook(SYS­_ALERT, OB_ACCELERATORCHANG­E, 0&, AddressOf
WinEventFunc, 0, 0, WINEVENT_SKIPOWNPRO­CESS)
End Sub

Public Sub UnHook()
Dim LRet As Long
If LHook = 0 Then Exit Sub
LRet = UnhookWinEvent(LHoo­k)
End Sub

Public Function WinEventFunc(ByVal HookHandle As Long, ByVal LEvent As Long,
ByVal HWnd As Long, ByVal idObject As Long, ByVal idChild As Long, ByVal
idEventThread As Long, ByVal dwmsEventTime As Long) As Long
Dim ObA As IAccessible
Dim LRet As Long
Dim V As Variant
Dim s As String, s1 As String, sName As String
On Error Resume Next

Select Case LEvent

Case OB_REORDER
LRet = AccessibleObjectFro­mEvent(HWnd, idObject, idChild, ObA, V)

If LRet = 0 Then
F1.Text1.Text = "--"
If CLng(ObA.accRole(V)­) = 46 Then '-- combobox.
If ObA.accName(V) = "Location" Then
F1.Text1.Text = ObA.accValue(V)
End If
End If
End If

End Select
WinEventFunc = 0
End Function

-------------------­------------

Open Firefox, run the project, click "Hook".
Edit the Firefox location bar.
You should see the text in Text1 keep up
with any changes you make in Firefox's
location bar.




Add comment


Learner 25 April 2006 07:30:30 permanent link ]
 "mayayana" <mayayanaXX1a@mindX­Xspring.com> wrote in message news:Mwq2g.7665$sq5­.4305@newsread2.news­.atl.earthlink.net..­.> I got to playing around with the Active Accessibility> approach. I don't know whether this is really a usable> solution, but it's interesting. This is VB6 code. I guess> it's about the same for VB5.> This code would need some adjustments for your> purpose, but this shows it can be done, at least.>
As for AA, it's in Windows at least as far back as> Win98, but I'm not certain that it's always installed> by default.>
-------------------­--------------------­-------> Set the following code if a form named "F1":>
Private Sub bHook_Click()> Hook> End Sub>
Private Sub bUnhook_Click()> UnHook> End Sub>
Place 2 buttons, as named above, with captions "hook" and> "unhook".>
Place a textbox named "Text1"> -------------------­---------------->
In a module add this code (Reference to Accessibility needed in> Project -> References. Lib. is oleacc.dll. Set "Show hidden> Objects" in object browser if you want intellisense.)>
Public Const EVENT_MIN = 1&> Private Const ROLE_COMBOBOX = &H2E&> Private Const OB_ACCELERATORCHANG­E = &H8012&> Private Const SYS_ALERT = 2&> Public Const WINEVENT_SKIPOWNPRO­CESS = 2&> Public Const OB_REORDER = &H8004&>
Private Declare Function SetWinEventHook Lib "user32.dll" (ByVal eventMin As> Long, ByVal eventMax As Long, ByVal hmodWinEventProc As Long, ByVal> pfnWinEventProc As Long, ByVal idProcess As Long, ByVal idThread As Long,> ByVal dwFlags As Long) As Long> Private Declare Function UnhookWinEvent Lib "user32.dll" (ByVal lHandle As> Long) As Long> Private Declare Function AccessibleObjectFro­mEvent Lib "oleacc" (ByVal HWnd> As Long, ByVal dwId As Long, ByVal dwChildId As Long, ppacc As IAccessible,> pvarChild As Variant) As Long>
Private LHook As Long>
Public Sub Hook()> Dim LRet As Long> LHook = SetWinEventHook(SYS­_ALERT, OB_ACCELERATORCHANG­E, 0&, AddressOf> WinEventFunc, 0, 0, WINEVENT_SKIPOWNPRO­CESS)> End Sub>
Public Sub UnHook()> Dim LRet As Long> If LHook = 0 Then Exit Sub> LRet = UnhookWinEvent(LHoo­k)> End Sub>
Public Function WinEventFunc(ByVal HookHandle As Long, ByVal LEvent As Long,> ByVal HWnd As Long, ByVal idObject As Long, ByVal idChild As Long, ByVal> idEventThread As Long, ByVal dwmsEventTime As Long) As Long> Dim ObA As IAccessible> Dim LRet As Long> Dim V As Variant> Dim s As String, s1 As String, sName As String> On Error Resume Next>
Select Case LEvent>
Case OB_REORDER> LRet = AccessibleObjectFro­mEvent(HWnd, idObject, idChild, ObA, V)>
If LRet = 0 Then> F1.Text1.Text = "--"> If CLng(ObA.accRole(V)­) = 46 Then '-- combobox.> If ObA.accName(V) = "Location" Then> F1.Text1.Text = ObA.accValue(V)> End If> End If> End If>
End Select> WinEventFunc = 0> End Function>
-------------------­------------>
Open Firefox, run the project, click "Hook".> Edit the Firefox location bar.> You should see the text in Text1 keep up> with any changes you make in Firefox's> location bar.

Thanks, I'll give it a go. Looks like it may be what I'm after! :)­


Add comment
Guest 28 April 2006 23:10:47 permanent link ]
 Did you give this a try by chance? I'm trying to accomplish the same
thing so I'd be curious to hear about any success.
Thanks.

Learner wrote:>
Thanks, I'll give it a go. Looks like it may be what I'm after! :)­

Add comment
Pierre 24 July 2008 18:42:25 permanent link ]
 I tried iterating recursively through every child window of Firefox 3 (EnumChildWindows()­ in VC++), and getting the text (SendMessage( hWnd, WM_GETTEXT, MAXSIZE, (LPARAM)tWindowText­)). Every @#$% window has no text (returns empty string).

I'm a Firefox user, but in this respect IE is so much simpler.

All I want is the current URL. Sigh...
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Visual Basic Programming > Get Firefox URL? 24 July 2008 18:42:25

see also:
XML::LibXSLT registered functions: a…
LibXML: Solution Found to XPath and…
Windows XML::LibXSLT load problem
пройди тесты:
see also:
Plugin for firefox
Learning PHP
TuneClone Audio Converter 1.03 Released…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .