WebBrowserEX

Discussion in 'Additional Libraries' started by Cableguy, Oct 14, 2008.

  1. Cableguy

    Cableguy Expert Licensed User

    WebBrowserEX 2.1

    WebBrowserEX.DLL

    This is an evolution of Andrew Graham's WebBrowser control library.

    It enables a few new properties and methods that were not available in previoue releases.

    All of the previous properties, methods and events are still present, so this will focus on the new ones aded to the base dll.




    properties:


    DLLVersion - Returns the Dll Version Number.
    In this case it wil, return "2.1" as it is based in Andrews "1.0" WebBrowser DLL.

    DocumentText - Can now GET current document text(html)

    ScrollBars - Boolean, sets or gets wheter the scrollbars are visible or not

    FocusedControlName - String, gets the name of the WebBrowser Document Controls that has the focus...
    Can be used to learn the name of textboxes in a webForm, for later filling...

    FocusedControlID - String, gets the ID of the WebBrowser Document Controls that has the focus...
    Can be used to learn the name of textboxes in a webForm, for later filling...

    ControlValue - String, sets or gets the value of the focused control

    SupressScriptErrors - Boolean, Enables or disable the script error catching by the browser NEW

    ContextMenuEnabled - Boolean, Enables or disables the Browser context menu NEW


    methods:

    Cookie - Retrieves the current document cookies...NEW

    SendControlClick(String ID) - Fires the click event (if supported) of the specified control (either by ID or by Name)
    Can be used to trigger a webform "submit" button instead of using the POST method

    SetControlFocus(String Control) - Sets the focus to the specified webBrowser document based control, such as a textbox, either by ID or by name

    Refresh() - Reloads the current url

    Zoom(int factor) - Optical Zoom, as in IE7...


    Most of these properties, methods and events work on any platform, BUT some are, as earlier referred by Andrew, not available in some OS versions, Other throw an error, and others are only available in the desktop, like the zoom feature.

    I haven't tryied this in a device, because i do not have mobile data access enabled in my Universal.
    Edit:
    It is safer to say that this is a DESKTOP ONLY dll.


    This is still a work in progress, so more properties, methods or events can be added, as needed and as possible.
    Use this thread to post your opinion or suggestion for future versions.

    Better demo file Uploaded, enjoy!!
     

    Attached Files:

    Last edited: Mar 1, 2009
  2. tsteward

    tsteward Active Member Licensed User

    Ok giving your browser library a try and I get an error when I try to compile.
    See attached screen dump.
     

    Attached Files:

  3. agraham

    agraham Expert Licensed User

    I am afraid that this is a desktop only library. It is currently compiled for desktop use and will not compile for the device as it stands as it references some properties and methods that are not present on the device.
     
  4. agraham

    agraham Expert Licensed User

    You can hide them by prepending an underscore to their names "_MyBrowser", "_OLECMDID" etc. B4ppc will not then show them as objects.
     
  5. Cableguy

    Cableguy Expert Licensed User

    Thanks for the hint...
    I have managed to hide the remaining objects from b4ppc...
    I will release the new file with a new update...
    I'm hopping to add a "links collection" array to the dll, so to list all the links present in a html document...
     
  6. tsteward

    tsteward Active Member Licensed User

    :sign0161: not happy.....
     
  7. tsteward

    tsteward Active Member Licensed User

    I am considering useing your lib on the desktop version of my program.

    Since with this lib you can get DocumentText. Is it possible to create a search feature to find some text then highlight it and scroll to make it visible?

    Easy done with a text box but not sure with this lib.
     
  8. Cableguy

    Cableguy Expert Licensed User

    Yes it is possible except for the auto scroll(yet)...
    1st get the text with documenttext
    2nd treat the resulting string as you normaly would do to serach for the word(s) you want
    3rd Insert the needee html code to highling the word(s)
    4rth show the resulting string using agian the document text

    'll try to work out how to auto scroll to the highlighted word..
     
  9. tsteward

    tsteward Active Member Licensed User

    A few questions if you don't mind.
    When adding objects I notice you have

    IWebBrowser2
    MyBrowser
    WebBrowser

    Whats the differance? What are they for?

    Also in your test file line 20:
    Code:
    MyBrowser.FocusControl("Button")
    I notice "FocusControl" is not in the popup list when using the IDE?

    And I cant compile with your library. I cant even compile your test file for the desktop. Will this be fixed soon?
     
    Last edited: Oct 20, 2008
  10. Cableguy

    Cableguy Expert Licensed User

    whch demo file are you using?
    The WebBrowserDemo.spb is much complete and targets the current dll...
    The Objects, as pointe in one of my posts, are public methods created in the dll, for internal use...
    The next release of the dll, will only make public the Wbbrowser Object, That IS the one object to use.

    Also I had NO problem compiling in either the Optimized compile or legacy compile...WITH THE WEBBROWSERDEMO.SPB FILE...
     
    Last edited: Oct 20, 2008
  11. tsteward

    tsteward Active Member Licensed User

    My apologies, yes the newer demo does compile.

    Thanks
     
  12. Byak@

    Byak@ Active Member Licensed User

    Greating Cableguy!what about creating new webbrowser for device?with programing scroll and zoom and edited contextmenu?
     
  13. Cableguy

    Cableguy Expert Licensed User

    This Dll has beeen updated...
    Version 2.1 available in the first post...
    2 new props, SupressScriptErrors and ContextMenuEnabled, 1 new method, Cookie...
    Enjoy
     
  14. Cableguy

    Cableguy Expert Licensed User

    Mergeable cs file posted in post #1... remove the .txt from the file name and copy the file to the libraries folder...
     
  15. tsteward

    tsteward Active Member Licensed User

    I agree any chance of making a device friendly version.
     
  16. agraham

    agraham Expert Licensed User

    I don't think that a new WebBrowser for the device will happen. If I'm not willing to tackle it (and I'm not!) I don't think anyone else around here can/will. However for formatting text on the device, and desktop, please try this possible solution http://www.basic4ppc.com/forum/additional-libraries/3955-htmlpanel-rich-text-device.html#post22886 and give some suggestions for improvement.
     
  17. Byak@

    Byak@ Active Member Licensed User

    Hello Cableguy. what about adding methods to control ScrollBars? as HScrollValue/VScrollValue. and event Scrolled
    and what about method to set contect menu as FormLib contextmenu object? it will be very good!

    _________________________
    i'm read msdn...it is not possible =(((

    and i can't find Shrink property o_O.OK,who know html?how can i do "shrink" with html?
     
    Last edited: Jul 24, 2009
  18. Byak@

    Byak@ Active Member Licensed User

    i'm not understand...

    i'm create a new object WebBrowser.add DocumentText
    Code:
    <html>
    <input name=
    "textbox" value="" type="text">
    </html>
    (code1)
    now i input some text to 'textbox' and get DocumentText.But i'm get code1! 'value' is empty!
    why?
    i'm try focuse 'textbox' and get ControlValue but have a empty string!i can set ControlValue.But if i now get controlvalue i have empty string too.
     
    Last edited: Jul 24, 2009
  19. Cableguy

    Cableguy Expert Licensed User

    HUM... In your example code "value" is EMPTY...(?)
    Can you please post a sample file?
    To focus you must Know or set the html name tag for the control, or the control ID, Both are html tags, so first try to explore the html code...
    For exmaple, My dll2date "Program wannabe", uses these props to fill a username and password field in a form, using those same methods, but for the username control, I had to tweak the html to "force2 a name tag for the control.
     
  20. Byak@

    Byak@ Active Member Licensed User

    emm...i'm post code =)

    Code:
    <html>
    <input name="textbox" value="" type="text">
    </html>

    now value is empty but when i'm input text or set value it is not empty...but property return a clear string
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice