• Welcome to Jose's Read Only Forum 2023.
 

web navigation O2

Started by Eduardo Jorge, June 28, 2019, 06:48:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

James C. Fuller

Quote from: Eduardo Jorge on July 27, 2019, 03:35:07 PM
I wouldn't mind if O2 had only one method of declaring variables that would just force manually declaring without being able to paste ready-made codes
would even be good because it would make O2 independent of other languages and make it easier for Charles

Maybe a #SYNTAX=[O2] statement ??

James

Eduardo Jorge

#46
James C. Fuller
Yes, it would be interesting and something less permissive


I noticed that the values are explicit in the generated code
I think it would be interesting to code to prevent others from exchanging these texts so easily
like a link, someone malicious could link to a malicious page very easily
I am trying to add the encrypted values and a function that will decrypt for use, of course I can only do this simply and inefficiently for those who know the subject

Eduardo Jorge

I want to build some simple programs but that has a certain requirement
so I thought of putting a link to the O2 page as an advertisement,
Is there a way to insert a link and open it through their default browser?

Zlatko Vid

This is a old post and i look again into this Iup examples

no one of them is about web browser or Iup html control
i can bet that is see something similar JRS made using o2 or i am wrong

Iup looks like a easiest way to make WebBrowser program?
what you think?

Charles Pegge

Hi Aurel,

There are 2 ATL examples in demos\!ProjB\ATL\

They use a version of your awinh.

I've fixed the URL for o2


'gui-skeleton app
$ Filename "t.exe"
'uses RTL64
uses COM\COMutil
uses WebBrowserAtl
uses awinh


#lookahead
INT win,win2
INT x,y,w,h,x2,y2,w2,h2
x=0:y=10:w=800:h=600
x2=410:y2=10:w2=400:h2=300
INT winstyle,wstyle2,wbstyle
winstyle = WS_MINMAXSIZE or WS_CLIPCHILDREN
wbstyle = WS_CHILD or WS_VISIBLE or WS_BORDER or WS_VSCROLL or WS_HSCROLL
INT btt0,btt1,btt2
INT b0ID = 100, b1ID=101, b2ID=102


% WM_FORWARDMSG = &H37F ' (895)

% IDB_BACK = 1001
% IDB_FWRD = 1002
% IDB_NAVG = 1003
% IDC_URL  = 1004
% IDC_WB   = 1005

'extern lib "ATL.dll"
'! AtlAxWinInit() as int
''! AtlAxWinTerm() as int
'! AtlAxGetControl( sys hWnd, pp ) as int
'end extern

int hWb

AtlAxWinInit()

'create window
'
win = SetWindow("ATL:Browser",x,y,w,h,0,winstyle)

'create 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)



'create browser window
hWb = CreateWindowEx(0, "AtlAxWin", "www.google.com",wbstyle , 64, 40, w-100,(h-56)-64, win, IDC_WB, 0, 0)
'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

wait()

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

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

case win

  select wmsg
  '
  case WM_CLOSE
    DestroyWindow win
    PostQuitMessage 0
  case WM_SIZE
    GetSize(win,0,0,w,h)
    MoveWindow(hWb,64, 40, w-100,(h-56)-64,1)
  case WM_COMMAND
    controlID = LoWord(wParam) 'get control ID
    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="http://www.jose.it-berater.org/smfforum/index.php?board=154.0"
        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 default

end function


I've withdrawn IUP - the header file needs fixing.

Zlatko Vid

Hi Charles

thanks on that ..i know for this ATL

but i am interested in Iup..
Iup have some good capabilities about web control
as far as i remember ...i will peek into jrs forum maybe i there something useful

Zlatko Vid

oh snap...i found this :
QuoteIn Windows, the implementation uses the IupOleControl to embed an instance of the Internet Explorer WebBrowser control. A listener interface is used to capture and handle events using the Active Template Library (ATL) classes.

so Iup use ATL ...hmmm