ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

FBSL - A simple Web browser

(1/1)

Gerome:
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

skwire:
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:
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:
I'm not really sure what your looking for
--- End quote ---

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:
Hi,

I'm not really sure what your looking for
--- End quote ---

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.
-skwire (March 16, 2006, 05:03 AM)
--- End quote ---

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 :)

Navigation

[0] Message Index

Go to full version