Author Topic: Mini WebBrowser  (Read 8529 times)

0 Members and 1 Guest are viewing this topic.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2530
  • User-Rate: +209/-0
  • Gender: Male
Mini WebBrowser
« on: September 23, 2008, 09:08:56 PM »
 
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.
« Last Edit: August 07, 2011, 09:01:51 AM by José Roca »

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2530
  • User-Rate: +209/-0
  • Gender: Male
Re: Mini WebBrowser
« Reply #1 on: December 05, 2008, 02:52:50 PM »
 
The following version uses my OLE Container (OLECON.INC) instead of ATL.
« Last Edit: August 07, 2011, 09:02:27 AM by José Roca »

Offline Randall Glass

  • Newbie
  • *
  • Posts: 12
  • User-Rate: +1/-1
  • Gender: Male
    • RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement
Re: Mini WebBrowser
« Reply #2 on: September 05, 2012, 06:39:26 AM »
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.
Lassar

RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement
http://RadioTelephoneTutor.com

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2530
  • User-Rate: +209/-0
  • Gender: Male
Re: Mini WebBrowser
« Reply #3 on: September 05, 2012, 06:10:20 PM »
The easiest way is to add the following code before pWindow.DoEvents(nCmdShow):

Code: [Select]
   LOCAL hUrlTextbox AS DWORD
   hUrlTextbox = GetDlgItem(GetDlgItem(pWindow.hwnd, %IDC_REBAR), %IDC_EDITURL)
   SetWindowText hUrlTextbox, "http://www.powerbasic.com/support/pbforums/"  ' <-- change me
   PostMessage pWindow.hwnd, %WM_COMMAND, %IDC_GOBTN, MAK(DWORD, %BN_CLICKED, %IDC_GOBTN)

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1079
  • User-Rate: +30/-4
  • Gender: Male
    • it-berater
Re: Mini WebBrowser
« Reply #4 on: September 05, 2012, 08:51:23 PM »
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).

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2530
  • User-Rate: +209/-0
  • Gender: Male
Re: Mini WebBrowser
« Reply #5 on: September 05, 2012, 11:08:09 PM »
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.

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1079
  • User-Rate: +30/-4
  • Gender: Male
    • it-berater
Re: Mini WebBrowser
« Reply #6 on: September 06, 2012, 09:29:54 AM »
Thanks Jose, that was the problem.
Now it works!