473,804 Members | 3,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsoft web browser

Dear sirs
I`ve added Microsoft Web browser componet to my project
I`d like to know how can I view a web page in it?

thanks
Mohammed
Nov 16 '05 #1
7 2371
Mohammed,

Add this code.

//declaration
private AxSHDocVw.AxWeb Browser mTestBrowser;

//Initialization of browser
this.mTestBrows er = new AxSHDocVw.AxWeb Browser();
((System.Compon entModel.ISuppo rtInitialize)(t his.mTestBrowse r)).BeginInit() ;
this.mTestBrows er.OcxState =
((System.Window s.Forms.AxHost. State)(resource s.GetObject("mT estBrowse.OcxSt a
te")));
((System.Compon entModel.ISuppo rtInitialize)(t his.mTestBrowse r)).EndInit();

//declare events
this.mTestBrows e.DocumentCompl ete += new
AxSHDocVw.DWebB rowserEvents2_D ocumentComplete EventHandler(th is.mTestBrowser _
DocumentComplet e);

///To view webpage
object Zero = 0;
object EmptyString= "";
mTestBrowser.Na vigate("http://www.microsoft.c om", ref Zero, ref EmptyString,
ref EmptyString, ref EmptyString);

Shak

"Mohammed Abdel-Razzak" <an*******@disc ussions.microso ft.com> wrote in
message news:1d******** *************** ******@phx.gbl. ..
Dear sirs
I`ve added Microsoft Web browser componet to my project
I`d like to know how can I view a web page in it?

thanks
Mohammed

Nov 16 '05 #2
Dear Sir
thanks very much for the code you gave me, it was really
so helpful
but actuallty I want to open a web page exists in my
computer not at the web

thanks
Mohammed

-----Original Message-----
Mohammed,

Add this code.

//declaration
private AxSHDocVw.AxWeb Browser mTestBrowser;

//Initialization of browser
this.mTestBrow ser = new AxSHDocVw.AxWeb Browser();
((System.Compo nentModel.ISupp ortInitialize) (this.mTestBrow ser)).BeginInit ();this.mTestBrow ser.OcxState =
((System.Windo ws.Forms.AxHost .State)(resourc es.GetObject ("mTestBrowse.O cxState")));
((System.Compo nentModel.ISupp ortInitialize) (this.mTestBrow ser)).EndInit() ;
//declare events
this.mTestBrow se.DocumentComp lete += new
AxSHDocVw.DWeb BrowserEvents2_ DocumentComplet eEventHandler (this.mTestBrow ser_DocumentComple te);

///To view webpage
object Zero = 0;
object EmptyString= "";
mTestBrowser.N avigate("http://www.microsoft.c om", ref Zero, ref EmptyString,ref EmptyString, ref EmptyString);

Shak

"Mohammed Abdel-Razzak" <an*******@disc ussions.microso ft.com> wrote inmessage news:1d******** *************** ******@phx.gbl. ..
Dear sirs
I`ve added Microsoft Web browser componet to my project
I`d like to know how can I view a web page in it?

thanks
Mohammed

.

Nov 16 '05 #3
Mohammed,

In this case, change the first parameter of the call to Nagivate2 to the
path of your file, and it will load fine.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Mohammed Abdel-Razzak" <an*******@disc ussions.microso ft.com> wrote in
message news:1d******** *************** ******@phx.gbl. ..
Dear Sir
thanks very much for the code you gave me, it was really
so helpful
but actuallty I want to open a web page exists in my
computer not at the web

thanks
Mohammed

-----Original Message-----
Mohammed,

Add this code.

//declaration
private AxSHDocVw.AxWeb Browser mTestBrowser;

//Initialization of browser
this.mTestBrow ser = new AxSHDocVw.AxWeb Browser();
((System.Compo nentModel.ISupp ortInitialize)

(this.mTestBrow ser)).BeginInit ();
this.mTestBrow ser.OcxState =
((System.Windo ws.Forms.AxHost .State)(resourc es.GetObject

("mTestBrowse.O cxSta
te")));
((System.Compo nentModel.ISupp ortInitialize)

(this.mTestBrow ser)).EndInit() ;

//declare events
this.mTestBrow se.DocumentComp lete += new
AxSHDocVw.DWeb BrowserEvents2_ DocumentComplet eEventHandler

(this.mTestBrow ser_
DocumentComple te);

///To view webpage
object Zero = 0;
object EmptyString= "";
mTestBrowser.N avigate("http://www.microsoft.c om", ref

Zero, ref EmptyString,
ref EmptyString, ref EmptyString);

Shak

"Mohammed Abdel-Razzak"

<an*******@disc ussions.microso ft.com> wrote in
message news:1d******** *************** ******@phx.gbl. ..
Dear sirs
I`ve added Microsoft Web browser componet to my project
I`d like to know how can I view a web page in it?

thanks
Mohammed

.

Nov 16 '05 #4
Sir
I`ve written the following code but it didn`t work and
gave me an error

this.axWebBrows er1.Navigate2(" c:\\index.html" , ref Zero,
ref EmptyString, ref EmptyString, ref EmptyString);

-----Original Message-----
Mohammed,

In this case, change the first parameter of the call to Nagivate2 to thepath of your file, and it will load fine.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Mohammed Abdel-Razzak" <an*******@disc ussions.microso ft.com> wrote inmessage news:1d******** *************** ******@phx.gbl. ..
Dear Sir
thanks very much for the code you gave me, it was really
so helpful
but actuallty I want to open a web page exists in my
computer not at the web

thanks
Mohammed

>-----Original Message-----
>Mohammed,
>
>Add this code.
>
>//declaration
>private AxSHDocVw.AxWeb Browser mTestBrowser;
>
>//Initialization of browser
>this.mTestBrow ser = new AxSHDocVw.AxWeb Browser();
>((System.Compo nentModel.ISupp ortInitialize)

(this.mTestBrow ser)).BeginInit ();
>this.mTestBrow ser.OcxState =
>((System.Windo ws.Forms.AxHost .State) (resources.GetO bject
("mTestBrowse.O cxSta
>te")));
>((System.Compo nentModel.ISupp ortInitialize)

(this.mTestBrow ser)).EndInit() ;
>
>//declare events
>this.mTestBrow se.DocumentComp lete += new

AxSHDocVw.DWeb BrowserEvents2_ DocumentComplet eEventHandler
(this.mTestBrow ser_
>DocumentComple te);
>
>///To view webpage
>object Zero = 0;
>object EmptyString= "";
>mTestBrowser.N avigate("http://www.microsoft.c om", ref

Zero, ref EmptyString,
>ref EmptyString, ref EmptyString);
>
>Shak
>
>
>
>"Mohammed Abdel-Razzak"

<an*******@disc ussions.microso ft.com> wrote in
>message news:1d******** *************** ******@phx.gbl. ..
>> Dear sirs
>> I`ve added Microsoft Web browser componet to my

project >> I`d like to know how can I view a web page in it?
>>
>> thanks
>> Mohammed
>
>
>.
>

.

Nov 16 '05 #5
Mohammed you have to pass

..Navigate2("fi le://c:\napabatch.ba t",blah,blah )

to open the file from your computer.

Shak
"Mohammed Abdel-Razzak" <an*******@disc ussions.microso ft.com> wrote in
message news:1d******** *************** ******@phx.gbl. ..
Sir
I`ve written the following code but it didn`t work and
gave me an error

this.axWebBrows er1.Navigate2(" c:\\index.html" , ref Zero,
ref EmptyString, ref EmptyString, ref EmptyString);

-----Original Message-----
Mohammed,

In this case, change the first parameter of the call

to Nagivate2 to the
path of your file, and it will load fine.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Mohammed Abdel-Razzak"

<an*******@disc ussions.microso ft.com> wrote in
message news:1d******** *************** ******@phx.gbl. ..
Dear Sir
thanks very much for the code you gave me, it was really
so helpful
but actuallty I want to open a web page exists in my
computer not at the web

thanks
Mohammed
>-----Original Message-----
>Mohammed,
>
>Add this code.
>
>//declaration
>private AxSHDocVw.AxWeb Browser mTestBrowser;
>
>//Initialization of browser
>this.mTestBrow ser = new AxSHDocVw.AxWeb Browser();
>((System.Compo nentModel.ISupp ortInitialize)
(this.mTestBrow ser)).BeginInit ();
>this.mTestBrow ser.OcxState =
>((System.Windo ws.Forms.AxHost .State) (resources.GetO bject ("mTestBrowse.O cxSta
>te")));
>((System.Compo nentModel.ISupp ortInitialize)
(this.mTestBrow ser)).EndInit() ;
>
>//declare events
>this.mTestBrow se.DocumentComp lete += new

AxSHDocVw.DWeb BrowserEvents2_ DocumentComplet eEventHandler
(this.mTestBrow ser_
>DocumentComple te);
>
>///To view webpage
>object Zero = 0;
>object EmptyString= "";
>mTestBrowser.N avigate("http://www.microsoft.c om", ref
Zero, ref EmptyString,
>ref EmptyString, ref EmptyString);
>
>Shak
>
>
>
>"Mohammed Abdel-Razzak"
<an*******@disc ussions.microso ft.com> wrote in
>message news:1d******** *************** ******@phx.gbl. ..
>> Dear sirs
>> I`ve added Microsoft Web browser componet to my project >> I`d like to know how can I view a web page in it?
>>
>> thanks
>> Mohammed
>
>
>.
>

.

Nov 16 '05 #6
Sir
thanks very much it worked, but with ..Navigate
("file://c:\napabatch.ba t",blah,blah )
not with Navigate2("file ://c:\napabatch.ba t",blah,blah )
thanks very much again
Mohammed
-----Original Message-----
Mohammed you have to pass

..Navigate2("f ile://c:\napabatch.ba t",blah,blah )

to open the file from your computer.

Shak
"Mohammed Abdel-Razzak" <an*******@disc ussions.microso ft.com> wrote inmessage news:1d******** *************** ******@phx.gbl. ..
Sir
I`ve written the following code but it didn`t work and
gave me an error

this.axWebBrows er1.Navigate2(" c:\\index.html" , ref Zero,
ref EmptyString, ref EmptyString, ref EmptyString);

>-----Original Message-----
>Mohammed,
>
> In this case, change the first parameter of the call
to Nagivate2 to the
>path of your file, and it will load fine.
>
>
>--
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard. caspershouse.co m
>
>"Mohammed Abdel-Razzak"

<an*******@disc ussions.microso ft.com> wrote in
>message news:1d******** *************** ******@phx.gbl. ..
>> Dear Sir
>> thanks very much for the code you gave me, it was
really >> so helpful
>> but actuallty I want to open a web page exists in my
>> computer not at the web
>>
>> thanks
>> Mohammed
>>
>>
>> >-----Original Message-----
>> >Mohammed,
>> >
>> >Add this code.
>> >
>> >//declaration
>> >private AxSHDocVw.AxWeb Browser mTestBrowser;
>> >
>> >//Initialization of browser
>> >this.mTestBrow ser = new AxSHDocVw.AxWeb Browser();
>> >((System.Compo nentModel.ISupp ortInitialize)
>> (this.mTestBrow ser)).BeginInit ();
>> >this.mTestBrow ser.OcxState =
>> >((System.Windo ws.Forms.AxHost .State)

(resources.GetO bject
>> ("mTestBrowse.O cxSta
>> >te")));
>> >((System.Compo nentModel.ISupp ortInitialize)
>> (this.mTestBrow ser)).EndInit() ;
>> >
>> >//declare events
>> >this.mTestBrow se.DocumentComp lete += new
>>

AxSHDocVw.DWeb BrowserEvents2_ DocumentComplet eEventHandler >> (this.mTestBrow ser_
>> >DocumentComple te);
>> >
>> >///To view webpage
>> >object Zero = 0;
>> >object EmptyString= "";
>> >mTestBrowser.N avigate("http://www.microsoft.c om", ref >> Zero, ref EmptyString,
>> >ref EmptyString, ref EmptyString);
>> >
>> >Shak
>> >
>> >
>> >
>> >"Mohammed Abdel-Razzak"
>> <an*******@disc ussions.microso ft.com> wrote in
>> >message news:1d5b301c45 3ba$7aedbe00 $a*******@phx.g bl... >> >> Dear sirs
>> >> I`ve added Microsoft Web browser componet to my

project
>> >> I`d like to know how can I view a web page in it?
>> >>
>> >> thanks
>> >> Mohammed
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 16 '05 #7
Mohammed.

Navigate - Navigates to a resource identified by a URL or to the file
identified by a full path.

Navigate2 - Navigates the browser to a location that might not be able to be
expressed as a URL, such as a pointer to an item identifier list (PIDL) for
an entity in the Microsoft Windows shell namespace

For your situation, you have to use Navigate. I am glad it worked.

Shak.
"Mohammed Abdel-Razzak" <an*******@disc ussions.microso ft.com> wrote in
message news:1d******** *************** ******@phx.gbl. ..
Sir
thanks very much it worked, but with ..Navigate
("file://c:\napabatch.ba t",blah,blah )
not with Navigate2("file ://c:\napabatch.ba t",blah,blah )
thanks very much again
Mohammed
-----Original Message-----
Mohammed you have to pass

..Navigate2("f ile://c:\napabatch.ba t",blah,blah )

to open the file from your computer.

Shak
"Mohammed Abdel-Razzak"

<an*******@disc ussions.microso ft.com> wrote in
message news:1d******** *************** ******@phx.gbl. ..
Sir
I`ve written the following code but it didn`t work and
gave me an error

this.axWebBrows er1.Navigate2(" c:\\index.html" , ref Zero,
ref EmptyString, ref EmptyString, ref EmptyString);
>-----Original Message-----
>Mohammed,
>
> In this case, change the first parameter of the call to Nagivate2 to the
>path of your file, and it will load fine.
>
>
>--
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard. caspershouse.co m
>
>"Mohammed Abdel-Razzak"
<an*******@disc ussions.microso ft.com> wrote in
>message news:1d******** *************** ******@phx.gbl. ..
>> Dear Sir
>> thanks very much for the code you gave me, it was really >> so helpful
>> but actuallty I want to open a web page exists in my
>> computer not at the web
>>
>> thanks
>> Mohammed
>>
>>
>> >-----Original Message-----
>> >Mohammed,
>> >
>> >Add this code.
>> >
>> >//declaration
>> >private AxSHDocVw.AxWeb Browser mTestBrowser;
>> >
>> >//Initialization of browser
>> >this.mTestBrow ser = new AxSHDocVw.AxWeb Browser();
>> >((System.Compo nentModel.ISupp ortInitialize)
>> (this.mTestBrow ser)).BeginInit ();
>> >this.mTestBrow ser.OcxState =
>> >((System.Windo ws.Forms.AxHost .State)
(resources.GetO bject
>> ("mTestBrowse.O cxSta
>> >te")));
>> >((System.Compo nentModel.ISupp ortInitialize)
>> (this.mTestBrow ser)).EndInit() ;
>> >
>> >//declare events
>> >this.mTestBrow se.DocumentComp lete += new
>>

AxSHDocVw.DWeb BrowserEvents2_ DocumentComplet eEventHandler
>> (this.mTestBrow ser_
>> >DocumentComple te);
>> >
>> >///To view webpage
>> >object Zero = 0;
>> >object EmptyString= "";
>> >mTestBrowser.N avigate("http://www.microsoft.c om", ref >> Zero, ref EmptyString,
>> >ref EmptyString, ref EmptyString);
>> >
>> >Shak
>> >
>> >
>> >
>> >"Mohammed Abdel-Razzak"
>> <an*******@disc ussions.microso ft.com> wrote in
>> >message news:1d5b301c45 3ba$7aedbe00 $a*******@phx.g bl... >> >> Dear sirs
>> >> I`ve added Microsoft Web browser componet to my
project
>> >> I`d like to know how can I view a web page in it?
>> >>
>> >> thanks
>> >> Mohammed
>> >
>> >
>> >.
>> >
>
>
>.
>

.

Nov 16 '05 #8

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

Similar topics

2
2080
by: Rory Plaire | last post by:
Hi, I've been working with the J# browser control. I understand that v1.1b is scriptable, but can't find any examples on how to do this. Can someone point me in the right direction? thanks, -rory
8
4552
by: R. Smits | last post by:
I've have got this script, the only thing I want to be changed is the first part. It has to detect IE version 6 instead of just "Microsoft Internet Explorer". Can somebody help me out? I tried "Microsoft Internet Explorer 6" but that doesn't work. <SCRIPT LANGUAGE="Javascript"> <!-- bName = navigator.appName; if (bName =="Microsoft Internet Explorer") { document.write('<link media="screen" rel="STYLESHEET" type="text/css"
3
1856
by: Richard P | last post by:
I am experiencing some browser weirdness. My app uses session state to hide values I prefer to keep out of the querystring. I am testing to see what happens when cookies are fully disabled in IE 6 and NS 7. NS behaves as expected: it has no recall of previous requests. With IE however my app works as normal: I can still store and retrieve values from session state. Am I imagining this? If not it suggests to me that IE 6 always includes a...
9
13733
by: hzgt9b | last post by:
I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the slides "standout". I've tried setting the browser's BackColor setting, but that had no effect at run time. Any suggestions on how to control the default back color of content displayed in a web browser control?
476
18573
by: Xah Lee | last post by:
Microsoft Hatred, FAQ Xah Lee, 20020518 Question: U.S. Judges are not morons, and quite a few others are not morons. They find MS guilty, so it must be true. Answer: so did the German population thought Jews are morons by heritage, to the point that Jews should be exterminated from earth. Apparently, the entire German population cannot be morons, they must be
6
5243
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
4
2732
by: Paul W | last post by:
Hi - can someone point me to info on the issues/resolutions of supporting the safari browser? To help me understand, if I was developing pages in say FrontPage, what attributes would I set for 'target browser'? I'm having a helluva time with table layouts etc and goin' stir crazy.. Thanks, Paul.
2
1901
by: | last post by:
I am working on an ASP.NET application that seems to be limiting browser histories to only one entry. I am not using SmartNavigation on any of the pages, and that is the only thing that I have seen in the documentation that says it limits the browser history. The pages in the application are in a single IIS folder, which is set up as an application and is NT password protected and SSL encrypted, and has the HTTP headers set to expire the...
15
2333
by: CMM | last post by:
So I'm half way through overseeing a large project in ASP.NET 2.0. My superiors have decided that it would be nice if we ensured the site worked on all the major platforms (as they see it: IE, FireFox, and Safari). We've made heavy usage of the new MENU control and other intrinsic 2.0 controls.... nothing fancy! just using ASP.NET's built-in controls and very nice, pervasive, and clean usage of CSS. Now I find after more testing that the...
4
4669
by: igotyourdotnet | last post by:
I have a web app that I want to make the pages render correctly based on what type of browser is connected. How can I determine if the browser is the desktop IE version or a handheld device version?
0
9577
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10569
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10325
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...
0
10075
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
9140
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...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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
3815
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.