ReactOS 0.4.16-dev-927-g467dec4
shfldr_netconnect.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  shvheader
 
class  CNetworkConnections
 
class  CNetConUiObject
 

Functions

HRESULT ShowNetConnectionProperties (INetConnection *pNetConnect, HWND hwnd)
 

Function Documentation

◆ ShowNetConnectionProperties()

HRESULT ShowNetConnectionProperties ( INetConnection pNetConnect,
HWND  hwnd 
)

Definition at line 573 of file shfldr_netconnect.cpp.

576{
577 HRESULT hr;
578 CLSID ClassID;
579 PROPSHEETHEADERW pinfo;
582 NETCON_PROPERTIES * pProperties;
583
584 if (pNetConnect->GetProperties(&pProperties) != S_OK)
585 return E_FAIL;
586
587 hr = pNetConnect->GetUiObjectClassId(&ClassID);
588 if (FAILED(hr))
589 {
590 NcFreeNetconProperties(pProperties);
591 return hr;
592 }
593
594 hr = CoCreateInstance(ClassID, NULL, CLSCTX_INPROC_SERVER, IID_INetConnectionPropertyUi, (LPVOID*)&pNCP);
595 if (FAILED(hr))
596 {
597 NcFreeNetconProperties(pProperties);
598 return hr;
599 }
600
601 hr = pNCP->SetConnection(pNetConnect);
602 if (SUCCEEDED(hr))
603 {
604 ZeroMemory(&pinfo, sizeof(PROPSHEETHEADERW));
605 ZeroMemory(hppages, sizeof(hppages));
606 pinfo.dwSize = sizeof(PROPSHEETHEADERW);
607 pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW |
611 pinfo.phpage = hppages;
612 pinfo.hwndParent = hwnd;
614
615 pinfo.pszCaption = pProperties->pszwName;
616 hr = pNCP->AddPages(hwnd, PropSheetExCallback, (LPARAM)&pinfo);
617 if (SUCCEEDED(hr))
618 {
619 if (PropertySheetW(&pinfo) < 0)
620 hr = E_FAIL;
621 }
622 }
623 NcFreeNetconProperties(pProperties);
624 return hr;
625}
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define IDI_SHELL_NETWORK_FOLDER
Definition: resource.h:5
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2916
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT GetProperties([out] NETCON_PROPERTIES **ppProps)
HRESULT GetUiObjectClassId([out, ref] CLSID *pclsid)
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
EXTERN_C const IID IID_INetConnectionPropertyUi
Definition: netcon.h:227
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
Definition: netshell.cpp:119
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_USEICONID
Definition: prsht.h:42
struct _PROPSHEETHEADERW PROPSHEETHEADERW
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
BOOL CALLBACK PropSheetExCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
#define MAX_PROPERTY_SHEET_PAGE
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
HRESULT hr
Definition: shlfolder.c:183
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
LPCWSTR pszCaption
Definition: prsht.h:301
#define ZeroMemory
Definition: winbase.h:1743
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CNetConUiObject::InvokeCommand(), LANStatusUiDlg(), and ShowStatusPropertyDialog().