topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 18, 2024, 11:30 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: FBSL - A simple Web browser  (Read 7738 times)

Gerome

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 154
    • View Profile
    • Get my Freestyle Basic Script Language + compiler!
    • Donate to Member
FBSL - A simple Web browser
« on: March 12, 2006, 04:20 PM »
Hello,

A simple web browser with a mutex that allows to execute more than one instance at a time :)

#Option Explicit

#DllDeclare atl.AtlAxWinInit
Dim %hMutex, $URL, %hDisplay

' // Create a Mutex : only ONE instance is allowed !!
hMutex = ApiCall("CreateMutex", "kernel32", 0, 1, "__MUTEX__Browser__")
If GetLastError() = 183 Then ExitProgram(-1)

Fbsl_SetText(ME, "==FBSL Basic Web Browser==")
Resize(ME, 0, 0, 600, 500)
Center(ME)

Const hURL = Fbsl_Control("Edit", ME, "http://www.fbsl.net", 0, 10, 3, 368, 23, _
WS_CHILD + WS_VISIBLE + WS_TABSTOP + ES_AUTOHSCROLL, WS_EX_CLIENTEDGE)
Const IDB_Go = 1000
Fbsl_Control("Button", ME, "Go", IDB_Go, 380, 3, 75, 23, WS_CHILD + WS_VISIBLE + WS_TABSTOP, 0)
AtlAxWinInit(0)
hDisplay = Fbsl_Control("AtlAxWin", ME, "MSHTML:<HTML></HTML>", _
0, 0, 30, 600, 460, WS_CHILD + WS_VISIBLE, WS_EX_CLIENTEDGE)
Show(ME)
RefreshMe()

Begin Events
    Select Case CBMSG
        Case WM_SIZE
            RefreshMe()
        Case WM_CLOSE
            ExitProgram(0)
        Case WM_COMMAND
            If CBCTL = IDB_Go Then EventGo()
    End Select
End Events

Sub EventGo()
    Fbsl_GetText(hURL, URL)
    If URL = "" Then Return
    If (hDisplay <> 0) Then Destroy(hDisplay)
    hDisplay = Fbsl_Control("AtlAxWin", ME, URL, 0, 0, 30, 600, 460, _
    WS_CHILD + WS_VISIBLE + WS_VSCROLL + WS_HSCROLL, WS_EX_CLIENTEDGE)
    RefreshMe()
End Sub

Sub RefreshMe()
    Dim %Lefti, %Topi, %Righti, %Bottomi
    GetClientRect(ME, Lefti, Topi, Righti, Bottomi)
    Resize(hDisplay, 10, 30, Righti - 25, Bottomi - 70)
End Sub
Yours,
(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
http://www.fbsl.net [FBSL Author]
http://gedd123.free.fr/FBSLv3.zip [FBSL Help file]
(¯`·._.·[If you need help... just ask]·._.·´¯)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: FBSL - A simple Web browser
« Reply #1 on: March 15, 2006, 06:20 AM »
Is there a way to set control flags in FBSL when using that MSHTML call?  Specifically, the downloading of sounds as described here: http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/editing/mshtmleditor.asp


The WebBrowser Control gives you control over what it downloads, displays, and executes. To gain this control, you need to implement your host's IDispatch so it handles DISPID_AMBIENT_DLCONTROL. When the WebBrowser Control is instantiated, it will call your IDispatch::Invoke with this ID. Set pvarResult to a combination of following flags, using the bitwise OR operator, to indicate your preferences.

DLCTL_DLIMAGES, DLCTL_VIDEOS, and DLCTL_BGSOUNDS: Images, videos, and background sounds will be downloaded from the server and displayed or played if these flags are set. They will not be downloaded and displayed if the flags are not set.

Cpilot

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 293
    • View Profile
    • Bite Notes
    • Read more about this member.
    • Donate to Member
Re: FBSL - A simple Web browser
« Reply #2 on: March 15, 2006, 09:00 AM »
I'm not really sure what your looking for but, ATL is a ActiveX control that allows hosting the control in a window.
A more comprehensive explaination of the dll is here:
What Is the ATL Control-Hosting API?


skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: FBSL - A simple Web browser
« Reply #3 on: March 16, 2006, 05:03 AM »
I'm not really sure what your looking for

Apologies, I should have been more clear.  Basically, I want to disable sounds in that example web browser above.  I did some research and came across the link I provided so I was curious to know if one could apply those flags to stop the downloading of sound files.  I can make the flags do what I want in VB but I'm not sure how to go about it in FBSL.

Gerome

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 154
    • View Profile
    • Get my Freestyle Basic Script Language + compiler!
    • Donate to Member
Re: FBSL - A simple Web browser
« Reply #4 on: March 16, 2006, 05:45 AM »
Hi,

I'm not really sure what your looking for

Apologies, I should have been more clear.  Basically, I want to disable sounds in that example web browser above.  I did some research and came across the link I provided so I was curious to know if one could apply those flags to stop the downloading of sound files.  I can make the flags do what I want in VB but I'm not sure how to go about it in FBSL.

If you can do it in VB, you can absolutely do it in FBSL!
You just have to read the COM paragraph into the FBSL documentation before :)
Yours,
(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
http://www.fbsl.net [FBSL Author]
http://gedd123.free.fr/FBSLv3.zip [FBSL Help file]
(¯`·._.·[If you need help... just ask]·._.·´¯)