programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: capturing a webpage

From: Charles Melice <mail_at_forthcad.com>
Date: Mon, 24 Oct 2005 19:18:21 +0200

----- Original Message -----
From: "Dr. Roger Dube" <rogerdube_at_dathq.com>
To: <sftalk_at_forth.com>
Sent: Sunday, October 23, 2005 8:38 PM
Subject: [sftalk] capturing a webpage

Here is a small test using the WININET Windows library.

Charles

_________

LIBRARY WININET.DLL

: f() Function: ;

f() InternetOpen ( zAgent Access zProxy zProxyBypass dwFlags -- hin )
f() InternetOpenUrl ( hI zUrl zHeaders dwHeadersLen dwFlags dwContext --
hi )
f() InternetReadFile ( hFile lpBuffer CountToRead addrCountRead --
bool )
f() InternetCloseHandle ( hInet -- bool )

1 constant INTERNET_OPEN_TYPE_DIRECT
$10000000 constant INTERNET_FLAG_ASYNC

: TEST ( -- )
    z" FORTH"
    INTERNET_OPEN_TYPE_DIRECT
    0
    0
    0
    ( .....) InternetOpen ?dup -exit >r

cr ." ------- InternetOpen OK -------" cr

        r@
        z" http://www.forth.com"
        0
        0
        0
        0
        ( ......) InternetOpenUrl ?dup
        IF
>r
cr ." ------- InternetOpenUrl (www.forth.com) OK -------" cr

            r@
            pad
            64
            here
            ( ....) InternetReadFile

cr ." ------- InternetReadFile (www.forth.com) "
            IF
   ." OK -------" cr
                pad here @ type cr
            ELSE
   ." ERROR -------" cr
            THEN
            r> InternetCloseHandle drop
        ELSE
cr ." ------- InternetOpenUrl (www.forth.com) ERROR -------" cr
        THEN
    r> InternetCloseHandle drop
;

.( type test
)

\\ eof

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Mon Oct 24 2005 - 10:19:20 PDT

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:20 PST