• Welcome to Theos PowerBasic Museum 2017.

Mini WebBrowser

Started by José Roca, September 23, 2008, 09:08:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca

The following example demonstrates how to embed the WebBrowser control, using ATL.DLL as the OLE container, and implement features like navigation, find, print preview, page setup, print, properties, save, and cancellation of the creation of new windows.

José Roca

The following version uses my OLE Container (OLECON.INC) instead of ATL.

Randall Glass

I really like this  OLE browser.

The best browser on your site.

How would you get it to bring up a web page, when it starts.

RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement

José Roca

The easiest way is to add the following code before pWindow.DoEvents(nCmdShow):

   LOCAL hUrlTextbox AS DWORD
   hUrlTextbox = GetDlgItem(GetDlgItem(pWindow.hwnd, %IDC_REBAR), %IDC_EDITURL)
   SetWindowText hUrlTextbox, "http://www.powerbasic.com/support/pbforums/"  ' <-- change me

Theo Gottwald

I have compiled the browser in both versions, the controls in the upper left corner seem not to be working reliable.
Sometimes they disappear completely. Then they are only visible half (see attached picture).

José Roca

If you're going to compile legacy code with new headers, then specify the version you want to use. Add %WINVER = &H0501 before the #INCLUDEs. The size of the REBARBANDINFO structure is not the same for XP that for Vista/Windows 7.

Theo Gottwald

Thanks Jose, that was the problem.
Now it works!