
  $ Filename "t.exe"
  'uses RTL64
  uses COM\COMutil
  uses WebBrowserAtl
  uses winutil

  AtlAxWinInit()


  sys win
  int x,y,w,h
  x=0 : y=10 : w=800 : h=600
  int winstyle,wbstyle
  winstyle = WS_MINMAXSIZE 'or WS_CLIPCHILDREN
  wbstyle = WS_CHILD or WS_VISIBLE or WS_BORDER or WS_VSCROLL or WS_HSCROLL
  sys btt0,btt1,btt2 'buttons
  int b0ID = 100, b1ID=101, b2ID=102,brID=120

  sys hWb
  sys sys_hWnd
  sys sys_hDC

  sys hinst = GetModuleHandle 0

  WindowsRegistrate("Oxygen")

  'main window
  ============
  sys_hwnd = CreateWindowEx(0, "Oxygen", "ATL Browser", winstyle, x, y, w, h, null, 0, hinst, 0)
  win=sys_hwnd

  'browser window
  ===============
  hWb = CreateWindowEx(0, "AtlAxWin", "www.google.com",wbstyle , 64, 40, w-100,(h-56)-64, win, brID, 0, 0)
 
  'buttons
  ========
  int style=WS_CHILD | BS_TEXT | BS_PUSHBOX | WS_VISIBLE
  btt0=CreateWindowEx(0,"button", "O2", style,  64,4,30,30,  win, b0ID, 0, null)
  btt1=CreateWindowEx(0,"button", "<--", style,  98,4,30,30, win, b1ID, 0, null)
  btt2=CreateWindowEx(0,"button", "-->", style, 134,4,30,30, win, b2ID, 0, null)


  'iwebbrowser2 interface
  =======================
  'https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752127(v=vs.85)
  'exdisp.h
  IUnknown *v
  int er=AtlAxGetControl  ( hwb, @@v )
  CreateGuid g1 "EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B" 'WebBrowser interface
  CreateGuid g2 "D30C1661-CDAF-11d0-8A3E-00C04FC9E26E" 'WebBrowser2 interface
  IWebBrowser2 *po
  er=v.QueryInterface(g2,byval @@po)
  v.Release
  @v=0
  #recordof IWebBrowser2

  MessageLoop()

  'close
  ======
  'AtlAxWinTerm()
  po.Release
  =0
  end



  function WndProc (sys hwnd,wmsg,wparam,lparam) as sys callback
  ==============================================================

  select hwnd

  case win

    select wmsg
    '
    case WM_SIZE
      RECT rc
      GetClientRect(win,rc)
      MoveWindow(hwb,64, 40, rc.right-100,(rc.bottom-56)-64,1)

    case WM_CLOSE
      DestroyWindow win
      PostQuitMessage 0

    case WM_COMMAND	
      int controlID = LoWord(wParam) 'get control ID
      int notifyCode = HiWord(wParam) 'get notification message
      '
      select controlID
      '
      case b0ID
        if notifycode=0 
          'short a=3         
          'er=po.get_StatusBar(@a)
          'print a
          'po.put_StatusBar(0)
          wbstring s="https://www.oxygenbasic.org/forum/index.php"
          er=po.Navigate s,0,0,0,0
          'er=po.get_LocationURL @s
          'er=po.get_LocationName @s
          'er=po.get_Name @s
          'er=po.get_FullName @s
          'print  " " er ", " s
          'frees s
          sys h
          'po.get_HWND @h
          po.get_Width @h
          po.put_Left 100
          'print h 
          'po.Refresh	
        end if      
      case b1ID
        if notifycode=0          
          po.GoBack
        end if
      case b2ID
        if notifycode=0          
          po.GoForward
        end if
        'po.Quit
        po.put_FullScreen 0xffff
        'po.put_Visible 0
        'po.goHome
      end select
    end select
  end select
  return DefWindowProc hwnd,wMsg,wParam,lParam
end function
