Announcement

Collapse
No announcement yet.

Using CWindow to embed the WebBrowser control

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    How difficult is it to use an address instead of GEO coordinates. This url does what I am looking to accomplish.

    http://maps.google.com?q=6326+Rucker...ciently%A0long!)

    Comment


    • #22
      I keep getting an error in this line:
      Code:
         pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, bstrURL, NOTHING, 0, 0, nWide, nHigh)
      It stops at "NOTHING". (That is not meant to be funny!)
      Last edited by Brian Reynolds; 26 Apr 2017, 12:41 AM.
      Brian.

      Comment


      • #23
        Compiles fine here. Which error are you getting? Which compiler are you using?
        Forum: http://www.jose.it-berater.org/smfforum/index.php

        Comment


        • #24
          I'm using PBWin 10.4. The only error message I'm getting in "NOTHING".
          Brian.

          Comment


          • #25
            Are you using José api headers III version 1.07


            Comment


            • #26
              Jose, I should mention that I am no whizz-kid at programming.

              My Include file path is: "C:\PBWin10\WINAPI_119" which is the folder containing your API includes

              I tried your first example, headed: Using CWindow to embed the WebBrowser control. I got the following error in this line:

              Code:
                 pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, rv$, NOTHING, 0, 0, nWide, nHigh
              The error is at NOTHING

              I then tried the next code, headed: WebBroser control with events. I got an error here:
              Code:
                 pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, bstrURL, pWBEvents, 0, 0, nWide, nHigh)
              The error is at pWBEvents

              I then tried the next code, headed: WebBrowser control customized. I got an error here:
              Code:
                 pWindow.SetClientSize 600, 350
              The error is at 600

              Brian.

              Comment


              • #27
                Pierre asked if I was using III Version 1.07.
                I deleted the APIs I was using and downloaded III Version 1.07. The code now works fine.
                Thank you for your interest and I apologise for apparently making an error when downloading the file .
                Brian.

                Comment


                • #28
                  Great ! :-)
                  The version 1.19 is for PowerBASIC Win9 / CC5

                  Comment


                  • #29
                    > Thank you for your interest and I apologise for apparently making an error when downloading the file.

                    I knew this was going to happen some day... I didn't want to post the includes for PBWIN 9, but some insisted when this compiler was given for free during a short time.
                    Forum: http://www.jose.it-berater.org/smfforum/index.php

                    Comment


                    • #30
                      Is it possible to have Excel modal in a dialog?
                      I want to embed Excel so it appears that it belongs to the dialog. I have tried José CWindow but it does not work as I want. If I use PDF or a browser, it works just fine. But Excel and Word does not?


                      Code:
                      #COMPILE EXE
                      #DIM ALL
                      %UNICODE = 1
                      
                      ' // Include files for external files
                      %USEWEBBROWSER = 1            ' // Use the WebBrowser control
                      #INCLUDE ONCE "CWindow.inc"   ' // CWindow class
                      
                      ' // Identifier
                      %IDC_WEBBROWSER = 1001
                      
                      ' ########################################################################################
                      ' Main
                      ' ########################################################################################
                      FUNCTION PBMAIN
                      
                         ' // Create the dialog
                         LOCAL hDlg AS DWORD
                         DIALOG NEW PIXELS, 0, "WebBrowser", , , 600, 350, %WS_OVERLAPPEDWINDOW TO hDlg
                      
                         ' // Create an instance of the class
                         LOCAL pWindow AS IWindow
                         pWindow = CLASS "CWindow"
                         IF ISNOTHING(pWindow) THEN EXIT FUNCTION
                      
                         ' // Add a WebBrowser control
                         LOCAL bstrURL AS WSTRING
                      
                         ' // You can pass a URL
                      '   bstrURL = "http://www.powerbasic.com/support/pbforums/index.php"
                      
                         ' // or a path to an Active document file (Excel, Word or PDF)
                         bstrURL = EXE.PATH$ & "test.xlsx"              ' <-- change me!
                      '   bstrURL = EXE.Path$ & "test.docx"            ' <-- change me!
                      '   bstrURL = EXE.Path$ & "test.pdf"    ' <-- change me!
                      
                      
                      
                         ' // Create the WebBrowser control
                         LOCAL nWide, nHigh AS LONG
                         DIALOG GET CLIENT hDlg TO nWide, nHigh
                         pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, bstrURL, NOTHING, 0, 0, nWide, nHigh)
                      
                         ' // Display and activate the dialog
                         DIALOG SHOW MODAL hDlg, CALL DlgProc
                      
                      END FUNCTION
                      ' ########################################################################################
                      
                      ' ========================================================================================
                      ' Main Dialog procedure
                      ' ========================================================================================
                      CALLBACK FUNCTION DlgProc() AS LONG
                      
                         SELECT CASE CBMSG
                      
                            CASE %WM_COMMAND
                               SELECT CASE CB.CTL
                                  ' ...
                                  ' ...
                               END SELECT
                      
                            CASE %WM_SIZE
                               IF CB.WPARAM <> %SIZE_MINIMIZED THEN
                                  ' // Resize the control
                                  LOCAL nWide, nHigh AS LONG
                                  DIALOG GET CLIENT CB.HNDL TO nWide, nHigh
                                  CONTROL SET SIZE CB.HNDL, %IDC_WEBBROWSER, nWide, nHigh
                                  '? str$(nWide)
                               END IF
                      
                         END SELECT
                      
                      END FUNCTION

                      Comment


                      • #31
                        It used to be easy many years ago, in WIndowsXP times, but then came all these new security measures... If there is a solution, probably it will be very convoluted. I no longer use Office, so I can't offer any help. Sorry.
                        Forum: http://www.jose.it-berater.org/smfforum/index.php

                        Comment


                        • #32
                          Nice Jose,

                          I notice that all these apps do not use any button commands from the dialog. As in:

                          Code:
                           
                          CASE %WM_COMMAND SELECT CASE CB.CTL ' ... ' ... END SELECT
                          How would I emulate an onclick event with a dialog button push?
                          Should I write an HTML script to send a push event or should I connect directly to CHTMLDocumentEvents2 and send it onclick?

                          Thanks

                          Comment

                          Working...
                          X