ReactOS 0.4.15-dev-6661-gcc6e444
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 50 of file shfldr_netconnect.cpp.

◆ COLUMN_NAME

#define COLUMN_NAME   0

Definition at line 47 of file shfldr_netconnect.cpp.

◆ COLUMN_OWNER

#define COLUMN_OWNER   5

Definition at line 52 of file shfldr_netconnect.cpp.

◆ COLUMN_PHONE

#define COLUMN_PHONE   4

Definition at line 51 of file shfldr_netconnect.cpp.

◆ COLUMN_STATUS

#define COLUMN_STATUS   2

Definition at line 49 of file shfldr_netconnect.cpp.

◆ COLUMN_TYPE

#define COLUMN_TYPE   1

Definition at line 48 of file shfldr_netconnect.cpp.

◆ MAX_PROPERTY_SHEET_PAGE

#define MAX_PROPERTY_SHEET_PAGE   (10)

Definition at line 30 of file shfldr_netconnect.cpp.

◆ NETCONNECTSHELLVIEWCOLUMNS

#define NETCONNECTSHELLVIEWCOLUMNS   6

Definition at line 45 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 418 of file shfldr_netconnect.cpp.

426{
427 MENUITEMINFOW mii;
428 WCHAR szText[100];
429
430 ZeroMemory(&mii, sizeof(mii));
431 mii.cbSize = sizeof(mii);
432 if (fType == MFT_SEPARATOR)
433 {
434 mii.fMask = MIIM_ID | MIIM_TYPE;
435 }
436 else if (fType == MFT_STRING)
437 {
439 if ((ULONG_PTR)HIWORD((ULONG_PTR)dwTypeData) == 0)
440 {
441 if (LoadStringW(netshell_hInstance, LOWORD((ULONG_PTR)dwTypeData), szText, sizeof(szText)/sizeof(WCHAR)))
442 {
443 szText[(sizeof(szText)/sizeof(WCHAR))-1] = 0;
444 mii.dwTypeData = szText;
445 }
446 else
447 {
448 return;
449 }
450 }
451 else
452 {
453 mii.dwTypeData = (LPWSTR) dwTypeData;
454 }
455 mii.fState = fState;
456 }
457
458 mii.wID = wID;
459 mii.fType = fType;
460 InsertMenuItemW( hmenu, indexMenu, fByPosition, &mii);
461}
HINSTANCE netshell_hInstance
Definition: netshell.cpp:12
#define LOWORD(l)
Definition: pedump.c:82
LPWSTR dwTypeData
Definition: winuser.h:3259
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:1700
#define MIIM_ID
Definition: winuser.h:717
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:739
#define MIIM_STATE
Definition: winuser.h:716
#define MFT_STRING
Definition: winuser.h:741
#define MIIM_TYPE
Definition: winuser.h:720
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 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 521 of file shfldr_netconnect.cpp.

522{
524
525 if (pinfo->nPages < MAX_PROPERTY_SHEET_PAGE)
526 {
527 pinfo->phpage[pinfo->nPages++] = hPage;
528 return TRUE;
529 }
530 return FALSE;
531}
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 553 of file shfldr_netconnect.cpp.

554{
555 // NOTE: This callback is needed to set large icon correctly.
556 HICON hIcon;
557 switch (uMsg)
558 {
559 case PSCB_INITIALIZED:
560 {
562 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
563 break;
564 }
565 }
566 return 0;
567}
#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:2044
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by ShowNetConnectionProperties().

◆ ShowNetConnectionProperties()

HRESULT ShowNetConnectionProperties ( INetConnection pNetConnect,
HWND  hwnd 
)

Definition at line 570 of file shfldr_netconnect.cpp.

573{
574 HRESULT hr;
575 CLSID ClassID;
576 PROPSHEETHEADERW pinfo;
579 NETCON_PROPERTIES * pProperties;
580
581 if (pNetConnect->GetProperties(&pProperties) != S_OK)
582 return E_FAIL;
583
584 hr = pNetConnect->GetUiObjectClassId(&ClassID);
585 if (FAILED(hr))
586 {
587 NcFreeNetconProperties(pProperties);
588 return hr;
589 }
590
591 hr = CoCreateInstance(ClassID, NULL, CLSCTX_INPROC_SERVER, IID_INetConnectionPropertyUi, (LPVOID*)&pNCP);
592 if (FAILED(hr))
593 {
594 NcFreeNetconProperties(pProperties);
595 return hr;
596 }
597
598 hr = pNCP->SetConnection(pNetConnect);
599 if (SUCCEEDED(hr))
600 {
601 ZeroMemory(&pinfo, sizeof(PROPSHEETHEADERW));
602 ZeroMemory(hppages, sizeof(hppages));
603 pinfo.dwSize = sizeof(PROPSHEETHEADERW);
604 pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW |
608 pinfo.phpage = hppages;
609 pinfo.hwndParent = hwnd;
611
612 pinfo.pszCaption = pProperties->pszwName;
613 hr = pNCP->AddPages(hwnd, PropSheetExCallback, (LPARAM)&pinfo);
614 if (SUCCEEDED(hr))
615 {
616 if (PropertySheetW(&pinfo) < 0)
617 hr = E_FAIL;
618 }
619 }
620 NcFreeNetconProperties(pProperties);
621 return hr;
622}
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2905
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 534 of file shfldr_netconnect.cpp.

538{
539 if (!lpOleCmd)
540 return E_FAIL;
541
543 if (!pdata)
544 {
545 ERR("Got invalid pidl!\n");
546 return E_FAIL;
547 }
548
549 return lpOleCmd->Exec(&pdata->guidId, OLECMDID_NEW, OLECMDEXECOPT_DODEFAULT, NULL, NULL);
550}
#define ERR(fmt,...)
Definition: debug.h:110
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