HtmlView

BlitzPlus Forums/BlitzPlus Programming/HtmlView

REDi(Posted 2004) [#1]
Hi all!

Does anyone know how to refresh a HtmlView? also how to get the url from a HtmlView?


Beaker(Posted 2004) [#2]
To refresh just go again:
HtmlViewGo html,URL$

I don't think you can get the current URL.

Take a look at "Blitz Browse" in the samples folder of your BlitzPlus install.


Kevin_(Posted 2004) [#3]
One way of retrieving the URL is to create your own 'history' file in an array. Every time the url changes just add the new URL to the list. You can then keep track of the current URL and also the previous URLs. However, the problem arises when you click on a hyperlink on a web page because there is no way to send this info back to blitz.

There must be an IE API function call somewhere that can track hyperlink activations. Anyone?

Regards


REDi(Posted 2004) [#4]
Idea... IE creates a history file, would it be possible to use that?

Problems...

1) Where's it stored
2) How's it stored
3) Clicking on a hyperlink doesn't send a gadget event message, how will we know when it changes?

If anyone has any ideas please help, i think blitzplus needs this issue addessed, maybe Mark could give us a "=HtmlViewUrl$(HtmlView)" command ;)


Beaker(Posted 2004) [#5]
I would love BlitzPlus to allow us to hijack the hyperlink.
That would cover all bases.


REDi(Posted 2004) [#6]
maybe GadgetText(gadget) could return the url$?


Kevin_(Posted 2004) [#7]
Doesnt work. Try the code below...


WinWidth=750:WinHeight=550
WinX=(ClientWidth(Desktop())-WinWidth)/2
WinY=(ClientHeight(Desktop())-WinHeight)/2
Window = CreateWindow("Centred Window",WinX,WinY,WinWidth,WinHeight,0,1)

htmlview=CreateHtmlView(0,0,Winwidth-5,WinHeight-70,Window)
HtmlViewGo htmlview,"www.blitzbasic.com"

button=CreateButton("Get URL",WinWidth/2,WinHeight-60,50,20,Window,1)

While WaitEvent()<>$803
If EventSource()=Button
a$=GadgetText(htmlview) ; Try and get the url
Notify "URL = "+a$ ; Returns null :-(
EndIf
Wend
End


The weird thing about the GadgetText command is that I have just looked at the command summary and there isnt a GadgetText(gadget) command. But the compiler allows you to compile it. Weird! It must be a command that mark hasn't finished implementing yet.

There is a GadgetItemText$( gadget,index) command but this command may only be used with combobox, listbox and tabber gadgets.


REDi(Posted 2004) [#8]
Sorry prof, i should of made myshelf clear, i knew it didn't work, i was just saying that mark could use it to return the url in a future update.

Anyway I'm looking into writing a dll to handle this problem, but i don't think i'm going to have much spare time to do it for a while :(


REDi(Posted 2004) [#9]
Well I've cracked the problem of refreshing the current web page without knowing what the current url is! simply use...

HtmlViewGo htmlview,"javascript:window.location.reload();"

:D


Kevin_(Posted 2004) [#10]
Nice one.

I was working on some javascript the other day trying to figure out how the get the URL using....

strID = window.document.location.toString();

I should be able to use document.write to create another html file with the URL in it. All I do then is read in the file normally in blitz from the temp internet files folder and get the string.

That is the theory anayway, but no luck yet :(
I'll try again later.


necky(Posted 2004) [#11]
What you can do, and I'll do this tonight, is to read the internet history file and take the last "www." as your current webpage.
Check to see if it's been altered, if it has go to the last position you were at in the history file and read it off as the internet site you are currently on.
Probably won't be the fastest piece of code in the world, but it will definately work :)


REDi(Posted 2004) [#12]
I've finished writing my first dll :D
It Totally replaces the HtmlView commands in blitz with these Functions...

EnableWebPage(Hwnd)
=CreateWebPage(x,y,width,height,url$)
ResizeWebPage(index,x,y,width,height)
WebPageForward(index)
WebPageBack(index)
WebPageGo(index)
WebPageStop(index)
WebPageRefresh(index)
=WebPageUrl$(index) <--- :D

If anyone would like a copy of it then just leave a post and i will email you a copy. (dont have any web space at the moment)
Its not the perfect solution but it does work, it will do until blitz sorts this out.


Beaker(Posted 2004) [#13]
I'm interested in a copy (and I can host it for you if you like). Is there anything in what you looked at that might give us link hijacking?


MrCredo(Posted 2004) [#14]
can you mail me your HtmlView-DLL - what i miss is this GetURL-Function


JWW(Posted 2011) [#15]
I'm interested in a copy


GfK(Posted 2011) [#16]
I'm interested in a copy
Are you serious?? Jesus Christ - seven years. I've got kids newer than this thread.


vivaigiochi(Posted 2011) [#17]
i'm interested in a copy.