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

Thread: Help needed on RC6, Webview2

  1. #41

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2011
    Posts
    498

    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,598

    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
    Lively Member saturnian's Avatar
    Join Date
    Dec 2017
    Location
    France
    Posts
    75

    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
    7,219

    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
    498

    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
    498

    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
    Lively Member saturnian's Avatar
    Join Date
    Dec 2017
    Location
    France
    Posts
    75

    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
    3,746

    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
    3,746

    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
    7,219

    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
    498

    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.

  12. #52
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    Re: Help needed on RC6, Webview2

    Quote Originally Posted by SearchingDataOnly View Post
    I've seen twinBasic make tremendous progress, and I'm very happy for Wayne and very happy for our vb6 community. However, don't you realize that twinBasic still has a long, long way to go to develop into a mature language, even at the current pace, it will take 3-5 years. You should know the characteristics of a mature language. In this sense, both twinBasic and Olaf's Basic are far, far away.

    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.

    8 years ago, Olaf also had ambitious plans to develop a new Basic compiler full-time, and we all know he has the ability. Suddenly, however, he was hired by a large company, and he was left with weekends writing code for the compiler for a few hours. Who can guarantee that this won't happen to Wayne? Jabaco seems to be the same.

    I'm sorry I poured cold water on the excitement, but I'm really worried about twinBasic's business model.
    maybe one day, microsoft or some company buys twinbasic, not to really develop him, but to prevent him from becoming stronger.
    blocking a product can prevent more free users and microsoft can make more money.

  13. #53
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Help needed on RC6, Webview2

    While I agree that speculation about the direction of the various VB6 replacements/supplements is a topic of endless interest and entertainment, let's try to get this thread back to the original intent...which seems like it might be resolved, in which case it should be marked as such.
    My usual boring signature: Nothing

  14. #54

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2011
    Posts
    498

    Re: Help needed on RC6, Webview2

    in post #51 i ask how to diferenciate which link is right clicked on.
    I would like to raise one menu for one link and another menu for another

    how can i query the url that i right click to see if i popup Menu A or Menu B depending on the link

    tks

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