Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
3.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: I N T N E T U I . C P P
  7. //
  8. // Contents: Dial-up Connection UI object for inernet connection.
  9. //
  10. // Notes:
  11. //
  12. // Author: asinha 13 Dec 2000
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include "intnetui.h"
  18. //+---------------------------------------------------------------------------
  19. // INetConnectionConnectUi
  20. //
  21. STDMETHODIMP
  22. CInternetConnectionUi::SetConnection (
  23. INetConnection* pCon)
  24. {
  25. return HrSetConnection (pCon, this);
  26. }
  27. STDMETHODIMP
  28. CInternetConnectionUi::Connect (
  29. HWND hwndParent,
  30. DWORD dwFlags)
  31. {
  32. HRESULT hr = HrConnect (hwndParent, dwFlags, this,
  33. static_cast<INetConnectionConnectUi*>(this));
  34. TraceError ("CInternetConnectionUi::Connect", (S_FALSE == hr) ? S_OK : hr);
  35. return hr;
  36. }
  37. STDMETHODIMP
  38. CInternetConnectionUi::Disconnect (
  39. HWND hwndParent,
  40. DWORD dwFlags)
  41. {
  42. return HrDisconnect (hwndParent, dwFlags);
  43. }
  44. //+---------------------------------------------------------------------------
  45. // INetConnectionPropertyUi2
  46. //
  47. STDMETHODIMP
  48. CInternetConnectionUi::AddPages (
  49. HWND hwndParent,
  50. LPFNADDPROPSHEETPAGE pfnAddPage,
  51. LPARAM lParam)
  52. {
  53. HRESULT hr = HrAddPropertyPages (hwndParent, pfnAddPage, lParam);
  54. TraceError ("CInternetConnectionUi::AddPages (INetConnectionPropertyUi)", hr);
  55. return hr;
  56. }
  57. STDMETHODIMP
  58. CInternetConnectionUi::GetIcon (
  59. DWORD dwSize,
  60. HICON *phIcon )
  61. {
  62. HRESULT hr;
  63. Assert (phIcon);
  64. hr = HrGetIconFromMediaType(dwSize, NCM_PHONE, NCSM_NONE, 7, 0, phIcon);
  65. TraceError ("CLanConnectionUi::GetIcon (INetConnectionPropertyUi2)", hr);
  66. return hr;
  67. }
  68. //+---------------------------------------------------------------------------
  69. // INetConnectionWizardUi
  70. //
  71. STDMETHODIMP
  72. CInternetConnectionUi::QueryMaxPageCount (
  73. INetConnectionWizardUiContext* pContext,
  74. DWORD* pcMaxPages)
  75. {
  76. HRESULT hr = HrQueryMaxPageCount (pContext, pcMaxPages);
  77. TraceError ("CInternetConnectionUi::QueryMaxPageCount", hr);
  78. return hr;
  79. }
  80. STDMETHODIMP
  81. CInternetConnectionUi::AddPages (
  82. INetConnectionWizardUiContext* pContext,
  83. LPFNADDPROPSHEETPAGE pfnAddPage,
  84. LPARAM lParam)
  85. {
  86. HRESULT hr = HrAddWizardPages (pContext, pfnAddPage, lParam,
  87. RASEDFLAG_NewPhoneEntry | RASEDFLAG_InternetEntry);
  88. TraceError ("CInternetConnectionUi::AddPages (INetConnectionWizardUi)", hr);
  89. return hr;
  90. }
  91. STDMETHODIMP
  92. CInternetConnectionUi::GetSuggestedConnectionName (
  93. PWSTR* ppszwSuggestedName)
  94. {
  95. HRESULT hr = HrGetSuggestedConnectionName (ppszwSuggestedName);
  96. TraceError ("CInternetConnectionUi::GetSuggestedConnectionName", hr);
  97. return hr;
  98. }
  99. STDMETHODIMP
  100. CInternetConnectionUi::GetNewConnectionInfo (
  101. DWORD* pdwFlags,
  102. NETCON_MEDIATYPE* pMediaType)
  103. {
  104. HRESULT hr;
  105. *pdwFlags = 0;
  106. hr = HrGetNewConnectionInfo(pdwFlags);
  107. if (SUCCEEDED(hr))
  108. {
  109. *pdwFlags |= NCWF_SHORTCUT_ENABLE;
  110. *pMediaType = NCM_PHONE;
  111. }
  112. return hr;
  113. }
  114. STDMETHODIMP
  115. CInternetConnectionUi::SetConnectionName (
  116. PCWSTR pszwConnectionName)
  117. {
  118. HRESULT hr = HrSetConnectionName (pszwConnectionName);
  119. TraceError ("CInternetConnectionUi::SetConnectionName", hr);
  120. return hr;
  121. }
  122. STDMETHODIMP
  123. CInternetConnectionUi::GetNewConnection (
  124. INetConnection** ppCon)
  125. {
  126. HRESULT hr = HrGetNewConnection (ppCon);
  127. TraceError ("CInternetConnectionUi::GetNewConnection", hr);
  128. return hr;
  129. }