A Tiny Web Browser

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Don.

Here's a little application I wrote to try out a few techniques. I thought it would be fun to try to combine the ideas from these postings:

viewtopic.php?t=628">http://forums.pure ... .php?t=628 Tiny code to download a web page%2Ffile&Forum_Title=Tricks %27n%27 Tips

viewtopic.php?t=706 HTML in your program%2E%2E%2E&Forum_Title=Tricks %27n%27 Tips

- thanks to PB and Franco for these.

It's a very basic web browser based on GipsySoft's QHTMLight.dll
It's not really meant as a proper web browser beacuse the QHTMLight.dll was not designed for the purpose I've put it to . GipsySoft's demo version of the dll, whch I used, is pretty limited - it doesn't handle forms, script, tables with spanning rows/columns etc and it only handles bmp images (I didn't implement images in the browser). I really intended the code as a source of information which some may find useful. You'll probably need to know a bit about the Windows API to understand everything in the code, but there are some useful techniques, including:

- how to use PB's low level callback to communicate with the main event loop
- how to create an editable combobox
- how to use a non-standard font in the combobox
- how to use a timer in a separate thread & communicate with the main event loop
- how to use comms routines in a thread and timeout with the timer thread
- how to pick up PB GadgetIDs in the low level callback, if necessary

I've only tested it on Windows ME with PB 2.90. Any problems & I'd suggest adding the PB dll library and calling the QHTM_Initialise function. If anyone's interested, I have some code written in PB which achieves the same as the URLDownloadToFile API call & reads the network data properly ... I don't think this method is entirely correct:

viewtopic.php?t=151 a web page%3F&Forum_Title=Beginners

You can download the TinyBrowser at


If people are interested I'll put it on the PB rosources site.

Don
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Hi Don!
I tested your mini webbrowser and its really cool... I tested some sites... http://www.purebasic.com (not correct formated but else ok to read), http://www.google.de (server not reached but IE worked at the same time without this problem) - http://www.amiga.com (no text, no graphic) ... Anyway its really cool...
If people are interested I'll put it on the PB rosources site.
Yes, why not... Its surely interested for a lot of people to see what is possible with PureBasic... Just put the exe and maybe source as zip archive to the PB resource site! Cool work dude... keep on this...


PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Don.

Thanks MrVainSCL - I'll put it in the Applications Archive on the resource site tomorrow evening - I just tried it but 'Upload Code' kept timing out on me.

Don't expect miracles from this little app - GipsySoft's dll isn't intended for this kind of thing. Many many web pages just won't display properly because of the dll's limitations. On the other hand I've found it useful for quickly scanning things like the BBC 'low graphics' web pages ... it's very fast for this kind of thing.

Don
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.
Don wrote:
Thanks MrVainSCL - I'll put it in the Applications Archive on the resource site tomorrow evening - I just tried it but 'Upload Code' kept timing out on me.
no problem :wink:
Don wrote:
Don't expect miracles from this little app - GipsySoft's dll isn't intended for this kind of thing. Many many web pages just won't display properly because of the dll's limitations. On the other hand I've found it useful for quickly scanning things like the BBC 'low graphics' web pages ... it's very fast for this kind of thing.
hehe... i know its only a small web browser (no java support? *rofl* :wink: - Ok, just joking - Mhhhh, i see that the *.dll is limited... I cant suprise you but maybe i will find one of my old sources from amiga where you can see how to code a webbrowser without the use of any dll - all interpretation/converting in basic... i must search it... interested?Hope i will find it...


PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.
I cant suprise you but maybe i will find one of my old sources from amiga where you can see how to code a webbrowser without the use of any dll - all interpretation/converting in basic... i must search it... interested?Hope i will find it...
Start searching... now!




Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Hi Don,
I took a closer look to your code... very nice job!
Thanks for sharing the code.


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Don.
Hi Don,
I took a closer look to your code... very nice job!
Thanks for sharing the code.


Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
Thanks Franco (I borrowed some of the ideas from you )

The code is now on the PB Resources site in the Applications area.

Don
Post Reply