Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: Koen Piller
  Where is Koen Piller?
 Santpoort-Zuid
 Netherlands
 Koen Piller
 Tags
Subject: RE: save URL
Thread ID: 104571 Message ID: 104746 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Win32API programming
Date: Sunday, August 20, 2006 12:18:45 PM         
   


Koen, try this:
CLEAR
lcStart_ZIP = "1012KK"
lcStart_ADDRESS = "Rokin"
lcStart_CITY = "Amsterdam"
STORE [] TO lcDestination_ADDRESS,;
            lcDestination_ZIP,;
            lcDestination_CITY
if !empty(lcDestination_ADDRESS) and !empty(lcDestination_ZIP) and !empty(lcDestination_CITY)
   lGoOn = .t.
endif

cUrl = "http://maps.msn.nl/(fod04h45plkqt1452pedqs45)/DirectionsFind.aspx?"+;
        "strt1=" + lcStart_ADDRESS+;
        "&zipc1=" + lcStart_ZIP+;
        "&city1=" + lcStart_CITY+;
        "&strt2=" + lcDestination_ADDRESS+;
        "&zipc2=" + lcDestination_ZIP+;
        "&city2=" + lcDestination_CITY+;
        "&stnm1=" +;
        "&cnty1=12" +;
        "&stnm2=" +;
        "&cnty2=12" +;
        "&src=GM"
tcUrl=cUrl
*    if lGoOn = .t.
public lcNewURL
public oBrowser
oBrowser = createobject("internetexplorer.application")
x=NEWOBJECT("myclass")
EVENTHANDLER(obrowser,x)

oBrowser.navigate(tcUrl)
oBrowser.visible = .t.
ldDT = DATETIME()
DO WHILE oBrowser.ReadyState < 4 AND DATETIME() - ldDT < 30 && (30 secs timeout)
    DOEVENTS
ENDDO

DO WHILE TYPE([oBrowser.Name]) == [C] && Wait untill user close IE
    DOEVENTS
ENDDO



DEFINE CLASS myclass AS session OLEPUBLIC

    IMPLEMENTS DWebBrowserEvents2 IN "c:\windows\system32\shdocvw.dll"

    PROCEDURE DWebBrowserEvents2_StatusTextChange(Text AS STRING) AS VOID;
                 HELPSTRING "Statusbar text changed."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_ProgressChange(Progress AS Number, ProgressMax AS Number) AS VOID;
                 HELPSTRING "Fired when download progress is updated."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_CommandStateChange(Command AS Number, Enable AS LOGICAL) AS VOID;
                 HELPSTRING "The enabled state of a command changed."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_DownloadBegin() AS VOID;
                 HELPSTRING "Download of a page started."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_DownloadComplete() AS VOID;
                 HELPSTRING "Download of page complete."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_TitleChange(Text AS STRING) AS VOID;
                 HELPSTRING "Document title changed."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_PropertyChange(szProperty AS STRING) AS VOID;
                 HELPSTRING "Fired when the PutProperty method has been called."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_BeforeNavigate2(pDisp AS VARIANT, URL AS VARIANT, Flags AS VARIANT, TargetFrameName AS VARIANT, PostData AS VARIANT, Headers AS VARIANT, Cancel AS LOGICAL @) AS VOID;
                 HELPSTRING "Fired before navigate occurs in the given WebBrowser (window or frameset element). The processing of this navigation may be modified."
    * add user code here
    ? [DWebBrowserEvents2_BeforeNavigate2],url
    ENDPROC

    PROCEDURE DWebBrowserEvents2_NewWindow2(ppDisp AS VARIANT @, Cancel AS LOGICAL @) AS VOID;
                 HELPSTRING "A new, hidden, non-navigated WebBrowser window is needed."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_NavigateComplete2(pDisp AS VARIANT, URL AS VARIANT) AS VOID;
                 HELPSTRING "Fired when the document being navigated to becomes visible and enters the navigation stack."
    * add user code here
    ? [DWebBrowserEvents2_NavigateComplete2],url
    ENDPROC

    PROCEDURE DWebBrowserEvents2_DocumentComplete(pDisp AS VARIANT, URL AS VARIANT) AS VOID;
                 HELPSTRING "Fired when the document being navigated to reaches ReadyState_Complete."
    * add user code here
    ?[DWebBrowserEvents2_DocumentComplete],url
    ENDPROC

    PROCEDURE DWebBrowserEvents2_OnQuit() AS VOID;
                 HELPSTRING "Fired when application is quiting."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_OnVisible(Visible AS LOGICAL) AS VOID;
                 HELPSTRING "Fired when the window should be shown/hidden"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_OnToolBar(ToolBar AS LOGICAL) AS VOID;
                 HELPSTRING "Fired when the toolbar  should be shown/hidden"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_OnMenuBar(MenuBar AS LOGICAL) AS VOID;
                 HELPSTRING "Fired when the menubar should be shown/hidden"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_OnStatusBar(StatusBar AS LOGICAL) AS VOID;
                 HELPSTRING "Fired when the statusbar should be shown/hidden"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_OnFullScreen(FullScreen AS LOGICAL) AS VOID;
                 HELPSTRING "Fired when fullscreen mode should be on/off"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_OnTheaterMode(TheaterMode AS LOGICAL) AS VOID;
                 HELPSTRING "Fired when theater mode should be on/off"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_WindowSetResizable(Resizable AS LOGICAL) AS VOID;
                 HELPSTRING "Fired when the host window should allow/disallow resizing"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_WindowSetLeft(Left AS Number) AS VOID;
                 HELPSTRING "Fired when the host window should change its Left coordinate"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_WindowSetTop(Top AS Number) AS VOID;
                 HELPSTRING "Fired when the host window should change its Top coordinate"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_WindowSetWidth(Width AS Number) AS VOID;
                 HELPSTRING "Fired when the host window should change its width"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_WindowSetHeight(Height AS Number) AS VOID;
                 HELPSTRING "Fired when the host window should change its height"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_WindowClosing(IsChildWindow AS LOGICAL, Cancel AS LOGICAL @) AS VOID;
                 HELPSTRING "Fired when the WebBrowser is about to be closed by script"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_ClientToHostWindow(CX AS Number @, CY AS Number @) AS VOID;
                 HELPSTRING "Fired to request client sizes be converted to host window sizes"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_SetSecureLockIcon(SecureLockIcon AS Number) AS VOID;
                 HELPSTRING "Fired to indicate the security level of the current web page contents"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_FileDownload(Cancel AS LOGICAL @, test) AS VOID;
                 HELPSTRING "Fired to indicate the File Download dialog is opening"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_NavigateError(pDisp AS VARIANT, URL AS VARIANT, Frame AS VARIANT, StatusCode AS VARIANT, Cancel AS LOGICAL @) AS VOID;
                 HELPSTRING "Fired when a binding error occurs (window or frameset element)."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_PrintTemplateInstantiation(pDisp AS VARIANT) AS VOID;
                 HELPSTRING "Fired when a print template is instantiated."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_PrintTemplateTeardown(pDisp AS VARIANT) AS VOID;
                 HELPSTRING "Fired when a print template destroyed."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_UpdatePageStatus(pDisp AS VARIANT, nPage AS VARIANT, fDone AS VARIANT) AS VOID;
                 HELPSTRING "Fired when a page is spooled. When it is fired can be changed by a custom template."
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_PrivacyImpactedStateChange(bImpacted AS LOGICAL) AS VOID;
                 HELPSTRING "Fired when the global privacy impacted state changes"
    * add user code here
    ENDPROC

    PROCEDURE DWebBrowserEvents2_NewWindow3(ppDisp AS VARIANT @, Cancel AS LOGICAL @, dwFlags AS NUMBER, bstrUrlContext AS STRING, bstrUrl AS STRING) AS VOID;
                 HELPSTRING "A new, hidden, non-navigated WebBrowser window is needed."
    * add user code here
    ENDPROC

ENDDEFINE

Borislav Borissov



ENTIRE THREAD

save URL Posted by Koen Piller @ 8/17/2006 6:11:00 PM
RE: save URL Posted by Mike Gagnon @ 8/17/2006 7:36:47 PM
RE: save URL Posted by Koen Piller @ 8/17/2006 10:07:25 PM
RE: save URL Posted by Mike Gagnon @ 8/18/2006 12:00:16 PM
RE: save URL Posted by Koen Piller @ 8/18/2006 2:18:11 PM
RE: save URL Posted by Mike Gagnon @ 8/19/2006 12:55:36 PM
RE: save URL Posted by Koen Piller @ 8/19/2006 6:12:19 PM
RE: save URL Posted by Mike Gagnon @ 8/19/2006 6:33:36 PM
RE: save URL Posted by Koen Piller @ 8/20/2006 1:03:13 AM
RE: save URL Posted by Borislav Borissov @ 8/20/2006 7:56:46 AM
RE: save URL Posted by Koen Piller @ 8/20/2006 8:43:32 AM
RE: save URL Posted by Borislav Borissov @ 8/20/2006 12:18:45 PM
RE: save URL Posted by Koen Piller @ 8/20/2006 1:14:42 PM
RE: save URL Posted by Borislav Borissov @ 8/20/2006 2:50:33 PM
RE: save URL Posted by Koen Piller @ 8/20/2006 3:53:04 PM
RE: save URL Posted by Borislav Borissov @ 8/20/2006 5:40:43 PM
RE: save URL Posted by Koen Piller @ 8/20/2006 5:58:09 PM
RE: save URL Posted by Borislav Borissov @ 8/20/2006 6:07:20 PM
RE: save URL Posted by Koen Piller @ 8/20/2006 6:45:10 PM
RE: save URL Posted by Borislav Borissov @ 8/20/2006 6:53:50 PM