Page 2 of 2 FirstFirst 12
Results 41 to 51 of 51

Thread: Help needed on RC6, Webview2

  1. #41

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2011
    Posts
    455

    Re: Help needed on RC6, Webview2

    All i asked was when the next release of RC6 will be.

  2. #42
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,474

    Re: Help needed on RC6, Webview2

    Quote Originally Posted by k_zeon View Post
    All i asked was when the next release of RC6 will be.
    You been here long enough to know that's not how it works around here. We just can't help ourselves.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #43
    Member saturnian's Avatar
    Join Date
    Dec 2017
    Location
    France
    Posts
    63

    Re: Help needed on RC6, Webview2

    hello Olaf
    In a previous post you said:

    Quote Originally Posted by Schmidt View Post
    Have just added the NavigationStarting-Event (including a Cancel-Param) to new version 6.0.13
    (which I will upload at the start of the next week)...

    HTH

    Olaf
    Will RC 6.0.013 be available soon ?
    I would like to be able to use the NavigationStarting event

    Sincerely
    François

  4. #44
    PowerPoster
    Join Date
    Jun 2013
    Posts
    6,663

    Re: Help needed on RC6, Webview2

    Quote Originally Posted by saturnian View Post
    hello Olaf
    In a previous post you said:

    Will RC 6.0.013 be available soon ?
    I would like to be able to use the NavigationStarting event
    JFYI: Have just uploaded this version - here's a longer comment about the 2 new Events:
    https://www.vbforums.com/showthread....=1#post5607162

    Olaf

  5. #45

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2011
    Posts
    455

    Re: Help needed on RC6, Webview2

    Quote Originally Posted by Schmidt View Post
    JFYI: Have just uploaded this version - here's a longer comment about the 2 new Events:
    https://www.vbforums.com/showthread....=1#post5607162

    Olaf
    tks Olaf

    works great.

    tks

  6. #46

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2011
    Posts
    455

    Re: Help needed on RC6, Webview2

    one more question.
    previously , with the webrowser control. I could right click a link and raise my own menu.

    how can i do this with RC6

    ie cancel the default menu and use my own.

  7. #47
    Member saturnian's Avatar
    Join Date
    Dec 2017
    Location
    France
    Posts
    63

    Re: Help needed on RC6, Webview2

    Quote Originally Posted by Schmidt View Post
    JFYI: Have just uploaded this version - here's a longer comment about the 2 new Events:
    https://www.vbforums.com/showthread....=1#post5607162

    Olaf
    Thank you very much Olaf
    Congratulations again for your wonderful work.

    François

  8. #48
    PowerPoster
    Join Date
    Jan 2020
    Posts
    2,408

    Re: Help needed on RC6, Webview2

    You can use JS to block the right click operation. Then JS calls VB to display a menu.

  9. #49
    PowerPoster
    Join Date
    Jan 2020
    Posts
    2,408

    Re: Help needed on RC6, Webview2

    Quote Originally Posted by SearchingDataOnly View Post
    Also, I can't imagine what kind of business model twinBasic should adopt to survive. If twinBasic had been born 15 years earlier, twinBasic might have been able to adopt the business model it currently intends to adopt (closed source and survive by selling licenses), but for now, it is clearly unlikely to succeed. We all hope that Wayne could make more money with twinBasic, so that twinBasic will have better development prospects. But unless Wayne gets big venture capital and assembles his own development team, the opportunity to make big money won't come up.
    B4a, b4i, they also sold licenses at the beginning, and then they licensed the development of Android tools for free for everyone to use.
    Because they get investments from other companies.
    As long as the product is good enough, plus you have to contact those big companies to negotiate acquisition or cooperation opportunities, you can do more things with money.

  10. #50
    PowerPoster
    Join Date
    Jun 2013
    Posts
    6,663

    Re: Help needed on RC6, Webview2

    Quote Originally Posted by k_zeon View Post
    one more question.
    previously , with the webrowser control. I could right click a link and raise my own menu.

    how can i do this with RC6

    ie cancel the default menu and use my own.
    Here's an example:
    Code:
    Option Explicit
     
    Private WithEvents WV As cWebView2
    
    Private Sub Form_Load()
      Visible = True
      
      Set WV = New_c.WebView2(hWnd)
          WV.AddScriptToExecuteOnDocumentCreated "top.addEventListener('mouseover',(e)=>{if(e.target)top.movr=e.target})"
          WV.AreDefaultContextMenusEnabled = False '<-- that's the important setting here
          
          WV.Navigate "https://vbForums.com" 
    End Sub
    
    Private Sub Form_Resize()
      If Not WV Is Nothing Then WV.SyncSizeToHostWindow
    End Sub
     
    Private Sub WV_UserContextMenu(ByVal ScreenX As Long, ByVal ScreenY As Long)
      Debug.Print ScreenX, ScreenY, WV.jsProp("top.movr.tagName"), WV.jsProp("top.movr.id")
    End Sub
    If the incoming 2 params in WV_UserContextMenu(ScreenX, ScreenY) are already enough for your purposes,
    then you will not need the little "last hovered-element-storage"-helper which was added via AddScriptToExecuteOnDocumentCreated in Form_Load().

    Olaf

  11. #51

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2011
    Posts
    455

    Re: Help needed on RC6, Webview2

    Quote Originally Posted by Schmidt View Post
    Here's an example:
    Code:
    Option Explicit
     
    Private WithEvents WV As cWebView2
    
    Private Sub Form_Load()
      Visible = True
      
      Set WV = New_c.WebView2(hWnd)
          WV.AddScriptToExecuteOnDocumentCreated "top.addEventListener('mouseover',(e)=>{if(e.target)top.movr=e.target})"
          WV.AreDefaultContextMenusEnabled = False '<-- that's the important setting here
          
          WV.Navigate "https://vbForums.com" 
    End Sub
    
    Private Sub Form_Resize()
      If Not WV Is Nothing Then WV.SyncSizeToHostWindow
    End Sub
     
    Private Sub WV_UserContextMenu(ByVal ScreenX As Long, ByVal ScreenY As Long)
      Debug.Print ScreenX, ScreenY, WV.jsProp("top.movr.tagName"), WV.jsProp("top.movr.id")
    End Sub
    If the incoming 2 params in WV_UserContextMenu(ScreenX, ScreenY) are already enough for your purposes,
    then you will not need the little "last hovered-element-storage"-helper which was added via AddScriptToExecuteOnDocumentCreated in Form_Load().

    Olaf
    tks works ok.
    how would i differenciate the links. on Left side of page i have a link to a web site.
    in the middle of page i have links to people.

    how can i make it so that the links of people i rightclick can have one menu and if i were to rightclick the website i either get a different menu or no menu at all

    or how do i get the target url of link, i tried WV.jsProp("top.movr.url") and WV.jsProp("top.movr.target") but i get nothing

    tks
    Last edited by k_zeon; May 29th, 2023 at 02:02 PM.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width