ReactOS 0.4.15-dev-8434-g155a7c7
shfldr_netconnect.cpp File Reference
#include "precomp.h"
Include dependency graph for shfldr_netconnect.cpp:

Go to the source code of this file.

Macros

#define MAX_PROPERTY_SHEET_PAGE   (10)
 
#define NETCONNECTSHELLVIEWCOLUMNS   6
 
#define COLUMN_NAME   0
 
#define COLUMN_TYPE   1
 
#define COLUMN_STATUS   2
 
#define COLUMN_DEVNAME   3
 
#define COLUMN_PHONE   4
 
#define COLUMN_OWNER   5
 

Functions

HRESULT ShowNetConnectionStatus (IOleCommandTarget *lpOleCmd, PCUITEMID_CHILD pidl, HWND hwnd)
 
void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
 
BOOL CALLBACK PropSheetExCallback (HPROPSHEETPAGE hPage, LPARAM lParam)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
HRESULT ShowNetConnectionProperties (INetConnection *pNetConnect, HWND hwnd)
 

Variables

static const shvheader NetConnectSFHeader []
 

Macro Definition Documentation

◆ COLUMN_DEVNAME

#define COLUMN_DEVNAME   3

Definition at line 30 of file shfldr_netconnect.cpp.

◆ COLUMN_NAME

#define COLUMN_NAME   0

Definition at line 27 of file shfldr_netconnect.cpp.

◆ COLUMN_OWNER

#define COLUMN_OWNER   5

Definition at line 32 of file shfldr_netconnect.cpp.

◆ COLUMN_PHONE

#define COLUMN_PHONE   4

Definition at line 31 of file shfldr_netconnect.cpp.

◆ COLUMN_STATUS

#define COLUMN_STATUS   2

Definition at line 29 of file shfldr_netconnect.cpp.

◆ COLUMN_TYPE

#define COLUMN_TYPE   1

Definition at line 28 of file shfldr_netconnect.cpp.

◆ MAX_PROPERTY_SHEET_PAGE

#define MAX_PROPERTY_SHEET_PAGE   (10)

Definition at line 10 of file shfldr_netconnect.cpp.

◆ NETCONNECTSHELLVIEWCOLUMNS

#define NETCONNECTSHELLVIEWCOLUMNS   6

Definition at line 25 of file shfldr_netconnect.cpp.

Function Documentation

◆ _InsertMenuItemW()

void WINAPI _InsertMenuItemW ( HMENU  hmenu,
UINT  indexMenu,
BOOL  fByPosition,
UINT  wID,
UINT  fType,
LPCWSTR  dwTypeData,
UINT  fState 
)

Definition at line 401 of file shfldr_netconnect.cpp.

409{
410 MENUITEMINFOW mii;
411 WCHAR szText[100];
412
413 ZeroMemory(&mii, sizeof(mii));
414 mii.cbSize = sizeof(mii);
415 if (fType == MFT_SEPARATOR)
416 {
417 mii.fMask = MIIM_ID | MIIM_TYPE;
418 }
419 else if (fType == MFT_STRING)
420 {
422 if ((ULONG_PTR)HIWORD((ULONG_PTR)dwTypeData) == 0)
423 {
424 if (LoadStringW(netshell_hInstance, LOWORD((ULONG_PTR)dwTypeData), szText, sizeof(szText)/sizeof(WCHAR)))
425 {
426 szText[(sizeof(szText)/sizeof(WCHAR))-1] = 0;
427 mii.dwTypeData = szText;
428 }
429 else
430 {
431 return;
432 }
433 }
434 else
435 {
436 mii.dwTypeData = (LPWSTR) dwTypeData;
437 }
438 mii.fState = fState;
439 }
440
441 mii.wID = wID;
442 mii.fType = fType;
443 InsertMenuItemW( hmenu, indexMenu, fByPosition, &mii);
444}
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define LOWORD(l)
Definition: pedump.c:82
LPWSTR dwTypeData
Definition: winuser.h:3269
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define HIWORD(l)
Definition: typedefs.h:247
static HMENU hmenu
Definition: win.c:66
#define ZeroMemory
Definition: winbase.h:1712
#define MIIM_ID
Definition: winuser.h:722
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MFT_SEPARATOR
Definition: winuser.h:744
#define MIIM_STATE
Definition: winuser.h:721
#define MFT_STRING
Definition: winuser.h:746
#define MIIM_TYPE
Definition: winuser.h:725
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by BrFolder_OnContextMenu(), CDesktopFolder::CallBack(), CDrivesFolder::CallBack(), CFSFolder::CallBack(), DrivesContextMenuCallback(), CNetConUiObject::QueryContextMenu(), CCPLItemMenu::QueryContextMenu(), and CRecycleBinItemContextMenu::QueryContextMenu().

◆ PropSheetExCallback()

BOOL CALLBACK PropSheetExCallback ( HPROPSHEETPAGE  hPage,
LPARAM  lParam 
)

Definition at line 504 of file shfldr_netconnect.cpp.

505{
507
508 if (pinfo->nPages < MAX_PROPERTY_SHEET_PAGE)
509 {
510 pinfo->phpage[pinfo->nPages++] = hPage;
511 return TRUE;
512 }
513 return FALSE;
514}
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PROPERTY_SHEET_PAGE
HPROPSHEETPAGE * phpage
Definition: prsht.h:309

Referenced by ShowNetConnectionProperties().

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 536 of file shfldr_netconnect.cpp.

537{
538 // NOTE: This callback is needed to set large icon correctly.
539 HICON hIcon;
540 switch (uMsg)
541 {
542 case PSCB_INITIALIZED:
543 {
545 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
546 break;
547 }
548 }
549 return 0;
550}
#define IDI_SHELL_NETWORK_FOLDER
Definition: resource.h:5
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define ICON_BIG
Definition: tnclass.cpp:51
LONG_PTR LPARAM
Definition: windef.h:208
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2119
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by ShowNetConnectionProperties().

◆ ShowNetConnectionProperties()

HRESULT ShowNetConnectionProperties ( INetConnection pNetConnect,
HWND  hwnd 
)

Definition at line 553 of file shfldr_netconnect.cpp.

556{
557 HRESULT hr;
558 CLSID ClassID;
559 PROPSHEETHEADERW pinfo;
562 NETCON_PROPERTIES * pProperties;
563
564 if (pNetConnect->GetProperties(&pProperties) != S_OK)
565 return E_FAIL;
566
567 hr = pNetConnect->GetUiObjectClassId(&ClassID);
568 if (FAILED(hr))
569 {
570 NcFreeNetconProperties(pProperties);
571 return hr;
572 }
573
574 hr = CoCreateInstance(ClassID, NULL, CLSCTX_INPROC_SERVER, IID_INetConnectionPropertyUi, (LPVOID*)&pNCP);
575 if (FAILED(hr))
576 {
577 NcFreeNetconProperties(pProperties);
578 return hr;
579 }
580
581 hr = pNCP->SetConnection(pNetConnect);
582 if (SUCCEEDED(hr))
583 {
584 ZeroMemory(&pinfo, sizeof(PROPSHEETHEADERW));
585 ZeroMemory(hppages, sizeof(hppages));
586 pinfo.dwSize = sizeof(PROPSHEETHEADERW);
587 pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW |
591 pinfo.phpage = hppages;
592 pinfo.hwndParent = hwnd;
594
595 pinfo.pszCaption = pProperties->pszwName;
596 hr = pNCP->AddPages(hwnd, PropSheetExCallback, (LPARAM)&pinfo);
597 if (SUCCEEDED(hr))
598 {
599 if (PropertySheetW(&pinfo) < 0)
600 hr = E_FAIL;
601 }
602 }
603 NcFreeNetconProperties(pProperties);
604 return hr;
605}
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
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
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)
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
LPCWSTR pszCaption
Definition: prsht.h:301
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

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

◆ ShowNetConnectionStatus()

HRESULT ShowNetConnectionStatus ( IOleCommandTarget lpOleCmd,
PCUITEMID_CHILD  pidl,
HWND  hwnd 
)

Definition at line 517 of file shfldr_netconnect.cpp.

521{
522 if (!lpOleCmd)
523 return E_FAIL;
524
526 if (!pdata)
527 {
528 ERR("Got invalid pidl\n");
529 return E_FAIL;
530 }
531
532 return lpOleCmd->Exec(&pdata->guidId, OLECMDID_NEW, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
533}
#define ERR(fmt,...)
Definition: precomp.h:57
PNETCONIDSTRUCT ILGetConnData(PCITEMID_CHILD pidl)
Definition: enumlist.cpp:10
HRESULT Exec([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
static PROTOCOLDATA * pdata
Definition: protocol.c:158

Referenced by CNetworkConnections::Execute(), and CNetConUiObject::InvokeCommand().

Variable Documentation

◆ NetConnectSFHeader