ReactOS 0.4.16-dev-424-ge4748fe
CDefView.cpp File Reference
#include "precomp.h"
#include <atlwin.h>
#include <ui/rosctrls.h>
Include dependency graph for CDefView.cpp:

Go to the source code of this file.

Classes

struct  LISTVIEW_SORT_INFO
 
struct  PERSISTCOLUMNS
 
struct  PERSISTCLASSICVIEWSTATE
 
struct  MenuCleanup
 
class  CDefView
 

Macros

#define SHV_CHANGE_NOTIFY   (WM_USER + 0x1111)
 
#define SHV_UPDATESTATUSBAR   (WM_USER + 0x1112)
 
#define CONTEXT_MENU_BASE_ID   1
 
#define ID_LISTVIEW   1
 
#define GET_WM_COMMAND_ID(wp, lp)   LOWORD(wp)
 
#define GET_WM_COMMAND_HWND(wp, lp)   (HWND)(lp)
 
#define GET_WM_COMMAND_CMD(wp, lp)   HIWORD(wp)
 
#define UPDATEFOLDERVIEWFLAGS(bits, bit, set)   ( (bits) = ((bits) & ~(bit)) | ((set) ? (bit) : 0) )
 
#define SCROLLAREAWIDTH   20
 

Typedefs

typedef void(CALLBACKPFNSHGETSETTINGSPROC) (LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
 
typedef CSimpleMap< LPARAM, INTCLParamIndexMap
 

Enumerations

enum  {
  DEFVIEW_ARRANGESORT_MAXENUM = 9 , DEFVIEW_ARRANGESORT_MAX = DEFVIEW_ARRANGESORT_MAXENUM + 1 , DVIDM_ARRANGESORT_LAST = FCIDM_SHVIEWLAST , DVIDM_ARRANGESORT_FIRST = DVIDM_ARRANGESORT_LAST - (DEFVIEW_ARRANGESORT_MAX - 1) ,
  DVIDM_COMMDLG_SELECT = DVIDM_ARRANGESORT_FIRST - 1 , DVIDM_CONTEXTMENU_LAST = DVIDM_COMMDLG_SELECT - 1 , DVIDM_CONTEXTMENU_FIRST = FCIDM_SHVIEWFIRST
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static UINT GetContextMenuFlags (IShellBrowser *pSB, SFGAOF sfgao)
 
static void ClientToListView (HWND hwndLV, POINT *ppt)
 
static BOOL AppendMenuItem (HMENU hMenu, UINT MF, UINT Id, LPCWSTR String, SIZE_T Data=0)
 
static SIZE_T GetMenuItemDataById (HMENU hMenu, UINT Id)
 
static HMENU GetSubmenuByID (HMENU hmenu, UINT id)
 
static UINT ReallyGetMenuItemID (HMENU hmenu, int i)
 
static UINT CalculateCharWidth (HWND hwnd)
 
static COLORREF GetViewColor (COLORREF Clr, UINT SysFallback)
 
static HRESULT SHGetLVColumnSubItem (HWND List, UINT Col)
 
static VOID DrawTileBitmap (HDC hDC, LPCRECT prc, HBITMAP hbm, INT nWidth, INT nHeight, INT dx, INT dy)
 
static BOOL SelectExtOnRename (void)
 
static BOOL ILIsParentOrSpecialParent (PCIDLIST_ABSOLUTE pidl1, PCIDLIST_ABSOLUTE pidl2)
 
HRESULT SHGetMenuIdFromMenuMsg (UINT uMsg, LPARAM lParam, UINT *CmdId)
 
HRESULT SHSetMenuIdInMenuMsg (UINT uMsg, LPARAM lParam, UINT CmdId)
 
static HRESULT Read (IStream *pS, LPVOID buffer, ULONG cb)
 
static DWORD ReadDWORD (IPropertyBag *pPB, LPCWSTR name, DWORD def)
 
static HRESULT LoadColumnsStream (PERSISTCOLUMNS &cols, IStream *pS)
 
static INT CALLBACK SelectionMoveCompareFunc (LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
 
HRESULT CDefView_CreateInstance (IShellFolder *pFolder, REFIID riid, LPVOID *ppvOut)
 
HRESULT WINAPI SHCreateShellFolderView (const SFV_CREATE *pcsfv, IShellView **ppsv)
 

Macro Definition Documentation

◆ CONTEXT_MENU_BASE_ID

#define CONTEXT_MENU_BASE_ID   1

Definition at line 82 of file CDefView.cpp.

◆ GET_WM_COMMAND_CMD

#define GET_WM_COMMAND_CMD (   wp,
  lp 
)    HIWORD(wp)

Definition at line 569 of file CDefView.cpp.

◆ GET_WM_COMMAND_HWND

#define GET_WM_COMMAND_HWND (   wp,
  lp 
)    (HWND)(lp)

Definition at line 568 of file CDefView.cpp.

◆ GET_WM_COMMAND_ID

#define GET_WM_COMMAND_ID (   wp,
  lp 
)    LOWORD(wp)

Definition at line 567 of file CDefView.cpp.

◆ ID_LISTVIEW

#define ID_LISTVIEW   1

Definition at line 564 of file CDefView.cpp.

◆ SCROLLAREAWIDTH

#define SCROLLAREAWIDTH   20

Definition at line 4147 of file CDefView.cpp.

◆ SHV_CHANGE_NOTIFY

#define SHV_CHANGE_NOTIFY   (WM_USER + 0x1111)

Definition at line 77 of file CDefView.cpp.

◆ SHV_UPDATESTATUSBAR

#define SHV_UPDATESTATUSBAR   (WM_USER + 0x1112)

Definition at line 78 of file CDefView.cpp.

◆ UPDATEFOLDERVIEWFLAGS

#define UPDATEFOLDERVIEWFLAGS (   bits,
  bit,
  set 
)    ( (bits) = ((bits) & ~(bit)) | ((set) ? (bit) : 0) )

Definition at line 3362 of file CDefView.cpp.

Typedef Documentation

◆ CLParamIndexMap

Definition at line 4421 of file CDefView.cpp.

◆ PFNSHGETSETTINGSPROC

typedef void(CALLBACK * PFNSHGETSETTINGSPROC) (LPSHELLFLAGSTATE lpsfs, DWORD dwMask)

Definition at line 571 of file CDefView.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFVIEW_ARRANGESORT_MAXENUM 
DEFVIEW_ARRANGESORT_MAX 
DVIDM_ARRANGESORT_LAST 
DVIDM_ARRANGESORT_FIRST 
DVIDM_COMMDLG_SELECT 
DVIDM_CONTEXTMENU_LAST 
DVIDM_CONTEXTMENU_FIRST 

Definition at line 46 of file CDefView.cpp.

46 {
47 DEFVIEW_ARRANGESORT_MAXENUM = 9, // Limit the number of the visible columns we will display in the submenu
48 DEFVIEW_ARRANGESORT_MAX = DEFVIEW_ARRANGESORT_MAXENUM + 1, // Reserve one extra for the current sort-by column
52
54 // FIXME: FCIDM_SHVIEWFIRST is 0 and using that with QueryContextMenu is a
55 // bad idea because it hides bugs related to the ids in ici.lpVerb.
56 // CONTEXT_MENU_BASE_ID acknowledges this but failed to apply the fix everywhere.
58};
@ DEFVIEW_ARRANGESORT_MAX
Definition: CDefView.cpp:48
@ DVIDM_CONTEXTMENU_LAST
Definition: CDefView.cpp:53
@ DVIDM_ARRANGESORT_FIRST
Definition: CDefView.cpp:50
@ DEFVIEW_ARRANGESORT_MAXENUM
Definition: CDefView.cpp:47
@ DVIDM_ARRANGESORT_LAST
Definition: CDefView.cpp:49
@ DVIDM_CONTEXTMENU_FIRST
Definition: CDefView.cpp:57
@ DVIDM_COMMDLG_SELECT
Definition: CDefView.cpp:51
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:580
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:614

Function Documentation

◆ AppendMenuItem()

static BOOL AppendMenuItem ( HMENU  hMenu,
UINT  MF,
UINT  Id,
LPCWSTR  String,
SIZE_T  Data = 0 
)
static

Definition at line 157 of file CDefView.cpp.

158{
159 MENUITEMINFOW mii;
160 mii.cbSize = sizeof(mii);
162 mii.fState = MF & (MFS_CHECKED | MFS_DISABLED);
163 mii.fType = MF & ~mii.fState;
164 mii.wID = Id;
165 mii.dwTypeData = const_cast<LPWSTR>(String);
166 mii.dwItemData = Data;
167 return InsertMenuItemW(hMenu, -1, TRUE, &mii);
168}
DWORD Id
#define TRUE
Definition: types.h:120
ULONG_PTR dwItemData
Definition: winuser.h:3271
LPWSTR dwTypeData
Definition: winuser.h:3272
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
#define MIIM_ID
Definition: winuser.h:725
#define MFS_DISABLED
Definition: winuser.h:752
#define MIIM_STATE
Definition: winuser.h:724
#define MFS_CHECKED
Definition: winuser.h:750
#define MIIM_DATA
Definition: winuser.h:729
#define MIIM_TYPE
Definition: winuser.h:728
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CDefView::ColumnListChanged(), CDefView::DoColumnContextMenu(), and CDefView::FillArrangeAsMenu().

◆ CalculateCharWidth()

static UINT CalculateCharWidth ( HWND  hwnd)
static

Definition at line 201 of file CDefView.cpp.

202{
203 UINT ret = 0;
204 HDC hDC = GetDC(hwnd);
205 if (hDC)
206 {
209 SelectObject(hDC, hOrg);
211 }
212 return ret;
213}
static HDC hDC
Definition: 3dtext.c:33
#define NULL
Definition: types.h:112
static HDC
Definition: imagelist.c:88
unsigned int UINT
Definition: ndis.h:50
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
Definition: font.c:2145
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_GETFONT
Definition: winuser.h:1654
#define SendMessage
Definition: winuser.h:5855
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by CDefView::LoadColumn().

◆ CDefView_CreateInstance()

HRESULT CDefView_CreateInstance ( IShellFolder pFolder,
REFIID  riid,
LPVOID ppvOut 
)

Definition at line 4670 of file CDefView.cpp.

4671{
4672 return ShellObjectCreatorInit<CDefView>(pFolder, riid, ppvOut);
4673}
REFIID riid
Definition: atlbase.h:39

Referenced by SHCreateShellFolderView().

◆ ClientToListView()

static void ClientToListView ( HWND  hwndLV,
POINT ppt 
)
static

Definition at line 119 of file CDefView.cpp.

120{
121 POINT Origin = {};
122
123 // FIXME: LVM_GETORIGIN is broken. See CORE-17266
124 if (!ListView_GetOrigin(hwndLV, &Origin))
125 return;
126
127 ppt->x += Origin.x;
128 ppt->y += Origin.y;
129}
#define ListView_GetOrigin(hwndLV, ppt)
Definition: commctrl.h:2674
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48

Referenced by CDefView::drag_notify_subitem(), CDefView::Drop(), and CDefView::OnNotify().

◆ DrawTileBitmap()

static VOID DrawTileBitmap ( HDC  hDC,
LPCRECT  prc,
HBITMAP  hbm,
INT  nWidth,
INT  nHeight,
INT  dx,
INT  dy 
)
static

Definition at line 1627 of file CDefView.cpp.

1628{
1629 INT x0 = prc->left, y0 = prc->top, x1 = prc->right, y1 = prc->bottom;
1630 x0 += dx;
1631 y0 += dy;
1632
1633 HDC hMemDC = CreateCompatibleDC(hDC);
1634 HGDIOBJ hbmOld = SelectObject(hMemDC, hbm);
1635
1636 for (INT y = y0; y < y1; y += nHeight)
1637 {
1638 for (INT x = x0; x < x1; x += nWidth)
1639 {
1640 BitBlt(hDC, x, y, nWidth, nHeight, hMemDC, 0, 0, SRCCOPY);
1641 }
1642 }
1643
1644 SelectObject(hMemDC, hbmOld);
1645 DeleteDC(hMemDC);
1646}
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dy
Definition: linetemp.h:97
GLint y0
Definition: linetemp.h:96
GLint x0
Definition: linetemp.h:95
GLint dx
Definition: linetemp.h:97
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
_Out_ LPRECT prc
Definition: ntgdi.h:1658
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT
Definition: typedefs.h:58
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by CDefView::OnPrintClient().

◆ GetContextMenuFlags()

static UINT GetContextMenuFlags ( IShellBrowser pSB,
SFGAOF  sfgao 
)
static

Definition at line 104 of file CDefView.cpp.

105{
106 UINT cmf = CMF_NORMAL;
107 if (GetKeyState(VK_SHIFT) < 0)
108 cmf |= CMF_EXTENDEDVERBS;
109 if (sfgao & SFGAO_CANRENAME)
110 cmf |= CMF_CANRENAME;
111 HWND hwnd = NULL;
112 if (pSB && SUCCEEDED(pSB->GetControlWindow(FCW_TREE, &hwnd)) && hwnd)
113 cmf |= CMF_EXPLORE;
114 return cmf;
115}
HRESULT GetControlWindow([in] UINT id, [out] HWND *phwnd)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define VK_SHIFT
Definition: winuser.h:2205
SHORT WINAPI GetKeyState(_In_ int)

Referenced by CDefView::FillFileMenu(), CDefView::OnContextMenu(), and CDefView::OpenSelectedItems().

◆ GetMenuItemDataById()

static SIZE_T GetMenuItemDataById ( HMENU  hMenu,
UINT  Id 
)
static

Definition at line 170 of file CDefView.cpp.

171{
172 MENUITEMINFOW mii;
173 mii.cbSize = FIELD_OFFSET(MENUITEMINFOW, hbmpItem);
174 mii.fMask = MIIM_DATA;
175 if (GetMenuItemInfoW(hMenu, Id, FALSE, &mii))
176 return mii.dwItemData;
177 else
178 return 0;
179}
#define FALSE
Definition: types.h:117
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)

Referenced by CDefView::DoColumnContextMenu(), and CDefView::OnCommand().

◆ GetSubmenuByID()

static HMENU GetSubmenuByID ( HMENU  hmenu,
UINT  id 
)
static

Definition at line 181 of file CDefView.cpp.

182{
183 MENUITEMINFOW mii = {sizeof(mii), MIIM_SUBMENU};
184 if (::GetMenuItemInfoW(hmenu, id, FALSE, &mii))
185 return mii.hSubMenu;
186
187 return NULL;
188}
static HMENU hmenu
Definition: win.c:66
#define MIIM_SUBMENU
Definition: winuser.h:726

Referenced by CDefView::ColumnListChanged(), CDefView::FillEditMenu(), CDefView::FillFileMenu(), CDefView::FillViewMenu(), and CDefView::OnInitMenuPopup().

◆ GetViewColor()

static COLORREF GetViewColor ( COLORREF  Clr,
UINT  SysFallback 
)
inlinestatic

Definition at line 215 of file CDefView.cpp.

216{
217 return Clr != CLR_INVALID ? Clr : GetSysColor(SysFallback);
218}
#define CLR_INVALID
Definition: wingdi.h:883
DWORD WINAPI GetSysColor(_In_ int)

Referenced by CDefView::OnPrintClient(), and CDefView::UpdateListColors().

◆ ILIsParentOrSpecialParent()

static BOOL ILIsParentOrSpecialParent ( PCIDLIST_ABSOLUTE  pidl1,
PCIDLIST_ABSOLUTE  pidl2 
)
static

Definition at line 2825 of file CDefView.cpp.

2826{
2827 if (!pidl1 || !pidl2)
2828 return FALSE;
2829 if (ILIsParent(pidl1, pidl2, TRUE))
2830 return TRUE;
2831
2832 CComHeapPtr<ITEMIDLIST_ABSOLUTE> pidl2Clone(ILClone(pidl2));
2833 ILRemoveLastID(pidl2Clone);
2834 return ILIsEqual(pidl1, pidl2Clone);
2835}
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL bImmediate)
Definition: pidl.c:697
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
Definition: pidl.c:221
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:582

Referenced by CDefView::OnChangeNotify().

◆ LoadColumnsStream()

static HRESULT LoadColumnsStream ( PERSISTCOLUMNS cols,
IStream pS 
)
static

Definition at line 3211 of file CDefView.cpp.

3212{
3214 if (FAILED(hr))
3215 return hr;
3216 if (cols.Signature != PERSISTCOLUMNS::SIG || cols.Count > cols.MAXCOUNT)
3218 return Read(pS, &cols.Columns, sizeof(*cols.Columns) * cols.Count);
3219}
static const COLUMN_LIST Columns[]
Definition: listview.c:19
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT HResultFromWin32(DWORD hr)
Definition: shellutils.h:70
HRESULT hr
Definition: shlfolder.c:183
_In_ BOOLEAN Read
Definition: strmini.h:479
static const UINT SIG
Definition: CDefView.cpp:87
UINT Columns[MAXCOUNT]
Definition: CDefView.cpp:90
#define ERROR_INVALID_DATA
Definition: winerror.h:116

Referenced by CDefView::LoadViewState().

◆ Read()

static HRESULT Read ( IStream pS,
LPVOID  buffer,
ULONG  cb 
)
static

Definition at line 3182 of file CDefView.cpp.

3183{
3184 ULONG read;
3185 HRESULT hr = pS->Read(buffer, cb, &read);
3186 return FAILED(hr) ? hr : (cb == read ? S_OK : HResultFromWin32(ERROR_MORE_DATA));
3187}
#define read
Definition: acwin.h:96
#define ERROR_MORE_DATA
Definition: dderror.h:13
GLuint buffer
Definition: glext.h:5915
HRESULT Read([out, size_is(cb), length_is(*pcbRead)] void *pv, [in] ULONG cb, [out] ULONG *pcbRead)
#define S_OK
Definition: intsafe.h:52
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
uint32_t ULONG
Definition: typedefs.h:59

◆ ReadDWORD()

static DWORD ReadDWORD ( IPropertyBag pPB,
LPCWSTR  name,
DWORD  def 
)
static

Definition at line 3189 of file CDefView.cpp.

3190{
3191 DWORD value;
3193 return SUCCEEDED(hr) ? value : def;
3194}
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI SHPropertyBag_ReadDWORD(IPropertyBag *ppb, LPCWSTR pszPropName, DWORD *pdwValue)
Definition: name.c:39
Definition: pdh_main.c:94

Referenced by CDefView::LoadViewState().

◆ ReallyGetMenuItemID()

static UINT ReallyGetMenuItemID ( HMENU  hmenu,
int  i 
)
static

Definition at line 192 of file CDefView.cpp.

193{
194 MENUITEMINFOW mii = {sizeof(mii), MIIM_ID};
195 if (::GetMenuItemInfoW(hmenu, i, TRUE, &mii))
196 return mii.wID;
197
198 return UINT_MAX;
199}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define UINT_MAX
Definition: intsafe.h:152

Referenced by CDefView::OnInitMenuPopup().

◆ SelectExtOnRename()

static BOOL SelectExtOnRename ( void  )
static

Definition at line 2552 of file CDefView.cpp.

2553{
2554 HKEY hKey;
2555 LONG error;
2556 DWORD dwValue = FALSE, cbValue;
2557
2559 if (error)
2560 return dwValue;
2561
2562 cbValue = sizeof(dwValue);
2563 RegQueryValueExW(hKey, L"SelectExtOnRename", NULL, NULL, (LPBYTE)&dwValue, &cbValue);
2564
2566 return !!dwValue;
2567}
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
FxAutoRegKey hKey
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define REGSTR_PATH_EXPLORER
Definition: regstr.h:33
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by CDefView::OnNotify().

◆ SelectionMoveCompareFunc()

static INT CALLBACK SelectionMoveCompareFunc ( LPARAM  lParam1,
LPARAM  lParam2,
LPARAM  lParamSort 
)
static

Definition at line 4424 of file CDefView.cpp.

4425{
4426 CLParamIndexMap *pmap = (CLParamIndexMap *)lParamSort;
4427 INT i1 = pmap->Lookup(lParam1), i2 = pmap->Lookup(lParam2);
4428 if (i1 < i2)
4429 return -1;
4430 if (i1 > i2)
4431 return 1;
4432 return 0;
4433}
Definition: pmap_prot.h:88

Referenced by CDefView::_MoveSelectionOnAutoArrange().

◆ SHCreateShellFolderView()

HRESULT WINAPI SHCreateShellFolderView ( const SFV_CREATE pcsfv,
IShellView **  ppsv 
)

Definition at line 4675 of file CDefView.cpp.

4677{
4679 HRESULT hRes;
4680
4681 if (!ppsv)
4682 return E_INVALIDARG;
4683
4684 *ppsv = NULL;
4685
4686 if (!pcsfv || pcsfv->cbSize != sizeof(*pcsfv))
4687 return E_INVALIDARG;
4688
4689 TRACE("sf=%p outer=%p callback=%p\n",
4690 pcsfv->pshf, pcsfv->psvOuter, pcsfv->psfvcb);
4691
4692 hRes = CDefView_CreateInstance(pcsfv->pshf, IID_PPV_ARG(IShellView, &psv));
4693 if (FAILED(hRes))
4694 return hRes;
4695
4696 if (pcsfv->psfvcb)
4697 {
4699 if (SUCCEEDED(psv->QueryInterface(IID_PPV_ARG(IShellFolderView, &sfv))))
4700 {
4701 sfv->SetCallback(pcsfv->psfvcb, NULL);
4702 }
4703 }
4704
4705 *ppsv = psv.Detach();
4706 return hRes;
4707}
HRESULT CDefView_CreateInstance(IShellFolder *pFolder, REFIID riid, LPVOID *ppvOut)
Definition: CDefView.cpp:4670
T * Detach()
Definition: atlcomcli.h:186
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
IShellFolderViewCB * psfvcb
Definition: shlobj.h:1360
IShellView * psvOuter
Definition: shlobj.h:1359
UINT cbSize
Definition: shlobj.h:1357
IShellFolder * pshf
Definition: shlobj.h:1358
#define IID_PPV_ARG(Itype, ppType)

Referenced by CFontExt::CreateViewObject(), CZipFolder::CreateViewObject(), CFindFolder::CreateViewObject(), CCabFolder::CreateViewObject(), CControlPanelFolder::CreateViewObject(), CDesktopFolder::CreateViewObject(), CDrivesFolder::CreateViewObject(), CFSFolder::CreateViewObject(), CNetFolder::CreateViewObject(), CPrinterFolder::CreateViewObject(), CRecycleBin::CreateViewObject(), CCommonFolder< TSelf, TItemId, TExtractIcon >::CreateViewObject(), SHCreateShellFolderViewEx(), START_TEST(), test_SHCreateShellFolderView(), and ShellBrowser::UpdateFolderView().

◆ SHGetLVColumnSubItem()

static HRESULT SHGetLVColumnSubItem ( HWND  List,
UINT  Col 
)
static

Definition at line 980 of file CDefView.cpp.

981{
982 LVCOLUMN lvc;
983 lvc.mask = LVCF_SUBITEM;
984 if (!ListView_GetColumn(List, Col, &lvc))
985 return E_FAIL;
986 else
987 return lvc.iSubItem;
988}
#define E_FAIL
Definition: ddrawi.h:102
#define ListView_GetColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2627
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCOLUMN
Definition: commctrl.h:2586
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by CDefView::MapFolderColumnToListColumn(), and CDefView::MapListColumnToFolderColumn().

◆ SHGetMenuIdFromMenuMsg()

HRESULT SHGetMenuIdFromMenuMsg ( UINT  uMsg,
LPARAM  lParam,
UINT CmdId 
)

Definition at line 1727 of file CDefaultContextMenu.cpp.

1728{
1729 if (uMsg == WM_DRAWITEM)
1730 {
1731 DRAWITEMSTRUCT* pDrawStruct = reinterpret_cast<DRAWITEMSTRUCT*>(lParam);
1732 *CmdId = pDrawStruct->itemID;
1733 return S_OK;
1734 }
1735 else if (uMsg == WM_MEASUREITEM)
1736 {
1737 MEASUREITEMSTRUCT* pMeasureStruct = reinterpret_cast<MEASUREITEMSTRUCT*>(lParam);
1738 *CmdId = pMeasureStruct->itemID;
1739 return S_OK;
1740 }
1741
1742 return E_FAIL;
1743}
LPARAM lParam
Definition: combotst.c:139
#define WM_DRAWITEM
Definition: winuser.h:1648
#define WM_MEASUREITEM
Definition: winuser.h:1649

Referenced by CDefaultContextMenu::HandleMenuMsg2(), and CDefView::OnCustomItem().

◆ SHSetMenuIdInMenuMsg()

HRESULT SHSetMenuIdInMenuMsg ( UINT  uMsg,
LPARAM  lParam,
UINT  CmdId 
)

Definition at line 1745 of file CDefaultContextMenu.cpp.

1746{
1747 if (uMsg == WM_DRAWITEM)
1748 {
1749 DRAWITEMSTRUCT* pDrawStruct = reinterpret_cast<DRAWITEMSTRUCT*>(lParam);
1750 pDrawStruct->itemID = CmdId;
1751 return S_OK;
1752 }
1753 else if (uMsg == WM_MEASUREITEM)
1754 {
1755 MEASUREITEMSTRUCT* pMeasureStruct = reinterpret_cast<MEASUREITEMSTRUCT*>(lParam);
1756 pMeasureStruct->itemID = CmdId;
1757 return S_OK;
1758 }
1759
1760 return E_FAIL;
1761}

Referenced by CDefaultContextMenu::HandleMenuMsg2(), and CDefView::OnCustomItem().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )