Restored from previous forum. Originally posted by Midebor.
Hi,
I've modified the PB minibrowser to use a command line parameter as
Home URL. You can put different instances on your desktop and define
opening URL by adding
http://domain.com/ as command line parameter in the properties of your desktop icon.
This makes the program more universaly usable ...
;
; ------------------------------------------------------------
;
; PureBasic - MiniBrowser
;
; (c) 2002 - Fantaisie Software
;
; ------------------------------------------------------------
;
; This program requiers the Microsoft freely distribuable
; ATL.dll shared library.
; Modified by Midebor using commandline parameter as Home URL
; Compile with "%FILE%" as argument
;
URL$=ProgramParameter()
Procedure ResizeWebWindow()
ResizeGadget(10, -1, -1, WindowWidth(), WindowHeight()-52)
ResizeGadget(4, -1, -1, WindowWidth()-185, -1)
ResizeGadget(5, WindowWidth()-25, -1, -1, -1)
ResizeGadget(6, -1, -1, WindowWidth(), -1)
EndProcedure
Procedure SizeCallback(WindowID, Message, wParam, lParam)
ReturnValue = #PB_ProcessPureBasicEvents
If Message = #WM_SIZE
UpdateStatusBar(0)
ResizeWebWindow()
ReturnValue = 1
EndIf
ProcedureReturn ReturnValue
EndProcedure
If OpenWindow(0, 100, 100, 500, 300, #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget, "PureBasic MiniBrowser v1.0")
CreateStatusBar(0, WindowID())
StatusBarText(0, 0, "Welcome to the world's smallest Browser !

", 0)
CreateGadgetList(WindowID())
ButtonGadget(1, 0, 0, 50, 25, "Back")
ButtonGadget(2, 50, 0, 50, 25, "Next")
ButtonGadget(3, 100, 0, 50, 25, "Stop")
StringGadget(4, 155, 5, 0, 20, URL$)
ButtonGadget(5, 0, 0, 25, 25, "Go")
Frame3DGadget(6, 0, 30, 0, 2, "", 2) ; Nice little separator
If WebGadget(10, 0, 31, 0, 0, URL$) = 0 : MessageRequester("Error", "ATL.dll not found", 0) : End : EndIf
AddKeyboardShortcut(0, #PB_Shortcut_Return, 0)
ResizeWebWindow()
SetWindowCallback(@SizeCallback())
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadgetID()
Case 1
SetGadgetState(10, #PB_Web_Back)
Case 2
SetGadgetState(10, #PB_Web_Forward)
Case 3
SetGadgetState(10, #PB_Web_Stop)
Case 5
SetGadgetText(10, GetGadgetText(4))
EndSelect
Case #PB_Event_Menu ; We only have one shortcut
SetGadgetText(10, GetGadgetText(4))
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
Regards,
Michel