Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

InternetDial function

Initiates a connection to the Internet using a modem.


DWORD InternetDial(
  _In_  HWND      hwndParent,
  _In_  LPTSTR    pszEntryName,
  _In_  DWORD     dwFlags,
  _Out_ DWORD_PTR *lpdwConnection,
  _In_  DWORD     dwReserved


hwndParent [in]

Handle to the parent window.

pszEntryName [in]

Pointer to a null-terminated string that specifies the name of the dial-up connection to be used. If this parameter contains the empty string (""), the user chooses the connection. If this parameter is NULL, the function connects to the autodial connection.

dwFlags [in]

Options. This parameter can be one of the following values.


Forces an online connection.


Forces an unattended Internet dial-up. If user intervention is required, the function will fail.


Ignores the "dial automatically" setting and forces the dialing user interface to be displayed.


Connects to the Internet through a modem, without displaying a user interface, if possible. Otherwise, the function will wait for user input.


Shows the Work Offline button instead of the Cancel button in the dialing user interface.


lpdwConnection [out]

Pointer to a variable that specifies the connection number. This number is a unique indentifier for the connection that can be used in other functions, such as InternetHangUp.

dwReserved [in]

This parameter is reserved and must be NULL.

Return value

Returns ERROR_SUCCESS if successful, or an error value otherwise. The error code can be one of the following values.

Return codeDescription

One or more of the parameters are incorrect.


There is a problem with the dial-up connection.


The user clicked either the Work Offline or Cancel button on the Internet connection dialog box.



InternetDial does not support double-dial connections, SmartCard authentication, or connections that require registry-based certification.

Note  Starting on Windows Vista and Windows Server 2008, the WinINet dial-up functions use the RAS functions to establish a dial-up connection. WinINet supports the functionality documented in the RasDialDlg function.

Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.

Note  WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP).


Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server







Unicode and ANSI names

InternetDialW (Unicode) and InternetDialA (ANSI)

See also

Establishing a Dial-Up Connection to the Internet
WinINet Functions



© 2015 Microsoft