473,387 Members | 1,585 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.

Creating a Custom Browser Toolbar Button to Return Webpage URL

PK
Hello,
I am looking for help on the following. I'm trying to create a custom
browser toolbar button that will do a few things. One that I'm trying
to do at the moment is just simply return the URL of whatever page the
user is visiting.

I wanted to create a Win32 application using VB.NET. If there is a
better way of doing this please let me know. I assume there needs to
be some sort of client side code. I was originally leaning towards
using "Request.Path.ToString" or "Request.ApplicationPath.ToString"
but these require server based execution.

For the time being, I'm creating a simple VB.NET Win32 application
with 1 button. The onclick of which should be able to access the URL
of the existing page. However, since the application isn't part of any
browser yet, I'm unsure of how to access information about the page.

Any ideas on the code to use and how to implement this? I'm looking
for some code examples and direction on how to go about this (ie.
create an executable from the win32 application, etc). Maybe there is
some javaScript that can be used. I will eventually be creating a
toolbar similar to that explained in the following link:
http://msdn.microsoft.com/library/de...als/button.asp.
Jul 17 '05 #1
2 9692
This isn't a .Net group. I have no idea how that might play
into what you want to do. I also don't get what you mean by
"some sort of client side code". If you want to have a toolbar
button isn't that an entirely client-side operation?

I don't know whether this will help but I have a VBScript
package that does what you want. It's an ad-blocking utility
that gets the IMG SRC URLs of the current webpage and
offers to add any selected URLs to the HOSTS file. The IE 5,6
version does it by running the script from a toolbar button.
(I don't know of any way to add a button to IE4, Mozilla or Opera.)

The script finds the open IE window that the click came from
by iterating through the Shell.Application Windows collection.
The Windows collection is a collection of Shell Explorer windows
but what is actually returned are IE objects. So ShellApp.Windows
includes all folders and IE instances that are open. Once you've got
that you can use the IE DOM:

'-- Where Win is a Windows collection item:
HTMLofPage = Win.Document.body.innerhtml
URLofPage = Win.LocationURL

For the full code with button sample:
http://www.jsware.net/jsware/zips/hosts.zip

If you make a true browser extension for your button it gets an
IE reference indirectly passed to it. I don't know whether .Net can
build browser extensions. VB can do it through use of a Typelib that
defines the interfaces used.
In the case of just creating a button your
only option, as far as I know, is to open the file of your choice
when the button is clicked. I don't know of a way to get any kind
of pointer to the IE instance with that. (A button gets created through
the Registry Extensions key but it doesn't necessarily have to be
connected with a browser extension.) Hence the ShellApp.Windows
workaround.
I am looking for help on the following. I'm trying to create a custom
browser toolbar button that will do a few things. One that I'm trying
to do at the moment is just simply return the URL of whatever page the
user is visiting.

I wanted to create a Win32 application using VB.NET. If there is a
better way of doing this please let me know. I assume there needs to
be some sort of client side code. I was originally leaning towards
using "Request.Path.ToString" or "Request.ApplicationPath.ToString"
but these require server based execution.

For the time being, I'm creating a simple VB.NET Win32 application
with 1 button. The onclick of which should be able to access the URL
of the existing page. However, since the application isn't part of any
browser yet, I'm unsure of how to access information about the page.

Any ideas on the code to use and how to implement this? I'm looking
for some code examples and direction on how to go about this (ie.
create an executable from the win32 application, etc). Maybe there is
some javaScript that can be used. I will eventually be creating a
toolbar similar to that explained in the following link:

http://msdn.microsoft.com/library/de...owser/ext/tuto
rials/button.asp.
Jul 17 '05 #2
This isn't .net, but it will return the current URL from netscape or IE ...
http://vbnet.mvps.org/code/internet/browserurl.htm

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"PK" <ea****@hotmail.com> wrote in message
news:7e**************************@posting.google.c om...
: Hello,
: I am looking for help on the following. I'm trying to create a custom
: browser toolbar button that will do a few things. One that I'm trying
: to do at the moment is just simply return the URL of whatever page the
: user is visiting.
:
: I wanted to create a Win32 application using VB.NET. If there is a
: better way of doing this please let me know. I assume there needs to
: be some sort of client side code. I was originally leaning towards
: using "Request.Path.ToString" or "Request.ApplicationPath.ToString"
: but these require server based execution.
:
: For the time being, I'm creating a simple VB.NET Win32 application
: with 1 button. The onclick of which should be able to access the URL
: of the existing page. However, since the application isn't part of any
: browser yet, I'm unsure of how to access information about the page.
:
: Any ideas on the code to use and how to implement this? I'm looking
: for some code examples and direction on how to go about this (ie.
: create an executable from the win32 application, etc). Maybe there is
: some javaScript that can be used. I will eventually be creating a
: toolbar similar to that explained in the following link:
:
http://msdn.microsoft.com/library/de...als/button.asp.

Jul 17 '05 #3

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

Similar topics

9
by: jcnews | last post by:
When designing a webpage, is there a way to disable the back button? It must be possible. I am asking because there are certain web applications that I have used that require the user to...
3
by: Shane | last post by:
I am trying to create a custom command bar with three custom buttons, however when I try to make the procedure there is no "CommandBar" option to choose from and is not recognized for the...
2
by: Alvo von Cossel I | last post by:
hi, i asked this question before and got a link to a website that didnt help me. my question was, how do i create a custom control (e.g. a round button or a toolbar that you can drag and drop in...
6
by: G Dean Blake | last post by:
in my aspx app I am writing a stream that works fine but it replaces what is in the client browser window. The code is as follows: .. .. HttpContext.Current.Response.ClearHeaders()...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
15
by: tshad | last post by:
I was looking for a way to handle refreshes (user pressed refresh button) and found a piece of code to check if a Web page was refreshed but I can't get it to work. The code is:...
0
by: toeffetommy | last post by:
Hello, I need a piece of functionality developed for our Website and I need some technical advice on how get there. Essentially, what I want to develop is a browser-within-browser...
7
by: Marcolino | last post by:
Hi all, I need to add a custom button to title bar on a form in addition of a standard button. (Minimize/Maximize, close etc.) I need also to handle OnClick event of this button. I looked around...
10
by: uninvolved | last post by:
First off hi all, This is probably simple to someone but I'm stuck. I created a button on a flash movie, .swf, insert it into a webpage created in Dreamweaver, the idea is when the button is...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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,...
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.