Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

WinHttpOpen (winhttp)
 
.
Summary
TODO - a short description

C# Signature:

[DllImport("Winhttp.dll", SetLastError = true)]
static extern IntPtr WinHttpOpen(
        String pszAgent,
        UInt32 dwAccessType,
        [MarshalAs(UnmanagedType.LPWStr)] String pszProxyW,
        [MarshalAs(UnmanagedType.LPWStr)] String pszProxyBypass,
        UInt32 dwFlags);

[DllImport("winhttp.dll", SetLastError=true)]
static extern IntPtr WinHttpOpenRequest(
            IntPtr hConnect,
            [MarshalAs(UnmanagedType.LPWStr)] string pwszVerb,
            [MarshalAs(UnmanagedType.LPWStr)] string pwszObjectName,
            [MarshalAs(UnmanagedType.LPWStr)] string pwszVersion,
            [MarshalAs(UnmanagedType.LPWStr)] string pwszReferrer,
            ref byte[] ppwszAcceptTypes,
            int dwFlags);

or

[DllImport("winhttp.dll", SetLastError=true)]
static extern IntPtr WinHttpOpenRequest(
            IntPtr hConnect,
            [MarshalAs(UnmanagedType.LPWStr)] string pwszVerb,
            [MarshalAs(UnmanagedType.LPWStr)] string pwszObjectName,
            [MarshalAs(UnmanagedType.LPWStr)] string pwszVersion,
            [MarshalAs(UnmanagedType.LPWStr)] string pwszReferrer,
            ref byte[] ppwszAcceptTypes,
            InternetFlags dwFlags);

User-Defined Types:

[Flags]
public enum InternetFlags : uint
{
     ESCAPE_PERCENT = 0x00000004,
     NULL_CODEPAGE = 0x00000008,
     ESCAPE_DISABLE = 0x00000040,
     ESCAPE_DISABLE_QUERY = 0x00000080,
     BYPASS_PROXY_CACHE = 0x00000100,
     REFRESH = BYPASS_PROXY_CACHE,
     SECURE = 0x00800000,
     ASYNC = 0x10000000
}

<Flags()> _
Enum InternetFlags As UInteger
   ESCAPE_PERCENT = &H4
   NULL_CODEPAGE = &H8
   ESCAPE_DISABLE = &H40
   ESCAPE_DISABLE_QUERY = &H80
   BYPASS_PROXY_CACHE = &H100
   REFRESH = BYPASS_PROXY_CACHE
   SECURE = &H800000
   ASYNC = &H10000000
End Enum

VB Signature:

Declare Function WinHttpOpenRequest Lib "winhttp.dll" (ByVal hConnect As IntPtr, ByVal pwszVerb As String, ByVal pwszObjectName As String, ByVal pwszVersion As String, ByVal pwszReferrer As String, ByRef ppwszAcceptTypes As Byte(), ByVal dwFlags As InternetFlags) As IntPtr

Declare Function WinHttpOpen Lib "winhttp.dll" (
   ByVal pszAgent As String, _
   ByVal dwAccessType As UInteger, _
   ByVal pszProxyW As String, _
   ByVal pszProxyBypass As String, _
   ByVal dwFlags As UInteger) As IntPtr

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions