473,837 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.T oString" or "Request.Applic ationPath.ToStr ing"
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 9723
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.Applicati on Windows collection.
The Windows collection is a collection of Shell Explorer windows
but what is actually returned are IE objects. So ShellApp.Window s
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.bo dy.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.Window s
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.T oString" or "Request.Applic ationPath.ToStr ing"
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.goo gle.com...
: 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.T oString" or "Request.Applic ationPath.ToStr ing"
: 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
3638
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 never press the back button from certain screens. If the back button is pressed, it will bill for charges, even if the user is pressing the back button as a way of canceling. Another example would be Mambo CMS -- if you click the back button on...
3
3637
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 following... Dim NtsT1 As CommandBar Dim NtsT1Btn1 As CommandBarButton Dim NtsT1Btn2 As CommandBarButton Dim NtsT1Btn3 As CommandBarButton There is a CommandBarEvents and 2 CommandBarButton to select but no
2
1245
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 the middle of a window (like microsoft office toolbars)? the only thing i know so far is create a class and include some code like public class name : UserControl
6
3067
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() HttpContext.Current.Response.ClearContent() HttpContext.Current.Response.ContentType = "application/pdf" Dim myBuffer(MyStream.Length) As Byte MyStream.Read(myBuffer, 0, CType(MyStream.Length, Integer)) HttpContext.Current.Response.BinaryWrite(myBuffer)
27
45581
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 height as they were in previous versions or will they be the "ribbon" style that takes up a huge portion of the screen? Also when I use Access 2007 to open an Access 2003 database that has custom menu bars they display as they did in Access...
15
2014
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: ************************************************************ Namespace StevenBey.Web.UI Public Class Page Inherits System.Web.UI.Page
0
2521
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 functionality where the ‘mini-browser’ has similar functionality to a normal browser. Let me explain: Firstly, our website interface will open up in a popup window. All the normal browser toolbars and buttons have been removed from the popup window. It’s...
7
9087
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 google but i'm not able to find any example that can help me. Many thanks in advance for your help. Marco
10
2820
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 clicked, a new browser window opens to a size of 600 x 600, no scroll bars to toolbar, just a way to close it. The browser will just contain a simple .jpg image of a map. Now I've looked at heaps of sites and tried the following actionscript. on...
0
9846
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10583
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
10638
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,...
0
10280
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9419
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7009
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
5859
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4481
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
2
4056
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.