PDA

View Full Version : need help with page title



jackdaniels
03-23-2008, 04:03 AM
I am using that code on page on load event it works perfect but i have multiple pages so i can only set the web1 text to title... i put the same code to all the web objects but they dont change the title... i only see the web1 title. !!!!!

Page On Load :

WebBrowserExtension.Initialize(Application.GetWndH andle());
title = WebBrowserExtension.GetTitle();
Window.SetText(Application.GetWndHandle(), title);
WebBrowserExtension.UnInitialize();

i need help with it
thanks

RizlaUK
03-23-2008, 06:27 AM
you are setting the title to what it already is

try like this:

WebBrowserExtension.Initialize(Application.GetWndH andle());
Window.SetText(Application.GetWndHandle(), "Your Text Here");
WebBrowserExtension.UnInitialize();

jackdaniels
03-23-2008, 06:31 AM
thanks RizlaUK but what i am trying to do is get the Tittle of web page and show it on my projects status bar...

RizlaUK
03-23-2008, 06:46 AM
ah, ok, in that case its the wrong hWnd


try like this:

WebBrowserExtension.Initialize(Web.GetProperties("Web1").WindowHandle);
title = WebBrowserExtension.GetTitle();
Window.SetText(Application.GetWndHandle(), title);
WebBrowserExtension.UnInitialize();

jackdaniels
03-23-2008, 06:50 AM
u r the king RizlaUK thanks alot ;)

jackdaniels
03-23-2008, 06:56 AM
how can i make it show my text if it is an empty page (no tittle) about:blank !!!

rexzooly
03-23-2008, 06:58 AM
how can i make it show my text if it is an empty page (no tittle)!!!


WebBrowserExtension.Initialize(Application.GetWndH andle());
title = WebBrowserExtension.GetTitle();
if title == what ever the blank page says if nothing then "" then
tilte = "no tittle"
else
title = title
end
Window.SetText(Application.GetWndHandle(), title);
WebBrowserExtension.UnInitialize();

oops there was a error

RizlaUK
03-23-2008, 07:09 AM
WebBrowserExtension.Initialize(Web.GetProperties("Web1").WindowHandle);
title = WebBrowserExtension.GetTitle();
if title == "about:blank" then title == "Your Text Here" end
Window.SetText(Application.GetWndHandle(), title);
WebBrowserExtension.UnInitialize();

jackdaniels
03-23-2008, 07:10 AM
this didnt work !!!!!!


WebBrowserExtension.Initialize(Web.GetProperties("Web1").WindowHandle);
title = WebBrowserExtension.GetTitle();
if title == "about:blank" then
title = "no tittle"
else
title = title
end
Window.SetText(Application.GetWndHandle(), title);
WebBrowserExtension.UnInitialize();

jackdaniels
03-23-2008, 07:14 AM
got it worked thanks alot RizlaUK & rexzooly


WebBrowserExtension.Initialize(Web.GetProperties("Web2").WindowHandle);
title = WebBrowserExtension.GetTitle();
if title == "" then
title = "no tittle"
else
title = title
end
Window.SetText(Application.GetWndHandle(), title);
WebBrowserExtension.UnInitialize();