1 | ' api_wininet.sbp
|
---|
2 |
|
---|
3 | #ifdef UNICODE
|
---|
4 | Const _FuncName_InternetOpen = "InternetOpenW"
|
---|
5 | Const _FuncName_InternetConnect = "InternetConnectW"
|
---|
6 | Const _FuncName_FtpGetFile = "FtpGetFileW"
|
---|
7 | Const _FuncName_FtpGetCurrentDirectory = "FtpGetCurrentDirectoryW"
|
---|
8 | Const _FuncName_FtpSetCurrentDirectory = "FtpSetCurrentDirectoryW"
|
---|
9 | Const _FuncName_FtpFindFirstFile = "FtpFindFirstFileW"
|
---|
10 | Const _FuncName_InternetFindNextFile = "InternetFindNextFileW"
|
---|
11 | Const _FuncName_InternetOpenUrl = "InternetOpenUrlW"
|
---|
12 | Const _FuncName_HttpQueryInfo = "HttpQueryInfoW"
|
---|
13 | #else
|
---|
14 | Const _FuncName_InternetOpen = "InternetOpenA"
|
---|
15 | Const _FuncName_InternetConnect = "InternetConnectA"
|
---|
16 | Const _FuncName_FtpGetFile = "FtpGetFileA"
|
---|
17 | Const _FuncName_FtpGetCurrentDirectory = "FtpGetCurrentDirectoryA"
|
---|
18 | Const _FuncName_FtpSetCurrentDirectory = "FtpSetCurrentDirectoryA"
|
---|
19 | Const _FuncName_FtpFindFirstFile = "FtpFindFirstFileA"
|
---|
20 | Const _FuncName_InternetFindNextFile = "InternetFindNextFileA"
|
---|
21 | Const _FuncName_InternetOpenUrl = "InternetOpenUrlA"
|
---|
22 | Const _FuncName_HttpQueryInfo = "HttpQueryInfoA"
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | TypeDef HINTERNET = VoidPtr
|
---|
26 |
|
---|
27 | TypeDef INTERNET_PORT = Word
|
---|
28 |
|
---|
29 |
|
---|
30 | Const INTERNET_FLAG_RELOAD = &H80000000 'retrieve the original item
|
---|
31 |
|
---|
32 |
|
---|
33 | Const FTP_TRANSFER_TYPE_UNKNOWN = &H00000000
|
---|
34 | Const FTP_TRANSFER_TYPE_ASCII = &H00000001
|
---|
35 | Const FTP_TRANSFER_TYPE_BINARY = &H00000002
|
---|
36 |
|
---|
37 |
|
---|
38 | Const INTERNET_OPEN_TYPE_PRECONFIG = 0 'use registry configuration
|
---|
39 | Const INTERNET_OPEN_TYPE_DIRECT = 1 'direct to net
|
---|
40 | Const INTERNET_OPEN_TYPE_PROXY = 3 'via named proxy
|
---|
41 | Const INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY = 4 'prevent using java/script/INS
|
---|
42 |
|
---|
43 | Declare Function InternetOpen Lib "wininet.dll" Alias _FuncName_InternetOpen (
|
---|
44 | lpszAgent As LPCTSTR,
|
---|
45 | dwAccessType As DWord,
|
---|
46 | lpszProxy As LPCTSTR,
|
---|
47 | lpszProxyBypass As LPCTSTR,
|
---|
48 | dwFlags As DWord) As HINTERNET
|
---|
49 |
|
---|
50 | Const INTERNET_SERVICE_FTP = 1
|
---|
51 | Const INTERNET_SERVICE_GOPHER = 2
|
---|
52 | Const INTERNET_SERVICE_HTTP = 3
|
---|
53 |
|
---|
54 | Const INTERNET_FLAG_PASSIVE = &H08000000 'used for FTP connections
|
---|
55 |
|
---|
56 | Const INTERNET_INVALID_PORT_NUMBER = 0 'use the protocol-specific default
|
---|
57 | Const INTERNET_DEFAULT_FTP_PORT = 21 'default for FTP servers
|
---|
58 | Const INTERNET_DEFAULT_GOPHER_PORT = 70 ' " " gopher "
|
---|
59 | Const INTERNET_DEFAULT_HTTP_PORT = 80 ' " " HTTP "
|
---|
60 | Const INTERNET_DEFAULT_HTTPS_PORT = 443 ' " " HTTPS "
|
---|
61 | Const INTERNET_DEFAULT_SOCKS_PORT = 1080 'default for SOCKS firewall servers.
|
---|
62 |
|
---|
63 | Declare Function InternetConnect Lib "wininet.dll" Alias _FuncName_InternetConnect (
|
---|
64 | hInternet As HINTERNET,
|
---|
65 | lpszServerName As LPCTSTR,
|
---|
66 | nServerPort As INTERNET_PORT,
|
---|
67 | lpszUserName As LPCTSTR,
|
---|
68 | lpszPassword As LPCTSTR,
|
---|
69 | dwService As DWord,
|
---|
70 | dwFlags As DWord,
|
---|
71 | dwContext As DWORD_PTR) As HINTERNET
|
---|
72 |
|
---|
73 | Declare Function InternetCloseHandle Lib "wininet.dll" (hInternet As HINTERNET) As BOOL
|
---|
74 |
|
---|
75 | Declare Function InternetOpenUrl Lib "wininet.dll" Alias _FuncName_InternetOpenUrl (
|
---|
76 | hInternet As HINTERNET,
|
---|
77 | lpszUrl As LPCTSTR,
|
---|
78 | lpszHeaders As LPCTSTR,
|
---|
79 | dwHeadersLength As DWord,
|
---|
80 | dwFlags As DWord,
|
---|
81 | dwContext As DWORD_PTR ) As HINTERNET
|
---|
82 |
|
---|
83 |
|
---|
84 |
|
---|
85 | '----------------
|
---|
86 | ' HTTP
|
---|
87 | '----------------
|
---|
88 |
|
---|
89 | Const HTTP_QUERY_MIME_VERSION = 0
|
---|
90 | Const HTTP_QUERY_CONTENT_TYPE = 1
|
---|
91 | Const HTTP_QUERY_CONTENT_TRANSFER_ENCODING = 2
|
---|
92 | Const HTTP_QUERY_CONTENT_ID = 3
|
---|
93 | Const HTTP_QUERY_CONTENT_DESCRIPTION = 4
|
---|
94 | Const HTTP_QUERY_CONTENT_LENGTH = 5
|
---|
95 | Const HTTP_QUERY_CONTENT_LANGUAGE = 6
|
---|
96 | Const HTTP_QUERY_ALLOW = 7
|
---|
97 | Const HTTP_QUERY_PUBLIC = 8
|
---|
98 | Const HTTP_QUERY_DATE = 9
|
---|
99 | Const HTTP_QUERY_EXPIRES = 10
|
---|
100 | Const HTTP_QUERY_LAST_MODIFIED = 11
|
---|
101 | Const HTTP_QUERY_MESSAGE_ID = 12
|
---|
102 | Const HTTP_QUERY_URI = 13
|
---|
103 | Const HTTP_QUERY_DERIVED_FROM = 14
|
---|
104 | Const HTTP_QUERY_COST = 15
|
---|
105 | Const HTTP_QUERY_LINK = 16
|
---|
106 | Const HTTP_QUERY_PRAGMA = 17
|
---|
107 | Const HTTP_QUERY_VERSION = 18 ' special: part of status line
|
---|
108 | Const HTTP_QUERY_STATUS_CODE = 19 ' special: part of status line
|
---|
109 | Const HTTP_QUERY_STATUS_TEXT = 20 ' special: part of status line
|
---|
110 | Const HTTP_QUERY_RAW_HEADERS = 21 ' special: all headers as ASCIIZ
|
---|
111 | Const HTTP_QUERY_RAW_HEADERS_CRLF = 22 ' special: all headers
|
---|
112 | Const HTTP_QUERY_CONNECTION = 23
|
---|
113 | Const HTTP_QUERY_ACCEPT = 24
|
---|
114 | Const HTTP_QUERY_ACCEPT_CHARSET = 25
|
---|
115 | Const HTTP_QUERY_ACCEPT_ENCODING = 26
|
---|
116 | Const HTTP_QUERY_ACCEPT_LANGUAGE = 27
|
---|
117 | Const HTTP_QUERY_AUTHORIZATION = 28
|
---|
118 | Const HTTP_QUERY_CONTENT_ENCODING = 29
|
---|
119 | Const HTTP_QUERY_FORWARDED = 30
|
---|
120 | Const HTTP_QUERY_FROM = 31
|
---|
121 | Const HTTP_QUERY_IF_MODIFIED_SINCE = 32
|
---|
122 | Const HTTP_QUERY_LOCATION = 33
|
---|
123 | Const HTTP_QUERY_ORIG_URI = 34
|
---|
124 | Const HTTP_QUERY_REFERER = 35
|
---|
125 | Const HTTP_QUERY_RETRY_AFTER = 36
|
---|
126 | Const HTTP_QUERY_SERVER = 37
|
---|
127 | Const HTTP_QUERY_TITLE = 38
|
---|
128 | Const HTTP_QUERY_USER_AGENT = 39
|
---|
129 | Const HTTP_QUERY_WWW_AUTHENTICATE = 40
|
---|
130 | Const HTTP_QUERY_PROXY_AUTHENTICATE = 41
|
---|
131 | Const HTTP_QUERY_ACCEPT_RANGES = 42
|
---|
132 | Const HTTP_QUERY_SET_COOKIE = 43
|
---|
133 | Const HTTP_QUERY_COOKIE = 44
|
---|
134 | Const HTTP_QUERY_REQUEST_METHOD = 45 ' special: GET/POST etc.
|
---|
135 | Const HTTP_QUERY_REFRESH = 46
|
---|
136 | Const HTTP_QUERY_CONTENT_DISPOSITION = 47
|
---|
137 |
|
---|
138 | Declare Function HttpQueryInfo Lib "wininet.dll" Alias _FuncName_HttpQueryInfo (
|
---|
139 | hRequest As HINTERNET,
|
---|
140 | dwInfoLevel As DWord,
|
---|
141 | lpBuffer As VoidPtr,
|
---|
142 | ByRef lpdwBufferLength As DWord,
|
---|
143 | ByRef lpdwIndex As DWord ) As BOOL
|
---|
144 |
|
---|
145 |
|
---|
146 | '----------------
|
---|
147 | ' FTP
|
---|
148 | '----------------
|
---|
149 |
|
---|
150 | Declare Function FtpGetFile Lib "wininet.dll" Alias _FuncName_FtpGetFile (
|
---|
151 | hConnect As HINTERNET,
|
---|
152 | lpszRemoteFile As LPCTSTR,
|
---|
153 | lpszNewFile As LPCTSTR,
|
---|
154 | fFailIfExists As BOOL,
|
---|
155 | dwFlagsAndAttributes As DWord,
|
---|
156 | dwFlags As DWord,
|
---|
157 | dwContext As DWORD_PTR) As BOOL
|
---|
158 |
|
---|
159 | Declare Function FtpGetCurrentDirectory Lib "wininet.dll" Alias _FuncName_FtpGetCurrentDirectory (
|
---|
160 | hConnect As HINTERNET,
|
---|
161 | lpszCurrentDirectory As LPTSTR,
|
---|
162 | lpdwCurrentDirectory As DWord) As BOOL
|
---|
163 |
|
---|
164 | Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias _FuncName_FtpSetCurrentDirectory (
|
---|
165 | hConnect As HINTERNET,
|
---|
166 | lpszDirectory As LPCTSTR) As BOOL
|
---|
167 |
|
---|
168 | Declare Function FtpFindFirstFile Lib "wininet.dll" Alias _FuncName_FtpFindFirstFile (
|
---|
169 | hConnect As HINTERNET,
|
---|
170 | lpszSearchFile As LPCTSTR,
|
---|
171 | ByRef FindFileData As WIN32_FIND_DATA,
|
---|
172 | dwFlags As DWord,
|
---|
173 | dwContext As DWORD_PTR) As HINTERNET
|
---|
174 |
|
---|
175 | Declare Function InternetFindNextFile Lib "wininet.dll" Alias _FuncName_InternetFindNextFile (
|
---|
176 | hFind As HINTERNET,
|
---|
177 | ByREf vFindData As Any) As BOOL
|
---|