ReactOS 0.4.15-dev-8621-g4b051b9
CDefView Class Reference
Inheritance diagram for CDefView:
Collaboration diagram for CDefView:

Public Member Functions

 CDefView ()
 
 ~CDefView ()
 
HRESULT WINAPI Initialize (IShellFolder *shellFolder)
 
HRESULT IncludeObject (PCUITEMID_CHILD pidl)
 
HRESULT OnDefaultCommand ()
 
HRESULT OnStateChange (UINT uFlags)
 
void UpdateStatusbar ()
 
void CheckToolbar ()
 
BOOL CreateList ()
 
void UpdateListColors ()
 
BOOL InitList ()
 
HRESULT MapFolderColumnToListColumn (UINT FoldCol)
 
HRESULT MapListColumnToFolderColumn (UINT ListCol)
 
HRESULT GetDetailsByFolderColumn (PCUITEMID_CHILD pidl, UINT FoldCol, SHELLDETAILS &sd)
 
HRESULT GetDetailsByListColumn (PCUITEMID_CHILD pidl, UINT ListCol, SHELLDETAILS &sd)
 
HRESULT LoadColumn (UINT FoldCol, UINT ListCol, BOOL Insert, UINT ForceWidth=0)
 
HRESULT LoadColumns (SIZE_T *pColList=NULL, UINT ColListCount=0)
 
void ColumnListChanged ()
 
PCUITEMID_CHILD _PidlByItem (int i)
 
PCUITEMID_CHILD _PidlByItem (LVITEM &lvItem)
 
int LV_FindItemByPidl (PCUITEMID_CHILD pidl)
 
int LV_AddItem (PCUITEMID_CHILD pidl)
 
BOOLEAN LV_DeleteItem (PCUITEMID_CHILD pidl)
 
BOOLEAN LV_RenameItem (PCUITEMID_CHILD pidlOld, PCUITEMID_CHILD pidlNew)
 
BOOLEAN LV_UpdateItem (PCUITEMID_CHILD pidl)
 
void LV_RefreshIcon (INT iItem)
 
void LV_RefreshIcons ()
 
HRESULT FillList (BOOL IsRefreshCommand=TRUE)
 
HRESULT FillFileMenu ()
 
HRESULT FillEditMenu ()
 
HRESULT FillViewMenu ()
 
HRESULT FillArrangeAsMenu (HMENU hmenuArrange)
 
HRESULT CheckViewMode (HMENU hmenuView)
 
LRESULT DoColumnContextMenu (LRESULT lParam)
 
UINT GetSelections ()
 
HRESULT OpenSelectedItems ()
 
void OnDeactivate ()
 
void DoActivate (UINT uState)
 
HRESULT drag_notify_subitem (DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
 
HRESULT InvokeContextMenuCommand (CComPtr< IContextMenu > &pCM, LPCSTR lpVerb, POINT *pt=NULL)
 
LRESULT OnExplorerCommand (UINT uCommand, BOOL bUseSelection)
 
FOLDERVIEWMODE GetDefaultViewMode ()
 
HRESULT GetDefaultViewStream (DWORD Stgm, IStream **ppStream)
 
HRESULT LoadViewState ()
 
HRESULT SaveViewState (IStream *pStream)
 
void UpdateFolderViewFlags ()
 
DWORD GetCommDlgViewFlags ()
 
STDMETHOD() GetWindow (HWND *lphwnd) override
 
STDMETHOD() ContextSensitiveHelp (BOOL fEnterMode) override
 
STDMETHOD() TranslateAccelerator (MSG *pmsg) override
 
STDMETHOD() EnableModeless (BOOL fEnable) override
 
STDMETHOD() UIActivate (UINT uState) override
 
STDMETHOD() Refresh () override
 
STDMETHOD() CreateViewWindow (IShellView *psvPrevious, LPCFOLDERSETTINGS pfs, IShellBrowser *psb, RECT *prcView, HWND *phWnd) override
 
STDMETHOD() DestroyViewWindow () override
 
STDMETHOD() GetCurrentInfo (LPFOLDERSETTINGS pfs) override
 
STDMETHOD() AddPropertySheetPages (DWORD dwReserved, LPFNSVADDPROPSHEETPAGE pfn, LPARAM lparam) override
 
STDMETHOD() SaveViewState () override
 
STDMETHOD() SelectItem (PCUITEMID_CHILD pidlItem, SVSIF uFlags) override
 
STDMETHOD() GetItemObject (UINT uItem, REFIID riid, void **ppv) override
 
STDMETHOD() GetView (SHELLVIEWID *view_guid, ULONG view_type) override
 
STDMETHOD() CreateViewWindow2 (LPSV2CVW2_PARAMS view_params) override
 
STDMETHOD() HandleRename (LPCITEMIDLIST new_pidl) override
 
STDMETHOD() SelectAndPositionItem (LPCITEMIDLIST item, UINT flags, POINT *point) override
 
STDMETHOD() CreateViewWindow3 (IShellBrowser *psb, IShellView *psvPrevious, SV3CVW3_FLAGS view_flags, FOLDERFLAGS mask, FOLDERFLAGS flags, FOLDERVIEWMODE mode, const SHELLVIEWID *view_id, const RECT *prcView, HWND *hwnd) override
 
STDMETHOD() GetCurrentViewMode (UINT *pViewMode) override
 
STDMETHOD() SetCurrentViewMode (UINT ViewMode) override
 
STDMETHOD() GetFolder (REFIID riid, void **ppv) override
 
STDMETHOD() Item (int iItemIndex, PITEMID_CHILD *ppidl) override
 
STDMETHOD() ItemCount (UINT uFlags, int *pcItems) override
 
STDMETHOD() Items (UINT uFlags, REFIID riid, void **ppv) override
 
STDMETHOD() GetSelectionMarkedItem (int *piItem) override
 
STDMETHOD() GetFocusedItem (int *piItem) override
 
STDMETHOD() GetItemPosition (PCUITEMID_CHILD pidl, POINT *ppt) override
 
STDMETHOD() GetSpacing (POINT *ppt) override
 
STDMETHOD() GetDefaultSpacing (POINT *ppt) override
 
STDMETHOD() GetAutoArrange () override
 
STDMETHOD() SelectItem (int iItem, DWORD dwFlags) override
 
STDMETHOD() SelectAndPositionItems (UINT cidl, PCUITEMID_CHILD_ARRAY apidl, POINT *apt, DWORD dwFlags) override
 
STDMETHOD() Rearrange (LPARAM sort) override
 
STDMETHOD() GetArrangeParam (LPARAM *sort) override
 
STDMETHOD() ArrangeGrid () override
 
STDMETHOD() AutoArrange () override
 
STDMETHOD() AddObject (PITEMID_CHILD pidl, UINT *item) override
 
STDMETHOD() GetObject (PITEMID_CHILD *pidl, UINT item) override
 
STDMETHOD() RemoveObject (PITEMID_CHILD pidl, UINT *item) override
 
STDMETHOD() GetObjectCount (UINT *count) override
 
STDMETHOD() SetObjectCount (UINT count, UINT flags) override
 
STDMETHOD() UpdateObject (PITEMID_CHILD pidl_old, PITEMID_CHILD pidl_new, UINT *item) override
 
STDMETHOD() RefreshObject (PITEMID_CHILD pidl, UINT *item) override
 
STDMETHOD() SetRedraw (BOOL redraw) override
 
STDMETHOD() GetSelectedCount (UINT *count) override
 
STDMETHOD() GetSelectedObjects (PCUITEMID_CHILD **pidl, UINT *items) override
 
STDMETHOD() IsDropOnSource (IDropTarget *drop_target) override
 
STDMETHOD() GetDragPoint (POINT *pt) override
 
STDMETHOD() GetDropPoint (POINT *pt) override
 
STDMETHOD() MoveIcons (IDataObject *obj) override
 
STDMETHOD() SetItemPos (PCUITEMID_CHILD pidl, POINT *pt) override
 
STDMETHOD() IsBkDropTarget (IDropTarget *drop_target) override
 
STDMETHOD() SetClipboard (BOOL move) override
 
STDMETHOD() SetPoints (IDataObject *obj) override
 
STDMETHOD() GetItemSpacing (ITEMSPACING *spacing) override
 
STDMETHOD() SetCallback (IShellFolderViewCB *new_cb, IShellFolderViewCB **old_cb) override
 
STDMETHOD() Select (UINT flags) override
 
STDMETHOD() QuerySupport (UINT *support) override
 
STDMETHOD() SetAutomationObject (IDispatch *disp) override
 
STDMETHOD() QueryStatus (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) override
 
STDMETHOD() Exec (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
 
STDMETHOD() DragEnter (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override
 
STDMETHOD() DragOver (DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override
 
STDMETHOD() DragLeave () override
 
STDMETHOD() Drop (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) override
 
STDMETHOD() QueryContinueDrag (BOOL fEscapePressed, DWORD grfKeyState) override
 
STDMETHOD() GiveFeedback (DWORD dwEffect) override
 
STDMETHOD() Draw (DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL(STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue) override
 
STDMETHOD() GetColorSet (DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet) override
 
STDMETHOD() Freeze (DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze) override
 
STDMETHOD() Unfreeze (DWORD dwFreeze) override
 
STDMETHOD() SetAdvise (DWORD aspects, DWORD advf, IAdviseSink *pAdvSink) override
 
STDMETHOD() GetAdvise (DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink) override
 
STDMETHOD() QueryService (REFGUID guidService, REFIID riid, void **ppvObject) override
 
LRESULT OnShowWindow (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetDlgCode (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDestroy (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEraseBackground (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnPrintClient (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysColorChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetShellBrowser (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNCCreate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCreate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnContextMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnActivate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetFocus (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnKillFocus (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCommand (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNotify (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnChangeNotify (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnUpdateStatusbar (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCustomItem (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSettingChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnInitMenuPopup (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
virtual VOID OnFinalMessage (HWND) override
 
virtual WNDPROC GetWindowProc ()
 
- Public Member Functions inherited from ATL::CWindowImpl< CDefView, CWindow, CControlWinTraits >
HWND Create (HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
HWND UnsubclassWindow (BOOL bForce=FALSE)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< TBase >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CWindow
 CWindow (HWND hWnd=NULL)
 
 operator HWND () const
 
UINT ArrangeIconicWindows ()
 
void Attach (HWND hWndNew)
 
HDC BeginPaint (LPPAINTSTRUCT lpPaint)
 
BOOL BringWindowToTop ()
 
BOOL CenterWindow (HWND hWndCenter=NULL)
 
BOOL ChangeClipboardChain (HWND hWndNewNext)
 
BOOL CheckDlgButton (int nIDButton, UINT nCheck)
 
BOOL CheckRadioButton (int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 
HWND ChildWindowFromPoint (POINT point) const
 
HWND ChildWindowFromPointEx (POINT point, UINT uFlags) const
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (LPRECT lpRect) const
 
HWND Create (LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
BOOL CreateCaret (HBITMAP pBitmap)
 
BOOL CreateGrayCaret (int nWidth, int nHeight)
 
BOOL CreateSolidCaret (int nWidth, int nHeight)
 
HDWP DeferWindowPos (HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
 
BOOL DestroyWindow ()
 
HWND Detach ()
 
int DlgDirList (LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType)
 
int DlgDirListComboBox (LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType)
 
BOOL DlgDirSelect (LPTSTR lpString, int nCount, int nIDListBox)
 
BOOL DlgDirSelectComboBox (LPTSTR lpString, int nCount, int nIDComboBox)
 
void DragAcceptFiles (BOOL bAccept=TRUE)
 
BOOL DrawMenuBar ()
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL EnableWindow (BOOL bEnable=TRUE)
 
void EndPaint (LPPAINTSTRUCT lpPaint)
 
BOOL FlashWindow (BOOL bInvert)
 
BOOL GetClientRect (LPRECT lpRect) const
 
HDC GetDC ()
 
HDC GetDCEx (HRGN hRgnClip, DWORD flags)
 
HWND GetDescendantWindow (int nID) const
 
HRESULT GetDlgControl (int nID, REFIID iid, void **ppCtrl)
 
int GetDlgCtrlID () const
 
HRESULT GetDlgHost (int nID, REFIID iid, void **ppHost)
 
HWND GetDlgItem (_In_ int nID) const
 
UINT GetDlgItemInt (_In_ int nID, _Out_opt_ BOOL *lpTrans=NULL, _In_ BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (_In_ int nID, _Out_writes_to_(nMaxCount, return+1) LPTSTR lpStr, _In_ int nMaxCount) const
 
BOOL GetDlgItemText (_In_ int nID, _Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
DWORD GetExStyle () const
 
HFONT GetFont () const
 
DWORD GetHotKey () const
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
HWND GetLastActivePopup () const
 
HMENU GetMenu () const
 
HWND GetNextDlgGroupItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
HWND GetNextDlgTabItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
CWindow GetParent () const
 
BOOL GetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo)
 
BOOL GetScrollPos (int nBar)
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
DWORD GetStyle () const
 
HMENU GetSystemMenu (BOOL bRevert)
 
HWND GetTopLevelParent () const
 
HWND GetTopLevelWindow () const
 
HWND GetTopWindow () const
 
BOOL GetUpdateRect (LPRECT lpRect, BOOL bErase=FALSE)
 
int GetUpdateRgn (HRGN hRgn, BOOL bErase=FALSE)
 
HWND GetWindow (UINT nCmd) const
 
DWORD GetWindowContextHelpId () const
 
HDC GetWindowDC ()
 
LONG GetWindowLong (int nIndex) const
 
LONG_PTR GetWindowLongPtr (int nIndex) const
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
DWORD GetWindowProcessID ()
 
BOOL GetWindowRect (LPRECT lpRect) const
 
int GetWindowRgn (HRGN hRgn)
 
int GetWindowText (_Out_writes_to_(nMaxCount, return+1) LPTSTR lpszStringBuf, _In_ int nMaxCount) const
 
BOOL GetWindowText (_Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
int GetWindowTextLength () const
 
DWORD GetWindowThreadID ()
 
WORD GetWindowWord (int nIndex) const
 
void GotoDlgCtrl (HWND hWndCtrl) const
 
BOOL HideCaret ()
 
BOOL HiliteMenuItem (HMENU hMenu, UINT uHiliteItem, UINT uHilite)
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsChild (const HWND hWnd) const
 
BOOL IsDialogMessage (LPMSG lpMsg)
 
UINT IsDlgButtonChecked (int nIDButton) const
 
BOOL IsIconic () const
 
BOOL IsParentDialog ()
 
BOOL IsWindow () const
 
BOOL IsWindowEnabled () const
 
BOOL IsWindowVisible () const
 
BOOL IsWindowUnicode ()
 
BOOL IsZoomed () const
 
BOOL KillTimer (UINT_PTR nIDEvent)
 
BOOL LockWindowUpdate (BOOL bLock=TRUE)
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
 
int MapWindowPoints (HWND hWndTo, LPRECT lpRect) const
 
int MessageBox (LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
 
void NextDlgCtrl () const
 
BOOL OpenClipboard ()
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void PrevDlgCtrl () const
 
void Print (HDC hDC, DWORD dwFlags) const
 
void PrintClient (HDC hDC, DWORD dwFlags) const
 
BOOL RedrawWindow (LPCRECT lpRectUpdate=NULL, HRGN hRgnUpdate=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
int ReleaseDC (HDC hDC)
 
BOOL ResizeClient (int nWidth, int nHeight, BOOL bRedraw=FALSE)
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScrollWindow (int xAmount, int yAmount, LPCRECT lpRect=NULL, LPCRECT lpClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags)
 
LRESULT SendDlgItemMessage (int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void SendMessageToDescendants (UINT message, WPARAM wParam=0, LPARAM lParam=0, BOOL bDeep=TRUE)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
HWND SetActiveWindow ()
 
HWND SetCapture ()
 
HWND SetClipboardViewer ()
 
int SetDlgCtrlID (int nID)
 
BOOL SetDlgItemInt (int nID, UINT nValue, BOOL bSigned=TRUE)
 
BOOL SetDlgItemText (int nID, LPCTSTR lpszString)
 
HWND SetFocus ()
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
int SetHotKey (WORD wVirtualKeyCode, WORD wModifiers)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
BOOL SetMenu (HMENU hMenu)
 
HWND SetParent (HWND hWndNewParent)
 
void SetRedraw (BOOL bRedraw=TRUE)
 
int SetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw=TRUE)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
 
BOOL SetWindowContextHelpId (DWORD dwContextHelpId)
 
LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong)
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetWindowText (LPCTSTR lpszString)
 
WORD SetWindowWord (int nIndex, WORD wNewWord)
 
BOOL ShowCaret ()
 
BOOL ShowOwnedPopups (BOOL bShow=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL ShowWindow (int nCmdShow)
 
BOOL ShowWindowAsync (int nCmdShow)
 
BOOL UpdateWindow ()
 
BOOL ValidateRect (LPCRECT lpRect)
 
BOOL ValidateRgn (HRGN hRgn)
 
BOOL WinHelp (LPCTSTR lpszHelp, UINT nCmd=HELP_CONTEXT, DWORD dwData=0)
 
- Public Member Functions inherited from ATL::CMessageMap
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)=0
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT CreateViewWindow3 ([in] IShellBrowser *owner, [in, unique] IShellView *prev_view, [in] SV3CVW3_FLAGS view_flags, [in] FOLDERFLAGS mask, [in] FOLDERFLAGS flags, [in] FOLDERVIEWMODE mode, [in, unique] const SHELLVIEWID *view_id, [in] const RECT *rect, [out] HWND *hwnd)
 
- Public Member Functions inherited from IShellView2
HRESULT GetView ([in, out] SHELLVIEWID *view_guid, [in] ULONG view_type)
 
HRESULT CreateViewWindow2 ([in] LPSV2CVW2_PARAMS view_params)
 
HRESULT HandleRename ([in] PCUITEMID_CHILD new_pidl)
 
HRESULT SelectAndPositionItem ([in] PCUITEMID_CHILD item, [in] UINT flags, [in] POINT *point)
 
HRESULT TranslateAccelerator ([in] MSG *pmsg)
 
HRESULT EnableModeless ([in] BOOL fEnable)
 
HRESULT UIActivate ([in] UINT uState)
 
HRESULT Refresh ()
 
HRESULT CreateViewWindow ([in] IShellView *psvPrevious, [in] LPCFOLDERSETTINGS lpfs, [in] IShellBrowser *psb, [out] RECT *prcView, [out] HWND *phWnd)
 
HRESULT DestroyViewWindow ()
 
HRESULT GetCurrentInfo ([out] LPFOLDERSETTINGS lpfs)
 
HRESULT AddPropertySheetPages ([in] DWORD dwReserved, [in] LPFNSVADDPROPSHEETPAGE pfn, [in] LPARAM lparam)
 
HRESULT SaveViewState ()
 
HRESULT SelectItem ([in] PCUITEMID_CHILD pidlItem, [in] SVSIF uFlags)
 
HRESULT GetItemObject ([in] UINT uItem, [in] REFIID riid, [out, iid_is(riid)] void **ppv)
 
HRESULT GetWindow ([out] HWND *phwnd)
 
HRESULT ContextSensitiveHelp ([in] BOOL fEnterMode)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT GetCurrentViewMode ([out] UINT *mode)
 
HRESULT SetCurrentViewMode ([in] UINT mode)
 
HRESULT GetFolder ([in] REFIID riid, [out, iid_is(riid)] void **ppv)
 
HRESULT Item ([in] int index, [out] PITEMID_CHILD *ppidl)
 
HRESULT ItemCount ([in] UINT flags, [out] int *items)
 
HRESULT Items ([in] UINT flags, [in] REFIID riid, [out, iid_is(riid)] void **ppv)
 
HRESULT GetSelectionMarkedItem ([out] int *item)
 
HRESULT GetFocusedItem ([out] int *item)
 
HRESULT GetItemPosition ([in] PCUITEMID_CHILD pidl, [out] POINT *ppt)
 
HRESULT GetSpacing ([in, out, unique] POINT *pt)
 
HRESULT GetDefaultSpacing ([out] POINT *pt)
 
HRESULT GetAutoArrange ()
 
HRESULT SelectItem ([in] int item, [in] DWORD flags)
 
HRESULT SelectAndPositionItems ([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, unique, size_is(cidl)] POINT *apt, [in] DWORD flags)
 
HRESULT QueryStatus ([in, unique] const GUID *pguidCmdGroup, [in] ULONG cCmds, [in, out, size_is(cCmds)] OLECMD prgCmds[], [in, out, unique] OLECMDTEXT *pCmdText)
 
HRESULT Exec ([in, unique] const GUID *pguidCmdGroup, [in] DWORD nCmdID, [in] DWORD nCmdexecopt, [in, unique] VARIANT *pvaIn, [in, out, unique] VARIANT *pvaOut)
 
HRESULT DragEnter ([in, unique] IDataObject *pDataObj, [in] DWORD grfKeyState, [in] POINTL pt, [in, out] DWORD *pdwEffect)
 
HRESULT DragOver ([in] DWORD grfKeyState, [in] POINTL pt, [in, out] DWORD *pdwEffect)
 
HRESULT DragLeave ()
 
HRESULT Drop ([in, unique] IDataObject *pDataObj, [in] DWORD grfKeyState, [in] POINTL pt, [in, out] DWORD *pdwEffect)
 
HRESULT QueryContinueDrag ([in] BOOL fEscapePressed, [in] DWORD grfKeyState)
 
HRESULT GiveFeedback ([in] DWORD dwEffect)
 
- Public Member Functions inherited from IViewObject
HRESULT Draw ([in] DWORD dwDrawAspect, [in] LONG lindex, [in, unique] void *pvAspect, [in, unique] DVTARGETDEVICE *ptd, [in] HDC hdcTargetDev, [in] HDC hdcDraw, [in] LPCRECTL lprcBounds, [in, unique] LPCRECTL lprcWBounds, [in] BOOL(*pfnContinue)(ULONG_PTR dwContinue), [in] ULONG_PTR dwContinue)
 
HRESULT RemoteDraw ([in] DWORD dwDrawAspect, [in] LONG lindex, [in] ULONG_PTR pvAspect, [in, unique] DVTARGETDEVICE *ptd, [in] ULONG_PTR hdcTargetDev, [in] ULONG_PTR hdcDraw, [in] LPCRECTL lprcBounds, [in, unique] LPCRECTL lprcWBounds, [in] IContinue *pContinue)
 
HRESULT GetColorSet ([in] DWORD dwDrawAspect, [in] LONG lindex, [in, unique] void *pvAspect, [in, unique] DVTARGETDEVICE *ptd, [in] HDC hicTargetDev, [out] LOGPALETTE **ppColorSet)
 
HRESULT RemoteGetColorSet ([in] DWORD dwDrawAspect, [in] LONG lindex, [in] ULONG_PTR pvAspect, [in, unique] DVTARGETDEVICE *ptd, [in] ULONG_PTR hicTargetDev, [out] LOGPALETTE **ppColorSet)
 
HRESULT Freeze ([in] DWORD dwDrawAspect, [in] LONG lindex, [in, unique] void *pvAspect, [out] DWORD *pdwFreeze)
 
HRESULT RemoteFreeze ([in] DWORD dwDrawAspect, [in] LONG lindex, [in] ULONG_PTR pvAspect, [out] DWORD *pdwFreeze)
 
HRESULT Unfreeze ([in] DWORD dwFreeze)
 
HRESULT SetAdvise ([in] DWORD aspects, [in] DWORD advf, [in, unique] IAdviseSink *pAdvSink)
 
HRESULT GetAdvise ([out, unique] DWORD *pAspects, [out, unique] DWORD *pAdvf, [out] IAdviseSink **ppAdvSink)
 
HRESULT RemoteGetAdvise ([out] DWORD *pAspects, [out] DWORD *pAdvf, [out] IAdviseSink **ppAdvSink)
 
- Public Member Functions inherited from IServiceProvider
HRESULT QueryService ([in] REFGUID guidService, [in] REFIID riid, [out] void **ppvObject)
 
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 

Static Public Member Functions

static INT CALLBACK ListViewCompareItems (LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
 
static INT CALLBACK fill_list (LPVOID ptr, LPVOID arg)
 
static ATL::CWndClassInfoGetWndClassInfo ()
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CDefView, CWindow, CControlWinTraits >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 

Private Member Functions

HRESULT _MergeToolbar ()
 
BOOL _Sort (int Col=-1)
 
HRESULT _DoFolderViewCB (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HRESULT _GetSnapToGrid ()
 
void _MoveSelectionOnAutoArrange (POINT pt)
 
INT _FindInsertableIndexFromPoint (POINT pt)
 
void _HandleStatusBarResize (int width)
 
void _ForceStatusBarResize ()
 
void _DoCopyToMoveToFolder (BOOL bCopy)
 
BOOL IsDesktop () const
 

Private Attributes

CComPtr< IShellFolderm_pSFParent
 
CComPtr< IShellFolder2m_pSF2Parent
 
CComPtr< IShellDetails > m_pSDParent
 
CComPtr< IShellFolderViewCB > m_pShellFolderViewCB
 
CComPtr< IShellBrowserm_pShellBrowser
 
CComPtr< ICommDlgBrowserm_pCommDlgBrowser
 
CComPtr< IFolderFilterm_pFolderFilter
 
CComPtr< IShellFolderViewDual > m_pShellFolderViewDual
 
CListView m_ListView
 
HWND m_hWndParent
 
FOLDERSETTINGS m_FolderSettings
 
HMENU m_hMenu
 
HMENU m_hMenuArrangeModes
 
HMENU m_hMenuViewModes
 
HMENU m_hContextMenu
 
BOOL m_bmenuBarInitialized
 
UINT m_uState
 
UINT m_cidl
 
PCUITEMID_CHILDm_apidl
 
PIDLIST_ABSOLUTE m_pidlParent
 
HDPA m_LoadColumnsList
 
HDPA m_ListToFolderColMap
 
LISTVIEW_SORT_INFO m_sortInfo
 
ULONG m_hNotify
 
HACCEL m_hAccel
 
DWORD m_dwAspects
 
DWORD m_dwAdvf
 
CComPtr< IAdviseSinkm_pAdvSink
 
CComPtr< IDataObjectm_pSourceDataObject
 
CComPtr< IDropTargetm_pCurDropTarget
 
CComPtr< IDataObjectm_pCurDataObject
 
LONG m_iDragOverItem
 
UINT m_cScrollDelay
 
POINT m_ptLastMousePos
 
POINT m_ptFirstMousePos
 
DWORD m_grfKeyState
 
CComPtr< IContextMenum_pCM
 
CComPtr< IContextMenum_pFileMenu
 
BOOL m_isEditing
 
BOOL m_isParentFolderSpecial
 
bool m_ScheduledStatusbarUpdate
 
CLSID m_Category
 
BOOL m_Destroyed
 
SFVM_CUSTOMVIEWINFO_DATA m_viewinfo_data
 
HICON m_hMyComputerIcon
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Types inherited from IShellView3
enum  _SV3CVW3_FLAGS { SV3CVW3_DEFAULT = 0x00000000 , SV3CVW3_NONINTERACTIVE = 0x00000001 , SV3CVW3_FORCEVIEWMODE = 0x00000002 , SV3CVW3_FORCEFOLDERFLAGS = 0x00000004 }
 
typedef DWORD SV3CVW3_FLAGS
 
- Public Types inherited from IShellView2
typedef GUID SHELLVIEWID
 
typedef struct IShellView2::_SV2CVW2_PARAMS SV2CVW2_PARAMS
 
typedef struct IShellView2::_SV2CVW2_PARAMSLPSV2CVW2_PARAMS
 
- Public Types inherited from IShellView
enum  SVGIO {
  SVGIO_BACKGROUND = 0x00000000 , SVGIO_SELECTION = 0x00000001 , SVGIO_ALLVIEW = 0x00000002 , SVGIO_CHECKED = 0x00000003 ,
  SVGIO_TYPE_MASK = 0x0000000f , SVGIO_FLAG_VIEWORDER = 0x80000000
}
 
enum  SVUIA_STATUS { SVUIA_DEACTIVATE = 0 , SVUIA_ACTIVATE_NOFOCUS = 1 , SVUIA_ACTIVATE_FOCUS = 2 , SVUIA_INPLACEACTIVATE = 3 }
 
typedef IShellViewLPSHELLVIEW
 
typedef UINT SVSIF
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IOleCommandTarget
enum  OLECMDF {
  OLECMDF_SUPPORTED = 0x1 , OLECMDF_ENABLED = 0x2 , OLECMDF_LATCHED = 0x4 , OLECMDF_NINCHED = 0x8 ,
  OLECMDF_INVISIBLE = 0x10 , OLECMDF_DEFHIDEONCTXTMENU = 0x20
}
 
enum  OLECMDTEXTF { OLECMDTEXTF_NONE = 0 , OLECMDTEXTF_NAME = 1 , OLECMDTEXTF_STATUS = 2 }
 
enum  OLECMDEXECOPT { OLECMDEXECOPT_DODEFAULT = 0 , OLECMDEXECOPT_PROMPTUSER = 1 , OLECMDEXECOPT_DONTPROMPTUSER = 2 , OLECMDEXECOPT_SHOWHELP = 3 }
 
enum  OLECMDID {
  OLECMDID_OPEN = 1 , OLECMDID_NEW = 2 , OLECMDID_SAVE = 3 , OLECMDID_SAVEAS = 4 ,
  OLECMDID_SAVECOPYAS = 5 , OLECMDID_PRINT = 6 , OLECMDID_PRINTPREVIEW = 7 , OLECMDID_PAGESETUP = 8 ,
  OLECMDID_SPELL = 9 , OLECMDID_PROPERTIES = 10 , OLECMDID_CUT = 11 , OLECMDID_COPY = 12 ,
  OLECMDID_PASTE = 13 , OLECMDID_PASTESPECIAL = 14 , OLECMDID_UNDO = 15 , OLECMDID_REDO = 16 ,
  OLECMDID_SELECTALL = 17 , OLECMDID_CLEARSELECTION = 18 , OLECMDID_ZOOM = 19 , OLECMDID_GETZOOMRANGE = 20 ,
  OLECMDID_UPDATECOMMANDS = 21 , OLECMDID_REFRESH = 22 , OLECMDID_STOP = 23 , OLECMDID_HIDETOOLBARS = 24 ,
  OLECMDID_SETPROGRESSMAX = 25 , OLECMDID_SETPROGRESSPOS = 26 , OLECMDID_SETPROGRESSTEXT = 27 , OLECMDID_SETTITLE = 28 ,
  OLECMDID_SETDOWNLOADSTATE = 29 , OLECMDID_STOPDOWNLOAD = 30 , OLECMDID_ONTOOLBARACTIVATED = 31 , OLECMDID_FIND = 32 ,
  OLECMDID_DELETE = 33 , OLECMDID_HTTPEQUIV = 34 , OLECMDID_HTTPEQUIV_DONE = 35 , OLECMDID_ENABLE_INTERACTION = 36 ,
  OLECMDID_ONUNLOAD = 37 , OLECMDID_PROPERTYBAG2 = 38 , OLECMDID_PREREFRESH = 39 , OLECMDID_SHOWSCRIPTERROR = 40 ,
  OLECMDID_SHOWMESSAGE = 41 , OLECMDID_SHOWFIND = 42 , OLECMDID_SHOWPAGESETUP = 43 , OLECMDID_SHOWPRINT = 44 ,
  OLECMDID_CLOSE = 45 , OLECMDID_ALLOWUILESSSAVEAS = 46 , OLECMDID_DONTDOWNLOADCSS = 47 , OLECMDID_UPDATEPAGESTATUS = 48 ,
  OLECMDID_PRINT2 = 49 , OLECMDID_PRINTPREVIEW2 = 50 , OLECMDID_SETPRINTTEMPLATE = 51 , OLECMDID_GETPRINTTEMPLATE = 52 ,
  OLECMDID_PAGEACTIONBLOCKED = 55 , OLECMDID_PAGEACTIONUIQUERY = 56 , OLECMDID_FOCUSVIEWCONTROLS = 57 , OLECMDID_FOCUSVIEWCONTROLSQUERY = 58 ,
  OLECMDID_SHOWPAGEACTIONMENU = 59 , OLECMDID_ADDTRAVELENTRY = 60 , OLECMDID_UPDATETRAVELENTRY = 61 , OLECMDID_UPDATEBACKFORWARDSTATE = 62 ,
  OLECMDID_OPTICAL_ZOOM = 63 , OLECMDID_OPTICAL_GETZOOMRANGE = 64 , OLECMDID_WINDOWSTATECHANGED = 65 , OLECMDID_ACTIVEXINSTALLSCOPE = 66 ,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67 , OLECMDID_SHOWTASKDLG = 68 , OLECMDID_POPSTATEEVENT = 69 , OLECMDID_VIEWPORT_MODE = 70 ,
  OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71 , OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72 , OLECMDID_USER_OPTICAL_ZOOM = 73 , OLECMDID_PAGEAVAILABLE = 74 ,
  OLECMDID_GETUSERSCALABLE = 75 , OLECMDID_UPDATE_CARET = 76 , OLECMDID_ENABLE_VISIBILITY = 77 , OLECMDID_MEDIA_PLAYBACK = 78
}
 
typedef IOleCommandTargetLPOLECOMMANDTARGET
 
typedef enum IOleCommandTarget::OLECMDF OLECMDF
 
typedef struct IOleCommandTarget::_tagOLECMD OLECMD
 
typedef struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
 
typedef enum IOleCommandTarget::OLECMDTEXTF OLECMDTEXTF
 
typedef enum IOleCommandTarget::OLECMDEXECOPT OLECMDEXECOPT
 
typedef enum IOleCommandTarget::OLECMDID OLECMDID
 
- Public Types inherited from IDropTarget
typedef IDropTargetLPDROPTARGET
 
- Public Types inherited from IDropSource
typedef IDropSourceLPDROPSOURCE
 
- Public Types inherited from IViewObject
typedef IViewObjectLPVIEWOBJECT
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- Public Attributes inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from IDropTarget
const DWORD MK_ALT = 0x20
 
const DWORD DROPEFFECT_NONE = 0
 
const DWORD DROPEFFECT_COPY = 1
 
const DWORD DROPEFFECT_MOVE = 2
 
const DWORD DROPEFFECT_LINK = 4
 
const DWORD DROPEFFECT_SCROLL = 0x80000000
 
const DWORD DD_DEFSCROLLINSET = 11
 
const DWORD DD_DEFSCROLLDELAY = 50
 
const DWORD DD_DEFSCROLLINTERVAL = 50
 
const DWORD DD_DEFDRAGDELAY = 200
 
const DWORD DD_DEFDRAGMINDIST = 2
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 215 of file CDefView.cpp.

Constructor & Destructor Documentation

◆ CDefView()

CDefView::CDefView ( )

Definition at line 568 of file CDefView.cpp.

568 :
569 m_ListView(),
571 m_hMenu(NULL),
576 m_uState(0),
577 m_cidl(0),
578 m_apidl(NULL),
581 m_hNotify(0),
582 m_hAccel(NULL),
583 m_dwAspects(0),
584 m_dwAdvf(0),
591{
598
602}
#define shell32_hInstance
HMENU m_hMenu
Definition: CDefView.cpp:239
HDPA m_LoadColumnsList
Definition: CDefView.cpp:248
bool m_ScheduledStatusbarUpdate
Definition: CDefView.cpp:271
HMENU m_hMenuArrangeModes
Definition: CDefView.cpp:240
HWND m_hWndParent
Definition: CDefView.cpp:237
DWORD m_dwAdvf
Definition: CDefView.cpp:254
DWORD m_dwAspects
Definition: CDefView.cpp:253
BOOL m_isParentFolderSpecial
Definition: CDefView.cpp:270
UINT m_cScrollDelay
Definition: CDefView.cpp:261
LISTVIEW_SORT_INFO m_sortInfo
Definition: CDefView.cpp:250
PIDLIST_ABSOLUTE m_pidlParent
Definition: CDefView.cpp:247
HMENU m_hContextMenu
Definition: CDefView.cpp:242
BOOL m_Destroyed
Definition: CDefView.cpp:274
PCUITEMID_CHILD * m_apidl
Definition: CDefView.cpp:246
HDPA m_ListToFolderColMap
Definition: CDefView.cpp:249
CLSID m_Category
Definition: CDefView.cpp:273
HICON m_hMyComputerIcon
Definition: CDefView.cpp:277
BOOL m_bmenuBarInitialized
Definition: CDefView.cpp:243
UINT m_cidl
Definition: CDefView.cpp:245
UINT m_uState
Definition: CDefView.cpp:244
BOOL m_isEditing
Definition: CDefView.cpp:269
POINT m_ptLastMousePos
Definition: CDefView.cpp:262
ULONG m_hNotify
Definition: CDefView.cpp:251
LONG m_iDragOverItem
Definition: CDefView.cpp:260
HMENU m_hMenuViewModes
Definition: CDefView.cpp:241
HACCEL m_hAccel
Definition: CDefView.cpp:252
FOLDERSETTINGS m_FolderSettings
Definition: CDefView.cpp:238
CListView m_ListView
Definition: CDefView.cpp:236
SFVM_CUSTOMVIEWINFO_DATA m_viewinfo_data
Definition: CDefView.cpp:275
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
#define IDI_SHELL_COMPUTER_DESKTOP
Definition: shresdef.h:650
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_WINDOW
Definition: winuser.h:921
#define COLOR_WINDOWTEXT
Definition: winuser.h:924
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2119

◆ ~CDefView()

CDefView::~CDefView ( )

Definition at line 604 of file CDefView.cpp.

605{
606 TRACE(" destroying IShellView(%p)\n", this);
607
609
611 {
614 }
615
616 if (m_hWnd)
617 {
619 }
620
624}
#define SFVM_VIEWRELEASE
HWND m_hWnd
Definition: atlwin.h:273
STDMETHOD() DestroyViewWindow() override
Definition: CDefView.cpp:3104
HRESULT _DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CDefView.cpp:4649
BOOL WINAPI DPA_Destroy(HDPA hdpa)
Definition: dpa.c:396
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
pKey DeleteObject()
#define TRACE(s)
Definition: solgame.cpp:4

Member Function Documentation

◆ _DoCopyToMoveToFolder()

void CDefView::_DoCopyToMoveToFolder ( BOOL  bCopy)
private

Definition at line 2388 of file CDefView.cpp.

2389{
2390 if (!GetSelections())
2391 return;
2392
2393 SFGAOF rfg = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_FILESYSTEM;
2394 HRESULT hr = m_pSFParent->GetAttributesOf(m_cidl, m_apidl, &rfg);
2396 return;
2397
2398 if (!bCopy && !(rfg & SFGAO_CANMOVE))
2399 return;
2400 if (bCopy && !(rfg & SFGAO_CANCOPY))
2401 return;
2402
2404 hr = m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl, m_apidl, IID_IContextMenu, 0, (void **)&pCM);
2406 return;
2407
2408 InvokeContextMenuCommand(pCM, (bCopy ? "copyto" : "moveto"), NULL);
2409}
CComPtr< IShellFolder > m_pSFParent
Definition: CDefView.cpp:228
HRESULT InvokeContextMenuCommand(CComPtr< IContextMenu > &pCM, LPCSTR lpVerb, POINT *pt=NULL)
Definition: CDefView.cpp:2067
UINT GetSelections()
Definition: CDefView.cpp:2034
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
HRESULT hr
Definition: shlfolder.c:183

Referenced by OnCommand().

◆ _DoFolderViewCB()

HRESULT CDefView::_DoFolderViewCB ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 4649 of file CDefView.cpp.

4650{
4652
4654 {
4655 hr = m_pShellFolderViewCB->MessageSFVCB(uMsg, wParam, lParam);
4656 }
4657
4658 return hr;
4659}
CComPtr< IShellFolderViewCB > m_pShellFolderViewCB
Definition: CDefView.cpp:231
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by AddPropertySheetPages(), CreateList(), CreateViewWindow3(), DestroyViewWindow(), FillList(), GetDefaultViewMode(), InvokeContextMenuCommand(), LV_AddItem(), LV_DeleteItem(), LV_UpdateItem(), OnChangeNotify(), OnCommand(), OnCreate(), OnNotify(), OnSize(), Refresh(), and ~CDefView().

◆ _FindInsertableIndexFromPoint()

INT CDefView::_FindInsertableIndexFromPoint ( POINT  pt)
private

Definition at line 4302 of file CDefView.cpp.

4303{
4304 RECT rcBound;
4305 INT i, nCount = m_ListView.GetItemCount();
4306 DWORD dwSpacing;
4307 INT dx, dy;
4308 BOOL bSmall = ((m_ListView.GetStyle() & LVS_TYPEMASK) != LVS_ICON);
4309
4310 // FIXME: LVM_GETORIGIN is broken. See CORE-17266
4311 pt.x += m_ListView.GetScrollPos(SB_HORZ);
4312 pt.y += m_ListView.GetScrollPos(SB_VERT);
4313
4314 if (m_ListView.GetStyle() & LVS_ALIGNLEFT)
4315 {
4316 // vertically
4317 for (i = 0; i < nCount; ++i)
4318 {
4319 dwSpacing = ListView_GetItemSpacing(m_ListView, bSmall);
4320 dx = LOWORD(dwSpacing);
4321 dy = HIWORD(dwSpacing);
4323 rcBound.right = rcBound.left + dx;
4324 rcBound.bottom = rcBound.top + dy;
4325 if (pt.x < rcBound.right && pt.y < (rcBound.top + rcBound.bottom) / 2)
4326 {
4327 return i;
4328 }
4329 }
4330 for (i = nCount - 1; i >= 0; --i)
4331 {
4333 if (rcBound.left < pt.x && rcBound.top < pt.y)
4334 {
4335 return i + 1;
4336 }
4337 }
4338 }
4339 else
4340 {
4341 // horizontally
4342 for (i = 0; i < nCount; ++i)
4343 {
4344 dwSpacing = ListView_GetItemSpacing(m_ListView, bSmall);
4345 dx = LOWORD(dwSpacing);
4346 dy = HIWORD(dwSpacing);
4348 rcBound.right = rcBound.left + dx;
4349 rcBound.bottom = rcBound.top + dy;
4350 if (pt.y < rcBound.bottom && pt.x < rcBound.left)
4351 {
4352 return i;
4353 }
4354 if (pt.y < rcBound.bottom && pt.x < rcBound.right)
4355 {
4356 return i + 1;
4357 }
4358 }
4359 for (i = nCount - 1; i >= 0; --i)
4360 {
4362 if (rcBound.left < pt.x && rcBound.top < pt.y)
4363 {
4364 return i + 1;
4365 }
4366 }
4367 }
4368
4369 return nCount;
4370}
int GetItemCount()
Definition: rosctrls.h:121
#define pt(x, y)
Definition: drawing.c:79
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
#define LOWORD(l)
Definition: pedump.c:82
#define ListView_GetItemRect(hwnd, i, prc, code)
Definition: commctrl.h:2483
#define LVS_ICON
Definition: commctrl.h:2266
#define LVS_TYPEMASK
Definition: commctrl.h:2270
#define LVIR_SELECTBOUNDS
Definition: commctrl.h:2480
#define LVS_ALIGNLEFT
Definition: commctrl.h:2285
#define ListView_GetItemSpacing(hwndLV, fSmall)
Definition: commctrl.h:2717
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
#define HIWORD(l)
Definition: typedefs.h:247
#define SB_VERT
Definition: winuser.h:553
#define SB_HORZ
Definition: winuser.h:552

Referenced by _MoveSelectionOnAutoArrange().

◆ _ForceStatusBarResize()

void CDefView::_ForceStatusBarResize ( )
private

Definition at line 4398 of file CDefView.cpp.

4399{
4400 // Get the handle for the status bar
4401 HWND fStatusBar;
4402 m_pShellBrowser->GetControlWindow(FCW_STATUS, &fStatusBar);
4403
4404 // Get the size of our status bar
4405 RECT statusBarSize;
4406 ::GetWindowRect(fStatusBar, &statusBarSize);
4407
4408 // Resize the status bar
4409 _HandleStatusBarResize(statusBarSize.right - statusBarSize.left);
4410}
CComPtr< IShellBrowser > m_pShellBrowser
Definition: CDefView.cpp:232
void _HandleStatusBarResize(int width)
Definition: CDefView.cpp:4372
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by OnCreate(), OnSize(), and UIActivate().

◆ _GetSnapToGrid()

HRESULT CDefView::_GetSnapToGrid ( )
private

Definition at line 3635 of file CDefView.cpp.

3636{
3637 DWORD dwExStyle = (DWORD)m_ListView.SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
3638 return ((dwExStyle & LVS_EX_SNAPTOGRID) ? S_OK : S_FALSE);
3639}
#define S_OK
Definition: intsafe.h:52
#define DWORD
Definition: nt_native.h:44
#define LVS_EX_SNAPTOGRID
Definition: commctrl.h:2753
#define LVM_GETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2732
#define S_FALSE
Definition: winerror.h:2357

Referenced by FillArrangeAsMenu(), OnCommand(), and UpdateFolderViewFlags().

◆ _HandleStatusBarResize()

void CDefView::_HandleStatusBarResize ( int  width)
private

Definition at line 4372 of file CDefView.cpp.

4373{
4374 LRESULT lResult;
4375
4377 {
4378 int nPartArray[] = {-1};
4379 m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, _countof(nPartArray), (LPARAM)nPartArray, &lResult);
4380 return;
4381 }
4382
4383 int nFileSizePartLength = 125;
4384 const int nLocationPartLength = 150;
4385 const int nRightPartsLength = nFileSizePartLength + nLocationPartLength;
4386 int nObjectsPartLength = nWidth - nRightPartsLength;
4387
4388 // If the window is small enough just divide each part into thirds
4389 // to match the behavior of Windows Server 2003
4390 if (nObjectsPartLength <= nLocationPartLength)
4391 nObjectsPartLength = nFileSizePartLength = nWidth / 3;
4392
4393 int nPartArray[] = {nObjectsPartLength, nObjectsPartLength + nFileSizePartLength, -1};
4394
4395 m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, _countof(nPartArray), (LPARAM)nPartArray, &lResult);
4396}
#define SB_SETPARTS
Definition: commctrl.h:1959
#define _countof(array)
Definition: sndvol32.h:70
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by _ForceStatusBarResize().

◆ _MergeToolbar()

HRESULT CDefView::_MergeToolbar ( )
private

Definition at line 4622 of file CDefView.cpp.

4623{
4625 HRESULT hr = S_OK;
4626
4627 hr = IUnknown_QueryService(m_pShellBrowser, IID_IExplorerToolbar, IID_PPV_ARG(IExplorerToolbar, &ptb));
4628 if (FAILED(hr))
4629 return hr;
4630
4631 m_Category = CGID_DefViewFrame;
4632
4633 hr = ptb->SetCommandTarget(static_cast<IOleCommandTarget*>(this), &m_Category, 0);
4634 if (FAILED(hr))
4635 return hr;
4636
4637 if (hr == S_FALSE)
4638 return S_OK;
4639
4640#if 0
4641 hr = ptb->AddButtons(&m_Category, buttonsCount, buttons);
4642 if (FAILED(hr))
4643 return hr;
4644#endif
4645
4646 return S_OK;
4647}
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1501
#define FAILED(hr)
Definition: intsafe.h:51
HWND buttons[5]
Definition: sndrec32.cpp:40
#define IID_PPV_ARG(Itype, ppType)

Referenced by CreateViewWindow3().

◆ _MoveSelectionOnAutoArrange()

void CDefView::_MoveSelectionOnAutoArrange ( POINT  pt)
private

Definition at line 4426 of file CDefView.cpp.

4427{
4428 // get insertable index from position
4430
4431 // create identity mapping of indexes
4433 INT nCount = m_ListView.GetItemCount();
4434 for (INT i = 0; i < nCount; ++i)
4435 {
4436 array.Add(i);
4437 }
4438
4439 // re-ordering mapping
4440 INT iItem = -1;
4441 while ((iItem = m_ListView.GetNextItem(iItem, LVNI_SELECTED)) >= 0)
4442 {
4443 INT iFrom = iItem, iTo = iPosition;
4444 if (iFrom < iTo)
4445 --iTo;
4446 if (iFrom >= nCount)
4447 iFrom = nCount - 1;
4448 if (iTo >= nCount)
4449 iTo = nCount - 1;
4450
4451 // shift indexes by swapping (like a bucket relay)
4452 if (iFrom < iTo)
4453 {
4454 for (INT i = iFrom; i < iTo; ++i)
4455 {
4456 // swap array[i] and array[i + 1]
4457 INT tmp = array[i];
4458 array[i] = array[i + 1];
4459 array[i + 1] = tmp;
4460 }
4461 }
4462 else
4463 {
4464 for (INT i = iFrom; i > iTo; --i)
4465 {
4466 // swap array[i] and array[i - 1]
4467 INT tmp = array[i];
4468 array[i] = array[i - 1];
4469 array[i - 1] = tmp;
4470 }
4471 }
4472 }
4473
4474 // create mapping (ListView's lParam to index) from array
4476 for (INT i = 0; i < nCount; ++i)
4477 {
4479 map.Add(lParam, i);
4480 }
4481
4482 // finally sort
4484}
static INT CALLBACK SelectionMoveCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: CDefView.cpp:4415
INT _FindInsertableIndexFromPoint(POINT pt)
Definition: CDefView.cpp:4302
int GetNextItem(int i, WORD flags)
Definition: rosctrls.h:161
BOOL SortItems(PFNLVCOMPARE pfnCompare, PVOID lParam)
Definition: rosctrls.h:141
DWORD_PTR GetItemData(int i)
Definition: rosctrls.h:204
Definition: _map.h:48
#define LVNI_SELECTED
Definition: commctrl.h:2429

Referenced by Drop().

◆ _PidlByItem() [1/2]

PCUITEMID_CHILD CDefView::_PidlByItem ( int  i)

Definition at line 1293 of file CDefView.cpp.

1294{
1295 if (!m_ListView)
1296 return nullptr;
1297 return reinterpret_cast<PCUITEMID_CHILD>(m_ListView.GetItemData(i));
1298}
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70

Referenced by drag_notify_subitem(), GetSelections(), Item(), LV_FindItemByPidl(), OnNotify(), and UpdateStatusbar().

◆ _PidlByItem() [2/2]

PCUITEMID_CHILD CDefView::_PidlByItem ( LVITEM lvItem)

Definition at line 1300 of file CDefView.cpp.

1301{
1302 if (!m_ListView)
1303 return nullptr;
1304 return reinterpret_cast<PCUITEMID_CHILD>(lvItem.lParam);
1305}

◆ _Sort()

BOOL CDefView::_Sort ( int  Col = -1)
private

Definition at line 1241 of file CDefView.cpp.

1242{
1243 HWND hHeader;
1244 HDITEM hColumn;
1245 int prevCol = m_sortInfo.ListColumn;
1247
1248 // FIXME: Is this correct? Who sets this style?
1249 // And if it is set, should it also block sorting using the menu?
1250 // Any why should it block sorting when the view is loaded initially?
1251 if (m_ListView.GetWindowLongPtr(GWL_STYLE) & LVS_NOSORTHEADER)
1252 return TRUE;
1253
1254 hHeader = ListView_GetHeader(m_ListView.m_hWnd);
1255 if (Col != -1)
1256 {
1257 if (Col >= Header_GetItemCount(hHeader))
1258 {
1259 ERR("Sort column out of range\n");
1260 return FALSE;
1261 }
1262
1263 if (prevCol == Col)
1264 m_sortInfo.Direction *= -1;
1265 else
1267 m_sortInfo.ListColumn = Col;
1268 }
1269 if (!m_sortInfo.Direction)
1270 m_sortInfo.Direction += 1;
1271
1272 /* If the sorting column changed, remove the sorting style from the old column */
1273 if (prevCol != -1 && prevCol != m_sortInfo.ListColumn)
1274 {
1275 hColumn.mask = HDI_FORMAT;
1276 Header_GetItem(hHeader, prevCol, &hColumn);
1277 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1278 Header_SetItem(hHeader, prevCol, &hColumn);
1279 }
1280
1281 /* Set the sorting style on the new column */
1282 hColumn.mask = HDI_FORMAT;
1283 Header_GetItem(hHeader, m_sortInfo.ListColumn, &hColumn);
1284 hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1285 hColumn.fmt |= (m_sortInfo.Direction > 0 ? HDF_SORTUP : HDF_SORTDOWN);
1286 Header_SetItem(hHeader, m_sortInfo.ListColumn, &hColumn);
1287
1288 /* Sort the list, using the current values of ListColumn and bIsAscending */
1291}
#define ERR(fmt,...)
Definition: precomp.h:57
static INT CALLBACK ListViewCompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
Definition: CDefView.cpp:1227
#define TRUE
Definition: types.h:120
#define ASSERT(a)
Definition: mode.c:44
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:751
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:758
#define ListView_GetHeader(hwnd)
Definition: commctrl.h:2656
#define HDF_SORTUP
Definition: commctrl.h:724
#define HDI_FORMAT
Definition: commctrl.h:705
#define LVS_NOSORTHEADER
Definition: commctrl.h:2290
#define Header_GetItemCount(hwndHD)
Definition: commctrl.h:734
#define HDITEM
Definition: commctrl.h:697
#define HDF_SORTDOWN
Definition: commctrl.h:725
bool bLoadedFromViewState
Definition: CDefView.cpp:64
#define GWL_STYLE
Definition: winuser.h:855

Referenced by FillList(), OnCommand(), and OnNotify().

◆ AddObject()

HRESULT STDMETHODCALLTYPE CDefView::AddObject ( PITEMID_CHILD  pidl,
UINT item 
)
override

Definition at line 3842 of file CDefView.cpp.

3843{
3844 TRACE("(%p)->(%p %p)\n", this, pidl, item);
3845 if (!m_ListView)
3846 {
3847 ERR("!m_ListView\n");
3848 return E_FAIL;
3849 }
3850 *item = LV_AddItem(pidl);
3851 return (int)*item >= 0 ? S_OK : E_OUTOFMEMORY;
3852}
int LV_AddItem(PCUITEMID_CHILD pidl)
Definition: CDefView.cpp:1336
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
static ATOM item
Definition: dde.c:856

◆ AddPropertySheetPages()

HRESULT WINAPI CDefView::AddPropertySheetPages ( DWORD  dwReserved,
LPFNSVADDPROPSHEETPAGE  pfn,
LPARAM  lparam 
)
override

Implements IShellView.

Definition at line 3164 of file CDefView.cpp.

3165{
3166 TRACE("(%p)->(0x%lX, %p, %p)\n", this, dwReserved, lpfn, lparam);
3167
3170 return S_OK;
3171}
@ lparam
Definition: SystemMenu.c:31
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95
#define SFVM_ADDPROPERTYPAGES
Definition: shlobj.h:1335

◆ ArrangeGrid()

HRESULT STDMETHODCALLTYPE CDefView::ArrangeGrid ( )
override

Definition at line 3829 of file CDefView.cpp.

3830{
3832 return S_OK;
3833}
DWORD SetExtendedListViewStyle(DWORD dw, DWORD dwMask=0)
Definition: rosctrls.h:47

Referenced by OnCommand().

◆ AutoArrange()

HRESULT STDMETHODCALLTYPE CDefView::AutoArrange ( )
override

Definition at line 3835 of file CDefView.cpp.

3836{
3837 m_ListView.ModifyStyle(0, LVS_AUTOARRANGE);
3839 return S_OK;
3840}
BOOL Arrange(UINT nCode)
Definition: rosctrls.h:241
#define LVA_DEFAULT
Definition: commctrl.h:2532
#define LVS_AUTOARRANGE
Definition: commctrl.h:2277

Referenced by OnCommand().

◆ CheckToolbar()

void CDefView::CheckToolbar ( )

Definition at line 686 of file CDefView.cpp.

687{
689
690 TRACE("\n");
691
692 if (m_pCommDlgBrowser != NULL)
693 {
694 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON,
696 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON,
698 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON,
700 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON,
702 }
703}
CComPtr< ICommDlgBrowser > m_pCommDlgBrowser
Definition: CDefView.cpp:233
GLuint64EXT * result
Definition: glext.h:11304
#define TB_CHECKBUTTON
Definition: commctrl.h:1043
#define TB_ENABLEBUTTON
Definition: commctrl.h:1042
@ FVM_LIST
Definition: shobjidl.idl:682
@ FVM_DETAILS
Definition: shobjidl.idl:683
#define FCIDM_TB_SMALLICON
Definition: shresdef.h:862
#define FCIDM_TB_REPORTVIEW
Definition: shresdef.h:863

Referenced by CreateViewWindow3(), and OnCommand().

◆ CheckViewMode()

HRESULT CDefView::CheckViewMode ( HMENU  hmenuView)

Definition at line 1914 of file CDefView.cpp.

1915{
1917 {
1918 UINT iItemFirst = FCIDM_SHVIEW_BIGICON;
1919 UINT iItemLast = iItemFirst + FVM_LAST - FVM_FIRST;
1920 UINT iItem = iItemFirst + m_FolderSettings.ViewMode - FVM_FIRST;
1921 CheckMenuRadioItem(hmenuView, iItemFirst, iItemLast, iItem, MF_BYCOMMAND);
1922 }
1923
1924 return S_OK;
1925}
unsigned int UINT
Definition: ndis.h:50
@ FVM_LAST
Definition: shobjidl.idl:688
@ FVM_FIRST
Definition: shobjidl.idl:680
#define FCIDM_SHVIEW_BIGICON
Definition: shresdef.h:841
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)

Referenced by Exec(), and OnInitMenuPopup().

◆ ColumnListChanged()

void CDefView::ColumnListChanged ( )

Definition at line 1162 of file CDefView.cpp.

1163{
1165 m_ListToFolderColMap = NULL; // No cache while we are building the cache
1167 for (UINT i = 0;; ++i)
1168 {
1170 if (FAILED(hr))
1171 break; // No more columns
1172 if (!DPA_SetPtr(cache, i, (void*)(INT_PTR) hr))
1173 break; // Cannot allow holes in the cache, must stop now.
1174 }
1176
1177 for (;;)
1178 {
1180 break;
1181 }
1183 if (hMenu)
1184 {
1185 hMenu = GetSubmenuByID(hMenu, FCIDM_SHVIEW_ARRANGE);
1186 for (UINT i = DVIDM_ARRANGESORT_FIRST; i <= DVIDM_ARRANGESORT_LAST && hMenu; ++i)
1187 {
1188 RemoveMenu(hMenu, i, MF_BYCOMMAND);
1189 }
1190 if ((int) GetMenuItemID(hMenu, 0) <= 0)
1191 RemoveMenu(hMenu, 0, MF_BYPOSITION); // Separator
1192 }
1194 LVCOLUMN lvc;
1195 lvc.mask = LVCF_TEXT;
1196 lvc.pszText = buf;
1197 lvc.cchTextMax = _countof(buf);
1198 for (UINT listCol = 0; listCol < DEFVIEW_ARRANGESORT_MAXENUM; ++listCol)
1199 {
1200 if (!ListView_GetColumn(m_ListView.m_hWnd, listCol, &lvc))
1201 break;
1202 HRESULT foldCol = MapListColumnToFolderColumn(listCol);
1203 assert(SUCCEEDED(foldCol));
1205 DVIDM_ARRANGESORT_FIRST + listCol, lvc.pszText, listCol);
1206 }
1207
1208 ListView_RedrawItems(m_ListView.m_hWnd, 0, 0x7fffffff);
1209 m_ListView.InvalidateRect(NULL, TRUE);
1210}
static BOOL AppendMenuItem(HMENU hMenu, UINT MF, UINT Id, LPCWSTR String, SIZE_T Data=0)
Definition: CDefView.cpp:157
@ DVIDM_ARRANGESORT_FIRST
Definition: CDefView.cpp:50
@ DEFVIEW_ARRANGESORT_MAXENUM
Definition: CDefView.cpp:47
@ DVIDM_ARRANGESORT_LAST
Definition: CDefView.cpp:49
static HMENU GetSubmenuByID(HMENU hmenu, UINT id)
Definition: CDefView.cpp:181
HRESULT MapListColumnToFolderColumn(UINT ListCol)
Definition: CDefView.cpp:1008
BOOL WINAPI DPA_SetPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:626
BOOL WINAPI DPA_DeleteAllPtrs(HDPA hdpa)
Definition: dpa.c:730
#define MAX_PATH
Definition: compat.h:34
#define assert(x)
Definition: debug.h:53
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define ListView_GetColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2627
#define ListView_RedrawItems(hwndLV, iFirst, iLast)
Definition: commctrl.h:2530
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LVCOLUMN
Definition: commctrl.h:2586
#define FCIDM_MENU_VIEW
Definition: shlobj.h:632
#define FCIDM_SHVIEW_ARRANGE
Definition: shresdef.h:827
Definition: dpa.c:49
Definition: cache.c:49
int32_t INT_PTR
Definition: typedefs.h:64
#define MF_STRING
Definition: winuser.h:138
UINT WINAPI GetMenuItemID(_In_ HMENU, _In_ int)
#define MF_BYPOSITION
Definition: winuser.h:203
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DoColumnContextMenu(), and LoadColumns().

◆ ContextSensitiveHelp()

HRESULT WINAPI CDefView::ContextSensitiveHelp ( BOOL  fEnterMode)
override

Implements IOleWindow.

Definition at line 3033 of file CDefView.cpp.

3034{
3035 FIXME("(%p) stub\n", this);
3036
3037 return E_NOTIMPL;
3038}
#define FIXME(fmt,...)
Definition: precomp.h:53

◆ CreateList()

BOOL CDefView::CreateList ( )

Definition at line 803 of file CDefView.cpp.

804{
805 HRESULT hr;
806 DWORD dwStyle, dwExStyle, ListExStyle;
807 UINT ViewMode;
808
809 TRACE("%p\n", this);
810
812 LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_AUTOARRANGE; // FIXME: Remove LVS_AUTOARRANGE when the view is able to save ItemPos
814 ListExStyle = LVS_EX_INFOTIP | LVS_EX_LABELTIP;
815
817 {
819 dwStyle |= LVS_ALIGNLEFT;
820 // LVS_EX_REGIONAL?
821 }
822 else
823 {
824 dwStyle |= LVS_SHOWSELALWAYS; // MSDN says FWF_SHOWSELALWAYS is deprecated, always turn on for folders
826 ListExStyle |= LVS_EX_DOUBLEBUFFER;
827 }
828
829 ViewMode = m_FolderSettings.ViewMode;
830 hr = _DoFolderViewCB(SFVM_DEFVIEWMODE, 0, (LPARAM)&ViewMode);
831 if (SUCCEEDED(hr))
832 {
833 if (ViewMode >= FVM_FIRST && ViewMode <= FVM_LAST)
834 m_FolderSettings.ViewMode = ViewMode;
835 else
836 ERR("Ignoring invalid ViewMode from SFVM_DEFVIEWMODE: %u (was: %u)\n", ViewMode, m_FolderSettings.ViewMode);
837 }
838
840 {
841 case FVM_ICON:
842 dwStyle |= LVS_ICON;
843 break;
844 case FVM_DETAILS:
845 dwStyle |= LVS_REPORT;
846 break;
847 case FVM_SMALLICON:
848 dwStyle |= LVS_SMALLICON;
849 break;
850 case FVM_LIST:
851 dwStyle |= LVS_LIST;
852 break;
853 default:
854 dwStyle |= LVS_LIST;
855 break;
856 }
857
859 dwStyle |= LVS_AUTOARRANGE;
860
862 ListExStyle |= LVS_EX_SNAPTOGRID;
863
865 dwStyle |= LVS_SINGLESEL;
866
868 ListExStyle |= LVS_EX_FULLROWSELECT;
869
871 (!SHELL_GetSetting(SSF_DOUBLECLICKINWEBVIEW, fDoubleClickInWebView) && !SHELL_GetSetting(SSF_WIN95CLASSIC, fWin95Classic)))
873
875 dwStyle |= LVS_NOCOLUMNHEADER;
876
877#if 0
878 // FIXME: Because this is a negative, everyone gets the new flag by default unless they
879 // opt out. This code should be enabled when shell looks like Vista instead of 2003
881 ListExStyle |= LVS_EX_HEADERINALLVIEWS;
882#endif
883
885 dwExStyle &= ~WS_EX_CLIENTEDGE;
886
887 RECT rcListView = {0,0,0,0};
888 m_ListView.Create(m_hWnd, rcListView, L"FolderView", dwStyle, dwExStyle, ID_LISTVIEW);
889
890 if (!m_ListView)
891 return FALSE;
892
894
895 /* UpdateShellSettings(); */
896 return TRUE;
897}
#define ID_LISTVIEW
Definition: CDefView.cpp:559
HWND Create(HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: rosctrls.h:8
#define L(x)
Definition: ntvdm.h:50
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define LVS_EX_ONECLICKACTIVATE
Definition: commctrl.h:2740
#define LVS_SINGLESEL
Definition: commctrl.h:2271
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2275
#define LVS_EX_LABELTIP
Definition: commctrl.h:2748
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2289
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2272
#define LVS_REPORT
Definition: commctrl.h:2267
#define LVS_SMALLICON
Definition: commctrl.h:2268
#define LVS_ALIGNTOP
Definition: commctrl.h:2284
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
#define LVS_EX_TRACKSELECT
Definition: commctrl.h:2737
#define LVS_EDITLABELS
Definition: commctrl.h:2278
#define LVS_EX_DOUBLEBUFFER
Definition: commctrl.h:2750
#define LVS_LIST
Definition: commctrl.h:2269
#define LVS_EX_INFOTIP
Definition: commctrl.h:2744
#define SHELL_GetSetting(pss, ssf, field)
Definition: shellutils.h:828
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1318
#define SSF_DOUBLECLICKINWEBVIEW
Definition: shlobj.h:1610
#define SSF_WIN95CLASSIC
Definition: shlobj.h:1613
@ FWF_SNAPTOGRID
Definition: shobjidl.idl:644
@ FWF_AUTOARRANGE
Definition: shobjidl.idl:642
@ FWF_ALIGNLEFT
Definition: shobjidl.idl:653
@ FWF_NOSCROLL
Definition: shobjidl.idl:652
@ FWF_NOHEADERINALLVIEWS
Definition: shobjidl.idl:666
@ FWF_SINGLECLICKACTIVATE
Definition: shobjidl.idl:657
@ FWF_FULLROWSELECT
Definition: shobjidl.idl:663
@ FWF_NOCLIENTEDGE
Definition: shobjidl.idl:651
@ FWF_SINGLESEL
Definition: shobjidl.idl:648
@ FWF_NOCOLUMNHEADER
Definition: shobjidl.idl:665
@ FWF_DESKTOP
Definition: shobjidl.idl:647
@ FVM_SMALLICON
Definition: shobjidl.idl:681
@ FVM_ICON
Definition: shobjidl.idl:679
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384

Referenced by OnCreate().

◆ CreateViewWindow()

HRESULT WINAPI CDefView::CreateViewWindow ( IShellView psvPrevious,
LPCFOLDERSETTINGS  pfs,
IShellBrowser psb,
RECT prcView,
HWND phWnd 
)
override

Implements IShellView.

Definition at line 3098 of file CDefView.cpp.

3099{
3100 return CreateViewWindow3(psb, lpPrevView, SV3CVW3_DEFAULT,
3101 (FOLDERFLAGS)lpfs->fFlags, (FOLDERFLAGS)lpfs->fFlags, (FOLDERVIEWMODE)lpfs->ViewMode, NULL, prcView, phWnd);
3102}
STDMETHOD() CreateViewWindow3(IShellBrowser *psb, IShellView *psvPrevious, SV3CVW3_FLAGS view_flags, FOLDERFLAGS mask, FOLDERFLAGS flags, FOLDERVIEWMODE mode, const SHELLVIEWID *view_id, const RECT *prcView, HWND *hwnd) override
Definition: CDefView.cpp:3709
FOLDERFLAGS
Definition: shobjidl.idl:641
FOLDERVIEWMODE
Definition: shobjidl.idl:677

◆ CreateViewWindow2()

HRESULT STDMETHODCALLTYPE CDefView::CreateViewWindow2 ( LPSV2CVW2_PARAMS  view_params)
override

Implements IShellView2.

Definition at line 3702 of file CDefView.cpp.

3703{
3704 return CreateViewWindow3(view_params->psbOwner, view_params->psvPrev,
3705 SV3CVW3_DEFAULT, (FOLDERFLAGS)view_params->pfs->fFlags, (FOLDERFLAGS)view_params->pfs->fFlags,
3706 (FOLDERVIEWMODE)view_params->pfs->ViewMode, view_params->pvid, view_params->prcView, &view_params->hwndView);
3707}

◆ CreateViewWindow3()

HRESULT STDMETHODCALLTYPE CDefView::CreateViewWindow3 ( IShellBrowser psb,
IShellView psvPrevious,
SV3CVW3_FLAGS  view_flags,
FOLDERFLAGS  mask,
FOLDERFLAGS  flags,
FOLDERVIEWMODE  mode,
const SHELLVIEWID view_id,
const RECT prcView,
HWND hwnd 
)
override

Implements IShellView3.

Definition at line 3709 of file CDefView.cpp.

3710{
3711 OLEMENUGROUPWIDTHS omw = { { 0, 0, 0, 0, 0, 0 } };
3712 const UINT SUPPORTED_SV3CVW3 = SV3CVW3_FORCEVIEWMODE | SV3CVW3_FORCEFOLDERFLAGS;
3713 const UINT IGNORE_FWF = FWF_OWNERDATA; // FIXME: Support this
3714
3715 *hwnd = NULL;
3716
3717 TRACE("(%p)->(shlview=%p shlbrs=%p rec=%p hwnd=%p vmode=%x flags=%x)\n", this, psvPrevious, psb, prcView, hwnd, mode, flags);
3718 if (prcView != NULL)
3719 TRACE("-- left=%i top=%i right=%i bottom=%i\n", prcView->left, prcView->top, prcView->right, prcView->bottom);
3720
3721 /* Validate the Shell Browser */
3722 if (psb == NULL || m_hWnd)
3723 return E_UNEXPECTED;
3724
3725 if (view_flags & ~SUPPORTED_SV3CVW3)
3726 FIXME("unsupported view flags 0x%08x\n", view_flags & ~SUPPORTED_SV3CVW3);
3727
3728 if (mode == FVM_AUTO)
3730
3731 /* Set up the member variables */
3732 m_pShellBrowser = psb;
3734 m_FolderSettings.fFlags = (mask & flags) & ~IGNORE_FWF;
3735
3736 if (view_id)
3737 {
3738 if (IsEqualIID(*view_id, VID_LargeIcons))
3740 else if (IsEqualIID(*view_id, VID_SmallIcons))
3742 else if (IsEqualIID(*view_id, VID_List))
3744 else if (IsEqualIID(*view_id, VID_Details))
3746 else if (IsEqualIID(*view_id, VID_Thumbnails))
3748 else if (IsEqualIID(*view_id, VID_Tile))
3750 else if (IsEqualIID(*view_id, VID_ThumbStrip))
3752 else
3753 FIXME("Ignoring unrecognized VID %s\n", debugstr_guid(view_id));
3754 }
3755 const UINT requestedViewMode = m_FolderSettings.ViewMode;
3756
3757 /* Get our parent window */
3758 m_pShellBrowser->GetWindow(&m_hWndParent);
3760
3761 /* Try to get the ICommDlgBrowserInterface, adds a reference !!! */
3764 {
3765 TRACE("-- CommDlgBrowser\n");
3766 }
3767
3768 LoadViewState();
3769 if (view_flags & SV3CVW3_FORCEVIEWMODE)
3770 m_FolderSettings.ViewMode = requestedViewMode;
3771 if (view_flags & SV3CVW3_FORCEFOLDERFLAGS)
3772 m_FolderSettings.fFlags = (mask & flags) & ~IGNORE_FWF;
3773
3774 RECT rcView = *prcView;
3776 if (m_hWnd == NULL)
3777 return E_FAIL;
3778
3779 *hwnd = m_hWnd;
3780
3781 CheckToolbar();
3782
3783 if (!*hwnd)
3784 return E_FAIL;
3785
3787
3789 UpdateWindow();
3790
3791 if (!m_hMenu)
3792 {
3793 m_hMenu = CreateMenu();
3794 m_pShellBrowser->InsertMenusSB(m_hMenu, &omw);
3795 TRACE("-- after fnInsertMenusSB\n");
3796 }
3797
3798 _MergeToolbar();
3799
3800 return S_OK;
3801}
#define U(x)
Definition: wordpad.c:45
@ Create
Definition: registry.c:563
BOOL UpdateWindow()
Definition: atlwin.h:1345
HRESULT _MergeToolbar()
Definition: CDefView.cpp:4622
void CheckToolbar()
Definition: CDefView.cpp:686
FOLDERVIEWMODE GetDefaultViewMode()
Definition: CDefView.cpp:3467
HRESULT LoadViewState()
Definition: CDefView.cpp:3212
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum mode
Definition: glext.h:6217
GLbitfield flags
Definition: glext.h:7161
@ SV3CVW3_FORCEVIEWMODE
Definition: shobjidl.idl:837
@ SV3CVW3_FORCEFOLDERFLAGS
Definition: shobjidl.idl:838
#define debugstr_guid
Definition: kernel32.h:35
if(dx< 0)
Definition: linetemp.h:194
#define WS_CHILD
Definition: pedump.c:617
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1308
#define SFVM_HWNDMAIN
Definition: shlobj.h:1334
@ FWF_OWNERDATA
Definition: shobjidl.idl:645
@ FVM_AUTO
Definition: shobjidl.idl:678
@ FVM_TILE
Definition: shobjidl.idl:685
@ FVM_THUMBNAIL
Definition: shobjidl.idl:684
@ FVM_THUMBSTRIP
Definition: shobjidl.idl:686
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
UINT_PTR WPARAM
Definition: windef.h:207
#define E_UNEXPECTED
Definition: winerror.h:2456
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HMENU WINAPI CreateMenu(void)
Definition: menu.c:829
#define SWP_NOMOVE
Definition: winuser.h:1247
#define SWP_NOSIZE
Definition: winuser.h:1248
#define HWND_TOP
Definition: winuser.h:1210
#define SWP_SHOWWINDOW
Definition: winuser.h:1251

Referenced by CreateViewWindow(), and CreateViewWindow2().

◆ DestroyViewWindow()

HRESULT WINAPI CDefView::DestroyViewWindow ( )
override

Implements IShellView.

Definition at line 3104 of file CDefView.cpp.

3105{
3106 TRACE("(%p)\n", this);
3107
3108 /* Make absolutely sure all our UI is cleaned up */
3110
3111 if (m_hAccel)
3112 {
3113 // MSDN: Accelerator tables loaded from resources are freed automatically when application terminates
3114 m_hAccel = NULL;
3115 }
3116
3118 {
3121 }
3122
3123 if (m_hMenuViewModes)
3124 {
3127 }
3128
3129 if (m_hMenu)
3130 {
3132 m_hMenu = NULL;
3133 }
3134
3135 if (m_ListView)
3136 {
3137 m_ListView.DestroyWindow();
3138 }
3139
3140 if (m_hWnd)
3141 {
3143 DestroyWindow();
3144 }
3145
3148
3149 return S_OK;
3150}
#define SFVM_WINDOWCLOSING
void Release()
Definition: atlcomcli.h:170
BOOL DestroyWindow()
Definition: atlwin.h:462
STDMETHOD() UIActivate(UINT uState) override
Definition: CDefView.cpp:3063
@ SVUIA_DEACTIVATE
Definition: shobjidl.idl:753
BOOL WINAPI DestroyMenu(_In_ HMENU)

Referenced by ~CDefView().

◆ DoActivate()

void CDefView::DoActivate ( UINT  uState)

Definition at line 2354 of file CDefView.cpp.

2355{
2356 TRACE("%p uState=%x\n", this, uState);
2357
2358 // don't do anything if the state isn't really changing
2359 if (m_uState == uState)
2360 {
2361 return;
2362 }
2363
2364 if (uState == SVUIA_DEACTIVATE)
2365 {
2366 OnDeactivate();
2367 }
2368 else
2369 {
2371 {
2372 FillEditMenu();
2373 FillViewMenu();
2374 m_pShellBrowser->SetMenuSB(m_hMenu, 0, m_hWnd);
2376 }
2377
2378 if (SVUIA_ACTIVATE_FOCUS == uState)
2379 {
2380 m_ListView.SetFocus();
2381 }
2382 }
2383
2384 m_uState = uState;
2385 TRACE("--\n");
2386}
HRESULT FillEditMenu()
Definition: CDefView.cpp:1825
void OnDeactivate()
Definition: CDefView.cpp:2343
HRESULT FillViewMenu()
Definition: CDefView.cpp:1842
@ SVUIA_ACTIVATE_FOCUS
Definition: shobjidl.idl:755

Referenced by OnActivate(), OnKillFocus(), OnSetFocus(), and UIActivate().

◆ DoColumnContextMenu()

LRESULT CDefView::DoColumnContextMenu ( LRESULT  lParam)

Definition at line 1927 of file CDefView.cpp.

1928{
1929 const UINT maxItems = 15; // Feels about right
1930 const UINT idMore = 0x1337;
1931 UINT idFirst = idMore + 1, idLast = idFirst;
1932 UINT lastValidListCol = 0; // Keep track of where the new column should be inserted
1933 UINT showMore = GetKeyState(VK_SHIFT) < 0;
1935 HWND hWndHdr = ListView_GetHeader(m_ListView.m_hWnd);
1936
1937 if (lParam == ~0)
1938 {
1939 RECT r;
1940 ::GetWindowRect(hWndHdr, &r);
1941 pt.x = r.left + ((r.right - r.left) / 2);
1942 pt.y = r.top + ((r.bottom - r.top) / 2);
1943 }
1944
1945 HMENU hMenu = CreatePopupMenu();
1946 if (!hMenu)
1947 return 0;
1948
1949 for (UINT foldCol = 0;; ++foldCol)
1950 {
1953 sd.str.uType = !STRRET_WSTR;
1954 if (FAILED(GetDetailsByFolderColumn(NULL, foldCol, sd)))
1955 break;
1956 if (FAILED(StrRetToStrNW(buf, _countof(buf), &sd.str, NULL)))
1957 break;
1958
1959 SHCOLSTATEF state = 0;
1960 if (!m_pSF2Parent || FAILED(m_pSF2Parent->GetDefaultColumnState(foldCol, &state)))
1961 state = 0;
1962 showMore |= (state & (SHCOLSTATE_SECONDARYUI));
1963
1964 UINT mf = MF_STRING;
1965 HRESULT listCol = MapFolderColumnToListColumn(foldCol);
1966
1967 if (foldCol == 0)
1968 mf |= MF_CHECKED | MF_GRAYED | MF_DISABLED; // Force column 0
1970 continue;
1971 else if (SUCCEEDED(listCol))
1972 mf |= MF_CHECKED;
1973
1974 if (AppendMenuItem(hMenu, mf, idLast, buf, lastValidListCol + 1))
1975 {
1976 idLast++;
1977 if (SUCCEEDED(listCol))
1978 lastValidListCol = listCol;
1979 }
1980
1981 if (idLast - idFirst == maxItems)
1982 {
1983 showMore++;
1984 break;
1985 }
1986 }
1987
1988 if (showMore)
1989 {
1990#if 0 // TODO
1991 InsertMenuW(hMenu, -1, MF_SEPARATOR, 0, NULL);
1992 InsertMenuW(hMenu, -1, MF_STRING, idMore, L"More...");
1993#endif
1994 }
1995
1996 // A cludge to force the cursor to update so we are not stuck with "size left/right" if
1997 // the right-click was on a column divider.
1999
2000 // Note: Uses the header as the owner so CDefView::OnInitMenuPopup does not mess us up.
2002 pt.x, pt.y, 0, hWndHdr, NULL);
2003 if (idCmd == idMore)
2004 {
2005 FIXME("Open More dialog\n");
2006 }
2007 else if (idCmd)
2008 {
2009 UINT foldCol = idCmd - idFirst;
2010 HRESULT listCol = MapFolderColumnToListColumn(foldCol);
2011 if (SUCCEEDED(listCol))
2012 {
2013 ListView_DeleteColumn(m_ListView.m_hWnd, listCol);
2014 }
2015 else
2016 {
2017 listCol = (UINT) GetMenuItemDataById(hMenu, idCmd);
2018 LoadColumn(foldCol, listCol, TRUE);
2019 }
2021 }
2022 DestroyMenu(hMenu);
2023 return 0;
2024}
static SIZE_T GetMenuItemDataById(HMENU hMenu, UINT Id)
Definition: CDefView.cpp:170
static int state
Definition: maze.c:121
HRESULT LoadColumn(UINT FoldCol, UINT ListCol, BOOL Insert, UINT ForceWidth=0)
Definition: CDefView.cpp:1060
CComPtr< IShellFolder2 > m_pSF2Parent
Definition: CDefView.cpp:229
HRESULT MapFolderColumnToListColumn(UINT FoldCol)
Definition: CDefView.cpp:995
void ColumnListChanged()
Definition: CDefView.cpp:1162
HRESULT GetDetailsByFolderColumn(PCUITEMID_CHILD pidl, UINT FoldCol, SHELLDETAILS &sd)
Definition: CDefView.cpp:1029
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR sd[]
Definition: suminfo.c:286
#define ListView_DeleteColumn(hwnd, iCol)
Definition: commctrl.h:2644
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
@ STRRET_WSTR
Definition: shtypes.idl:85
@ SHCOLSTATE_HIDDEN
Definition: shtypes.idl:129
@ SHCOLSTATE_SECONDARYUI
Definition: shtypes.idl:128
DWORD SHCOLSTATEF
Definition: shtypes.idl:142
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define TPM_RIGHTBUTTON
Definition: winuser.h:2383
BOOL WINAPI InsertMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define MF_CHECKED
Definition: winuser.h:132
#define MF_SEPARATOR
Definition: winuser.h:137
#define HTCLIENT
Definition: winuser.h:2478
#define TPM_LEFTBUTTON
Definition: winuser.h:2382
#define PostMessage
Definition: winuser.h:5844
#define WM_SETCURSOR
Definition: winuser.h:1639
#define VK_SHIFT
Definition: winuser.h:2205
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define TPM_RETURNCMD
Definition: winuser.h:2390
SHORT WINAPI GetKeyState(_In_ int)
#define MF_GRAYED
Definition: winuser.h:129
#define MF_DISABLED
Definition: winuser.h:130

Referenced by OnContextMenu().

◆ drag_notify_subitem()

HRESULT CDefView::drag_notify_subitem ( DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)

Definition at line 4140 of file CDefView.cpp.

4141{
4142 LONG lResult;
4143 HRESULT hr;
4144 RECT clientRect;
4145
4146 /* The key state on drop doesn't have MK_LBUTTON or MK_RBUTTON because it
4147 reflects the key state after the user released the button, so we need
4148 to remember the last key state when the button was pressed */
4149 m_grfKeyState = grfKeyState;
4150
4151 // Map from global to client coordinates and query the index of the
4152 // listview-item, which is currently under the mouse cursor.
4153 LVHITTESTINFO htinfo = {{pt.x, pt.y}, LVHT_ONITEM};
4154 ScreenToClient(&htinfo.pt);
4155 lResult = m_ListView.HitTest(&htinfo);
4156
4157 /* Send WM_*SCROLL messages every 250 ms during drag-scrolling */
4158 ::GetClientRect(m_ListView, &clientRect);
4159 if (htinfo.pt.x == m_ptLastMousePos.x && htinfo.pt.y == m_ptLastMousePos.y &&
4160 (htinfo.pt.x < SCROLLAREAWIDTH || htinfo.pt.x > clientRect.right - SCROLLAREAWIDTH ||
4161 htinfo.pt.y < SCROLLAREAWIDTH || htinfo.pt.y > clientRect.bottom - SCROLLAREAWIDTH))
4162 {
4163 m_cScrollDelay = (m_cScrollDelay + 1) % 5; // DragOver is called every 50 ms
4164 if (m_cScrollDelay == 0)
4165 {
4166 /* Mouse did hover another 250 ms over the scroll-area */
4167 if (htinfo.pt.x < SCROLLAREAWIDTH)
4168 m_ListView.SendMessageW(WM_HSCROLL, SB_LINEUP, 0);
4169
4170 if (htinfo.pt.x > clientRect.right - SCROLLAREAWIDTH)
4171 m_ListView.SendMessageW(WM_HSCROLL, SB_LINEDOWN, 0);
4172
4173 if (htinfo.pt.y < SCROLLAREAWIDTH)
4174 m_ListView.SendMessageW(WM_VSCROLL, SB_LINEUP, 0);
4175
4176 if (htinfo.pt.y > clientRect.bottom - SCROLLAREAWIDTH)
4177 m_ListView.SendMessageW(WM_VSCROLL, SB_LINEDOWN, 0);
4178 }
4179 }
4180 else
4181 {
4182 m_cScrollDelay = 0; // Reset, if cursor is not over the listview's scroll-area
4183 }
4184
4185 m_ptLastMousePos = htinfo.pt;
4187
4188 /* We need to check if we drag the selection over itself */
4189 if (lResult != -1 && m_pSourceDataObject.p != NULL)
4190 {
4191 PCUITEMID_CHILD pidl = _PidlByItem(lResult);
4192
4193 for (UINT i = 0; i < m_cidl; i++)
4194 {
4195 if (pidl == m_apidl[i])
4196 {
4197 /* The item that is being draged is hovering itself. */
4198 lResult = -1;
4199 break;
4200 }
4201 }
4202 }
4203
4204 // If we are still over the previous sub-item, notify it via DragOver and return
4205 if (m_pCurDropTarget && lResult == m_iDragOverItem)
4206 return m_pCurDropTarget->DragOver(grfKeyState, pt, pdwEffect);
4207
4208 // We've left the previous sub-item, notify it via DragLeave and release it
4209 if (m_pCurDropTarget)
4210 {
4212 if (pidl)
4213 SelectItem(pidl, 0);
4214
4215 m_pCurDropTarget->DragLeave();
4217 }
4218
4219 m_iDragOverItem = lResult;
4220
4221 if (lResult == -1)
4222 {
4223 // We are not above one of the listview's subitems. Bind to the
4224 // parent folder's DropTarget interface.
4226 }
4227 else
4228 {
4229 // Query the relative PIDL of the shellfolder object represented
4230 // by the currently dragged over listview-item ...
4231 PCUITEMID_CHILD pidl = _PidlByItem(lResult);
4232
4233 // ... and bind m_pCurDropTarget to the IDropTarget interface of an UIObject of this object
4234 hr = m_pSFParent->GetUIObjectOf(m_ListView, 1, &pidl, IID_NULL_PPV_ARG(IDropTarget, &m_pCurDropTarget));
4235 }
4236
4238
4239 // If anything failed, m_pCurDropTarget should be NULL now, which ought to be a save state
4240 if (FAILED(hr))
4241 {
4242 *pdwEffect = DROPEFFECT_NONE;
4243 return hr;
4244 }
4245
4246 if (m_iDragOverItem != -1)
4247 {
4248 SelectItem(m_iDragOverItem, SVSI_SELECT);
4249 }
4250
4251 // Notify the item just entered via DragEnter
4252 return m_pCurDropTarget->DragEnter(m_pCurDataObject, grfKeyState, pt, pdwEffect);
4253}
#define SCROLLAREAWIDTH
Definition: CDefView.cpp:4138
static void ClientToListView(HWND hwndLV, POINT *ppt)
Definition: CDefView.cpp:119
CComPtr< IDataObject > m_pCurDataObject
Definition: CDefView.cpp:259
STDMETHOD() SelectItem(PCUITEMID_CHILD pidlItem, SVSIF uFlags) override
Definition: CDefView.cpp:3361
CComPtr< IDataObject > m_pSourceDataObject
Definition: CDefView.cpp:257
CComPtr< IDropTarget > m_pCurDropTarget
Definition: CDefView.cpp:258
PCUITEMID_CHILD _PidlByItem(int i)
Definition: CDefView.cpp:1293
DWORD m_grfKeyState
Definition: CDefView.cpp:264
int HitTest(LV_HITTESTINFO *phtInfo)
Definition: rosctrls.h:199
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1411
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
long LONG
Definition: pedump.c:60
#define LVHT_ONITEM
Definition: commctrl.h:2502
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define SB_LINEUP
Definition: winuser.h:564
#define WM_HSCROLL
Definition: winuser.h:1746
#define WM_VSCROLL
Definition: winuser.h:1747
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SB_LINEDOWN
Definition: winuser.h:565
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define IID_NULL_PPV_ARG(Itype, ppType)

Referenced by DragEnter(), and DragOver().

◆ DragEnter()

HRESULT WINAPI CDefView::DragEnter ( IDataObject pDataObj,
DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)
override

Implements IDropTarget.

Definition at line 4255 of file CDefView.cpp.

4256{
4257 if (*pdwEffect == DROPEFFECT_NONE)
4258 return S_OK;
4259
4260 /* Get a hold on the data object for later calls to DragEnter on the sub-folders */
4261 m_pCurDataObject = pDataObject;
4262
4263 HRESULT hr = drag_notify_subitem(grfKeyState, pt, pdwEffect);
4264 if (SUCCEEDED(hr))
4265 {
4266 POINT ptClient = {pt.x, pt.y};
4267 ScreenToClient(&ptClient);
4268 ImageList_DragEnter(m_hWnd, ptClient.x, ptClient.y);
4269 }
4270
4271 return hr;
4272}
HRESULT drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CDefView.cpp:4140
BOOL WINAPI ImageList_DragEnter(HWND hwndLock, INT x, INT y)
Definition: imagelist.c:958

◆ DragLeave()

HRESULT WINAPI CDefView::DragLeave ( void  )
override

Implements IDropTarget.

Definition at line 4282 of file CDefView.cpp.

4283{
4285
4286 if (m_pCurDropTarget)
4287 {
4288 m_pCurDropTarget->DragLeave();
4290 }
4291
4292 if (m_pCurDataObject != NULL)
4293 {
4295 }
4296
4297 m_iDragOverItem = 0;
4298
4299 return S_OK;
4300}
BOOL WINAPI ImageList_DragLeave(HWND hwndLock)
Definition: imagelist.c:992

◆ DragOver()

HRESULT WINAPI CDefView::DragOver ( DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)
override

Implements IDropTarget.

Definition at line 4274 of file CDefView.cpp.

4275{
4276 POINT ptClient = {pt.x, pt.y};
4277 ScreenToClient(&ptClient);
4278 ImageList_DragMove(ptClient.x, ptClient.y);
4279 return drag_notify_subitem(grfKeyState, pt, pdwEffect);
4280}
BOOL WINAPI ImageList_DragMove(INT x, INT y)
Definition: imagelist.c:1070

◆ Draw()

HRESULT WINAPI CDefView::Draw ( DWORD  dwDrawAspect,
LONG  lindex,
void pvAspect,
DVTARGETDEVICE *  ptd,
HDC  hdcTargetDev,
HDC  hdcDraw,
LPCRECTL  lprcBounds,
LPCRECTL  lprcWBounds,
BOOL(STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR dwContinue)  ,
ULONG_PTR  dwContinue 
)
override

Definition at line 4557 of file CDefView.cpp.

4558{
4559 FIXME("Stub: this=%p\n", this);
4560 return E_NOTIMPL;
4561}

◆ Drop()

HRESULT WINAPI CDefView::Drop ( IDataObject pDataObj,
DWORD  grfKeyState,
POINTL  pt,
DWORD pdwEffect 
)
override

Implements IDropTarget.

Definition at line 4486 of file CDefView.cpp.

4487{
4490
4491 if ((IsDropOnSource(NULL) == S_OK) &&
4492 (*pdwEffect & DROPEFFECT_MOVE) &&
4494 {
4495 if (m_pCurDropTarget)
4496 {
4497 m_pCurDropTarget->DragLeave();
4499 }
4500
4501 POINT ptDrop = { pt.x, pt.y };
4502 ::ScreenToClient(m_ListView, &ptDrop);
4504 m_ptLastMousePos = ptDrop;
4505
4507 if (m_ListView.GetStyle() & LVS_AUTOARRANGE)
4508 {
4510 }
4511 else
4512 {
4513 POINT ptItem;
4514 INT iItem = -1;
4515 while ((iItem = m_ListView.GetNextItem(iItem, LVNI_SELECTED)) >= 0)
4516 {
4517 if (m_ListView.GetItemPosition(iItem, &ptItem))
4518 {
4521 m_ListView.SetItemPosition(iItem, &ptItem);
4522 }
4523 }
4524 }
4526 }
4527 else if (m_pCurDropTarget)
4528 {
4529 m_pCurDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect);
4531 }
4532
4534 m_iDragOverItem = 0;
4535 return S_OK;
4536}
POINT m_ptFirstMousePos
Definition: CDefView.cpp:263
STDMETHOD() IsDropOnSource(IDropTarget *drop_target) override
Definition: CDefView.cpp:3944
void _MoveSelectionOnAutoArrange(POINT pt)
Definition: CDefView.cpp:4426
void SetRedraw(BOOL redraw)
Definition: rosctrls.h:27
BOOL SetItemPosition(int nItem, POINT *pPoint)
Definition: rosctrls.h:236
BOOL GetItemPosition(int nItem, POINT *pPoint)
Definition: rosctrls.h:231
VOID WINAPI ImageList_EndDrag(void)
Definition: imagelist.c:1847
const DWORD DROPEFFECT_MOVE
Definition: oleidl.idl:931
#define MK_LBUTTON
Definition: winuser.h:2370

◆ EnableModeless()

HRESULT WINAPI CDefView::EnableModeless ( BOOL  fEnable)
override

Implements IShellView.

Definition at line 3057 of file CDefView.cpp.

3058{
3059 FIXME("(%p)\n", this);
3060 return E_NOTIMPL;
3061}

◆ Exec()

HRESULT WINAPI CDefView::Exec ( const GUID pguidCmdGroup,
DWORD  nCmdID,
DWORD  nCmdexecopt,
VARIANT pvaIn,
VARIANT pvaOut 
)
override

Implements IOleCommandTarget.

Definition at line 4057 of file CDefView.cpp.

4058{
4059 FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08x Opt:0x%08x %p %p)\n",
4060 this, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, pvaIn, pvaOut);
4061
4062 if (!pguidCmdGroup)
4063 return OLECMDERR_E_UNKNOWNGROUP;
4064
4065 if (IsEqualCLSID(*pguidCmdGroup, m_Category))
4066 {
4067 if (nCmdID == FCIDM_SHVIEW_AUTOARRANGE)
4068 {
4069 if (V_VT(pvaIn) != VT_INT_PTR)
4070 return OLECMDERR_E_NOTSUPPORTED;
4071
4073 params.cbSize = sizeof(params);
4074 params.rcExclude = *(RECT*) V_INTREF(pvaIn);
4075
4076 if (m_hMenuViewModes)
4077 {
4078 // Duplicate all but the last two items of the view modes menu
4079 HMENU hmenuViewPopup = CreatePopupMenu();
4080 Shell_MergeMenus(hmenuViewPopup, m_hMenuViewModes, 0, 0, 0xFFFF, 0);
4081 DeleteMenu(hmenuViewPopup, GetMenuItemCount(hmenuViewPopup) - 1, MF_BYPOSITION);
4082 DeleteMenu(hmenuViewPopup, GetMenuItemCount(hmenuViewPopup) - 1, MF_BYPOSITION);
4083 CheckViewMode(hmenuViewPopup);
4084 TrackPopupMenuEx(hmenuViewPopup, TPM_LEFTALIGN | TPM_TOPALIGN, params.rcExclude.left, params.rcExclude.bottom, m_hWndParent, &params);
4085 ::DestroyMenu(hmenuViewPopup);
4086 }
4087
4088 // pvaOut is VT_I4 with value 0x403 (cmd id of the new mode maybe?)
4089 V_VT(pvaOut) = VT_I4;
4090 V_I4(pvaOut) = 0x403;
4091 }
4092 }
4093
4094 if (IsEqualIID(*pguidCmdGroup, CGID_Explorer) &&
4095 (nCmdID == 0x29) &&
4096 (nCmdexecopt == 4) && pvaOut)
4097 return S_OK;
4098
4099 if (IsEqualIID(*pguidCmdGroup, CGID_ShellDocView) &&
4100 (nCmdID == 9) &&
4101 (nCmdexecopt == 0))
4102 return 1;
4103
4104 if (IsEqualIID(*pguidCmdGroup, CGID_DefView))
4105 {
4106 CComPtr<IStream> pStream;
4107 WCHAR SubKey[MAX_PATH];
4108 switch (nCmdID)
4109 {
4111 SHDeleteKey(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\ShellNoRoam\\Bags");
4113 SaveViewState(pStream);
4114 break;
4116 wsprintfW(SubKey, L"%s\\%s", REGSTR_PATH_EXPLORER, L"Streams\\Default");
4118 SHDeleteKey(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\ShellNoRoam\\Bags");
4119 m_FolderSettings.fFlags |= FWF_NOBROWSERVIEWSTATE; // Don't let this folder save itself
4120 break;
4121 }
4122 }
4123
4124 return OLECMDERR_E_UNKNOWNGROUP;
4125}
STDMETHOD() SaveViewState() override
Definition: CDefView.cpp:3346
HRESULT CheckViewMode(HMENU hmenuView)
Definition: CDefView.cpp:1914
HRESULT GetDefaultViewStream(DWORD Stgm, IStream **ppStream)
Definition: CDefView.cpp:3187
@ VT_I4
Definition: compat.h:2298
@ VT_INT_PTR
Definition: compat.h:2327
GLenum const GLfloat * params
Definition: glext.h:5645
#define STGM_WRITE
Definition: objbase.h:918
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247
#define V_INTREF(A)
Definition: oleauto.h:252
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
#define REGSTR_PATH_EXPLORER
Definition: regstr.h:33
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define DVCMDID_SET_DEFAULTFOLDER_SETTINGS
Definition: shlobj_undoc.h:89
#define DVCMDID_RESET_DEFAULTFOLDER_SETTINGS
Definition: shlobj_undoc.h:90
#define SHDeleteKey
Definition: shlwapi.h:44
@ FWF_NOBROWSERVIEWSTATE
Definition: shobjidl.idl:670
#define FCIDM_SHVIEW_AUTOARRANGE
Definition: shresdef.h:846
#define HKEY_CURRENT_USER
Definition: winreg.h:11
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
#define TPM_TOPALIGN
Definition: winuser.h:2386
#define TPM_LEFTALIGN
Definition: winuser.h:2380

◆ fill_list()

INT CALLBACK CDefView::fill_list ( LPVOID  ptr,
LPVOID  arg 
)
static

Definition at line 1466 of file CDefView.cpp.

1467{
1468 PITEMID_CHILD pidl = static_cast<PITEMID_CHILD>(ptr);
1469 CDefView *pThis = static_cast<CDefView *>(arg);
1470
1471 // in a commdlg this works as a filemask
1472 if (pThis->IncludeObject(pidl) == S_OK && pThis->m_ListView)
1473 pThis->LV_AddItem(pidl);
1474
1475 SHFree(pidl);
1476 return TRUE;
1477}
HRESULT IncludeObject(PCUITEMID_CHILD pidl)
Definition: CDefView.cpp:637
static PVOID ptr
Definition: dispmode.c:27
void * arg
Definition: msvc.h:10

Referenced by FillList().

◆ FillArrangeAsMenu()

HRESULT CDefView::FillArrangeAsMenu ( HMENU  hmenuArrange)

Definition at line 1858 of file CDefView.cpp.

1859{
1860 bool forceMerge = false;
1862
1863 // Make sure the column we currently sort by is in the menu
1866 {
1870 LVCOLUMN lvc;
1871 lvc.mask = LVCF_TEXT;
1872 lvc.pszText = buf;
1873 lvc.cchTextMax = _countof(buf);
1874 currentSortId = DVIDM_ARRANGESORT_LAST;
1875 forceMerge = true;
1877 AppendMenuItem(m_hMenuArrangeModes, MF_STRING, currentSortId, lvc.pszText, m_sortInfo.ListColumn);
1878 }
1879
1880 // Prepend the sort-by items unless they are aleady there
1881 if (GetMenuItemID(hmenuArrange, 0) == FCIDM_SHVIEW_AUTOARRANGE || forceMerge)
1882 {
1883 Shell_MergeMenus(hmenuArrange, m_hMenuArrangeModes, 0, 0, 0xFFFF, MM_ADDSEPARATOR);
1884 }
1885
1886 CheckMenuRadioItem(hmenuArrange,
1888 currentSortId, MF_BYCOMMAND);
1889
1891 {
1894 }
1895 else
1896 {
1899
1900 if (GetAutoArrange() == S_OK)
1902 else
1904
1905 if (_GetSnapToGrid() == S_OK)
1907 else
1909 }
1910
1911 return S_OK;
1912}
@ DEFVIEW_ARRANGESORT_MAX
Definition: CDefView.cpp:48
STDMETHOD() GetAutoArrange() override
Definition: CDefView.cpp:3630
HRESULT _GetSnapToGrid()
Definition: CDefView.cpp:3635
#define C_ASSERT(e)
Definition: intsafe.h:73
#define MM_ADDSEPARATOR
Definition: shlobj.h:2528
#define FCIDM_SHVIEW_ALIGNTOGRID
Definition: shresdef.h:848
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)

Referenced by OnInitMenuPopup().

◆ FillEditMenu()

HRESULT CDefView::FillEditMenu ( )

Definition at line 1825 of file CDefView.cpp.

1826{
1828 if (!hEditMenu)
1829 return E_FAIL;
1830
1831 HMENU hmenuContents = ::LoadMenuW(shell32_hInstance, L"MENU_003");
1832 if (!hmenuContents)
1833 return E_FAIL;
1834
1835 Shell_MergeMenus(hEditMenu, hmenuContents, 0, 0, 0xFFFF, 0);
1836
1837 ::DestroyMenu(hmenuContents);
1838
1839 return S_OK;
1840}
#define FCIDM_MENU_EDIT
Definition: shlobj.h:631
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)

Referenced by DoActivate().

◆ FillFileMenu()

HRESULT CDefView::FillFileMenu ( )

Definition at line 1783 of file CDefView.cpp.

1784{
1786 if (!hFileMenu)
1787 return E_FAIL;
1788
1789 /* Cleanup the items added previously */
1790 for (int i = GetMenuItemCount(hFileMenu) - 1; i >= 0; i--)
1791 {
1792 UINT id = GetMenuItemID(hFileMenu, i);
1793 if (id < FCIDM_BROWSERFIRST || id > FCIDM_BROWSERLAST)
1794 DeleteMenu(hFileMenu, i, MF_BYPOSITION);
1795 }
1796
1797 // In case we still have this left over, clean it up
1798 if (m_pFileMenu)
1799 {
1802 }
1803 UINT selcount = m_ListView.GetSelectedCount();
1804 // Store context menu in m_pFileMenu and keep it to invoke the selected command later on
1807 return hr;
1808
1810
1811 UINT cmf = GetContextMenuFlags(m_pShellBrowser, SFGAO_CANRENAME);
1812 hr = m_pFileMenu->QueryContextMenu(hmenu, 0, DVIDM_CONTEXTMENU_FIRST, DVIDM_CONTEXTMENU_LAST, cmf);
1814 return hr;
1815
1816 // TODO: filter or something
1817
1818 Shell_MergeMenus(hFileMenu, hmenu, 0, 0, 0xFFFF, MM_ADDSEPARATOR | MM_SUBMENUSHAVEIDS);
1819
1821
1822 return S_OK;
1823}
static UINT GetContextMenuFlags(IShellBrowser *pSB, SFGAOF sfgao)
Definition: CDefView.cpp:104
@ DVIDM_CONTEXTMENU_LAST
Definition: CDefView.cpp:53
@ DVIDM_CONTEXTMENU_FIRST
Definition: CDefView.cpp:57
STDMETHOD() GetItemObject(UINT uItem, REFIID riid, void **ppv) override
Definition: CDefView.cpp:3417
CComPtr< IContextMenu > m_pFileMenu
Definition: CDefView.cpp:267
UINT GetSelectedCount()
Definition: rosctrls.h:136
@ SVGIO_SELECTION
Definition: shobjidl.idl:744
@ SVGIO_BACKGROUND
Definition: shobjidl.idl:743
#define FCIDM_BROWSERLAST
Definition: shlobj.h:623
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2529
#define FCIDM_MENU_FILE
Definition: shlobj.h:630
static HMENU hmenu
Definition: win.c:66

Referenced by OnInitMenuPopup().

◆ FillList()

HRESULT CDefView::FillList ( BOOL  IsRefreshCommand = TRUE)

Definition at line 1483 of file CDefView.cpp.

1484{
1485 CComPtr<IEnumIDList> pEnumIDList;
1486 PITEMID_CHILD pidl;
1487 DWORD dwFetched;
1488 HRESULT hRes;
1489 HDPA hdpa;
1490 DWORD dFlags = SHCONTF_NONFOLDERS | ((m_FolderSettings.fFlags & FWF_NOSUBFOLDERS) ? 0 : SHCONTF_FOLDERS);
1491
1492 TRACE("%p\n", this);
1493
1494 SHELLSTATE shellstate;
1496 if (GetCommDlgViewFlags() & CDB2GVF_SHOWALLFILES)
1497 shellstate.fShowAllObjects = shellstate.fShowSuperHidden = TRUE;
1498
1499 if (shellstate.fShowAllObjects)
1500 {
1501 dFlags |= SHCONTF_INCLUDEHIDDEN;
1502 m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
1503 }
1504 if (shellstate.fShowSuperHidden)
1505 {
1506 dFlags |= SHCONTF_INCLUDESUPERHIDDEN;
1507 m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
1508 }
1509
1510 // get the itemlist from the shfolder
1511 hRes = m_pSFParent->EnumObjects(m_hWnd, dFlags, &pEnumIDList);
1512 if (hRes != S_OK)
1513 {
1514 if (hRes == S_FALSE)
1515 return(NOERROR);
1516 return(hRes);
1517 }
1518
1519 // create a pointer array
1520 hdpa = DPA_Create(16);
1521 if (!hdpa)
1522 return(E_OUTOFMEMORY);
1523
1524 // copy the items into the array
1525 while((S_OK == pEnumIDList->Next(1, &pidl, &dwFetched)) && dwFetched)
1526 {
1527 if (DPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
1528 {
1529 SHFree(pidl);
1530 }
1531 }
1532
1533 // turn listview's redrawing off
1535
1536 DPA_DestroyCallback( hdpa, fill_list, this);
1537
1538 /* sort the array */
1539 int sortCol = -1;
1540 if (!IsRefreshCommand && !m_sortInfo.bLoadedFromViewState) // Are we loading for the first time?
1541 {
1543 sortCol = 0; // In case the folder does not know/care
1544 if (m_pSF2Parent)
1545 {
1546 ULONG folderSortCol = sortCol, dummy;
1547 HRESULT hr = m_pSF2Parent->GetDefaultColumn(NULL, &folderSortCol, &dummy);
1548 if (SUCCEEDED(hr))
1549 hr = MapFolderColumnToListColumn(folderSortCol);
1550 if (SUCCEEDED(hr))
1551 sortCol = (int) hr;
1552 }
1553 }
1554 _Sort(sortCol);
1555
1557 {
1560 }
1561
1562 // load custom background image and custom text color
1565
1566 // turn listview's redrawing back on and force it to draw
1568
1570
1572 {
1573 // redraw now
1574 m_ListView.InvalidateRect(NULL, TRUE);
1575 }
1576
1578
1579 return S_OK;
1580}
#define SFVM_GET_CUSTOMVIEWINFO
#define SFVM_LISTREFRESHED
DWORD GetCommDlgViewFlags()
Definition: CDefView.cpp:341
static INT CALLBACK fill_list(LPVOID ptr, LPVOID arg)
Definition: CDefView.cpp:1466
void UpdateListColors()
Definition: CDefView.cpp:899
BOOL _Sort(int Col=-1)
Definition: CDefView.cpp:1241
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:1003
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:591
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define LVM_SETCALLBACKMASK
Definition: commctrl.h:2424
#define LVIS_CUT
Definition: commctrl.h:2325
VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
Definition: shellord.c:225
#define SSF_SHOWSUPERHIDDEN
Definition: shlobj.h:1621
#define SSF_SHOWALLOBJECTS
Definition: shlobj.h:1605
@ FWF_NOSUBFOLDERS
Definition: shobjidl.idl:649
BOOL fShowSuperHidden
Definition: shlobj.h:1557
BOOL fShowAllObjects
Definition: shlobj.h:1541
uint32_t ULONG
Definition: typedefs.h:59
#define NOERROR
Definition: winerror.h:2354

Referenced by OnCreate(), and Refresh().

◆ FillViewMenu()

HRESULT CDefView::FillViewMenu ( )

Definition at line 1842 of file CDefView.cpp.

1843{
1845 if (!hViewMenu)
1846 return E_FAIL;
1847
1849 if (!m_hMenuViewModes)
1850 return E_FAIL;
1851
1854
1855 return S_OK;
1856}
DWORD WINAPI SHMenuIndexFromID(HMENU hMenu, UINT uID)
Definition: ordinal.c:4520
#define FCIDM_MENU_VIEW_SEP_OPTIONS
Definition: shlobj.h:633
#define MM_DONTREMOVESEPS
Definition: shlobj.h:2530

Referenced by DoActivate().

◆ Freeze()

HRESULT WINAPI CDefView::Freeze ( DWORD  dwDrawAspect,
LONG  lindex,
void pvAspect,
DWORD pdwFreeze 
)
override

Implements IViewObject.

Definition at line 4569 of file CDefView.cpp.

4570{
4571 FIXME("Stub: this=%p\n", this);
4572 return E_NOTIMPL;
4573}

◆ GetAdvise()

HRESULT WINAPI CDefView::GetAdvise ( DWORD pAspects,
DWORD pAdvf,
IAdviseSink **  ppAdvSink 
)
override

Implements IViewObject.

Definition at line 4593 of file CDefView.cpp.

4594{
4595 TRACE("this=%p pAspects=%p pAdvf=%p ppAdvSink=%p\n", this, pAspects, pAdvf, ppAdvSink);
4596
4597 if (ppAdvSink)
4598 {
4599 *ppAdvSink = m_pAdvSink;
4600 m_pAdvSink.p->AddRef();
4601 }
4602
4603 if (pAspects)
4604 *pAspects = m_dwAspects;
4605
4606 if (pAdvf)
4607 *pAdvf = m_dwAdvf;
4608
4609 return S_OK;
4610}
CComPtr< IAdviseSink > m_pAdvSink
Definition: CDefView.cpp:255
ULONG AddRef()

◆ GetArrangeParam()

HRESULT STDMETHODCALLTYPE CDefView::GetArrangeParam ( LPARAM sort)
override

Definition at line 3823 of file CDefView.cpp.

3824{
3825 FIXME("(%p)->(%p) stub\n", this, sort);
3826 return E_NOTIMPL;
3827}
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
Definition: _algo.c:993

◆ GetAutoArrange()

HRESULT STDMETHODCALLTYPE CDefView::GetAutoArrange ( )
override

Implements IFolderView.

Definition at line 3630 of file CDefView.cpp.

3631{
3632 return ((m_ListView.GetStyle() & LVS_AUTOARRANGE) ? S_OK : S_FALSE);
3633}

Referenced by FillArrangeAsMenu(), OnCommand(), SaveViewState(), and UpdateFolderViewFlags().

◆ GetColorSet()

HRESULT WINAPI CDefView::GetColorSet ( DWORD  dwDrawAspect,
LONG  lindex,
void pvAspect,
DVTARGETDEVICE *  ptd,
HDC  hicTargetDev,
LOGPALETTE **  ppColorSet 
)
override

Implements IViewObject.

Definition at line 4563 of file CDefView.cpp.

4564{
4565 FIXME("Stub: this=%p\n", this);
4566 return E_NOTIMPL;
4567}

◆ GetCommDlgViewFlags()

DWORD CDefView::GetCommDlgViewFlags ( )
inline

Definition at line 341 of file CDefView.cpp.

342 {
345 {
346 DWORD flags;
347 if (SUCCEEDED(pcdb2->GetViewFlags(&flags)))
348 return flags;
349 }
350 return 0;
351 }

Referenced by FillList(), IncludeObject(), and OnContextMenu().

◆ GetCurrentInfo()

HRESULT WINAPI CDefView::GetCurrentInfo ( LPFOLDERSETTINGS  pfs)
override

Implements IShellView.

Definition at line 3152 of file CDefView.cpp.

3153{
3154 TRACE("(%p)->(%p) vmode=%x flags=%x\n", this, lpfs,
3156
3157 if (!lpfs)
3158 return E_INVALIDARG;
3159
3160 *lpfs = m_FolderSettings;
3161 return S_OK;
3162}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ GetCurrentViewMode()

HRESULT STDMETHODCALLTYPE CDefView::GetCurrentViewMode ( UINT pViewMode)
override

Implements IFolderView.

Definition at line 3476 of file CDefView.cpp.

3477{
3478 TRACE("(%p)->(%p), stub\n", this, pViewMode);
3479
3480 if (!pViewMode)
3481 return E_INVALIDARG;
3482
3483 *pViewMode = m_FolderSettings.ViewMode;
3484 return S_OK;
3485}

Referenced by SaveViewState().

◆ GetDefaultSpacing()

HRESULT STDMETHODCALLTYPE CDefView::GetDefaultSpacing ( POINT ppt)
override

Implements IFolderView.

Definition at line 3625 of file CDefView.cpp.

3626{
3627 return E_NOTIMPL;
3628}

◆ GetDefaultViewMode()

FOLDERVIEWMODE CDefView::GetDefaultViewMode ( )

Definition at line 3467 of file CDefView.cpp.

3468{
3472 mode = temp;
3473 return mode;
3474}
BOOL WINAPI IsOS(DWORD feature)
Definition: ordinal.c:4107
static calc_node_t temp
Definition: rpn_ieee.c:38
#define OS_SERVERADMINUI
Definition: shlwapi.h:2050

Referenced by CreateViewWindow3().

◆ GetDefaultViewStream()

HRESULT CDefView::GetDefaultViewStream ( DWORD  Stgm,
IStream **  ppStream 
)

Definition at line 3187 of file CDefView.cpp.

3188{
3189 CLSID clsid;
3191 if (SUCCEEDED(hr))
3192 {
3193 WCHAR path[MAX_PATH], name[39];
3194 wsprintfW(path, L"%s\\%s", REGSTR_PATH_EXPLORER, L"Streams\\Default");
3196 *ppStream = SHOpenRegStream2W(HKEY_CURRENT_USER, path, name, Stgm);
3197 hr = *ppStream ? S_OK : E_FAIL;
3198 }
3199 return hr;
3200}
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
HRESULT WINAPI IUnknown_GetClassID(IUnknown *lpUnknown, CLSID *clsid)
Definition: ordinal.c:1457
REFCLSID clsid
Definition: msctf.c:82
IStream *WINAPI SHOpenRegStream2W(HKEY hKey, LPCWSTR pszSubkey, LPCWSTR pszValue, DWORD dwMode)
Definition: regstream.c:537
Definition: name.c:39

Referenced by Exec(), and LoadViewState().

◆ GetDetailsByFolderColumn()

HRESULT CDefView::GetDetailsByFolderColumn ( PCUITEMID_CHILD  pidl,
UINT  FoldCol,
SHELLDETAILS sd 
)

Definition at line 1029 of file CDefView.cpp.

1030{
1031 // According to learn.microsoft.com/en-us/windows/win32/shell/sfvm-getdetailsof
1032 // the query order is IShellFolder2, IShellDetails, SFVM_GETDETAILSOF.
1033 HRESULT hr;
1034 if (m_pSF2Parent)
1035 {
1036 hr = m_pSF2Parent->GetDetailsOf(pidl, FoldCol, &sd);
1037 }
1038 if (FAILED(hr) && m_pSDParent)
1039 {
1040 hr = m_pSDParent->GetDetailsOf(pidl, FoldCol, &sd);
1041 }
1042#if 0 // TODO
1043 if (FAILED(hr))
1044 {
1045 FIXME("Try SFVM_GETDETAILSOF\n");
1046 }
1047#endif
1048 return hr;
1049}
CComPtr< IShellDetails > m_pSDParent
Definition: CDefView.cpp:230

Referenced by DoColumnContextMenu(), GetDetailsByListColumn(), and LoadColumn().

◆ GetDetailsByListColumn()

HRESULT CDefView::GetDetailsByListColumn ( PCUITEMID_CHILD  pidl,
UINT  ListCol,
SHELLDETAILS sd 
)

Definition at line 1051 of file CDefView.cpp.

1052{
1054 if (SUCCEEDED(hr))
1055 return GetDetailsByFolderColumn(pidl, hr, sd);
1056 ERR("Unable to determine folder column from list column %d\n", (int) ListCol);
1057 return hr;
1058}

Referenced by OnNotify().

◆ GetDragPoint()

HRESULT STDMETHODCALLTYPE CDefView::GetDragPoint ( POINT pt)
override

Definition at line 3955 of file CDefView.cpp.

3956{
3957 if (!pt)
3958 return E_INVALIDARG;
3959
3961 return S_OK;
3962}

◆ GetDropPoint()

HRESULT STDMETHODCALLTYPE CDefView::GetDropPoint ( POINT pt)
override

Definition at line 3964 of file CDefView.cpp.

3965{
3966 FIXME("(%p)->(%p) stub\n", this, pt);
3967 return E_NOTIMPL;
3968}

◆ GetFocusedItem()

HRESULT STDMETHODCALLTYPE CDefView::GetFocusedItem ( int piItem)
override

Implements IFolderView.

Definition at line 3578 of file CDefView.cpp.

3579{
3580 TRACE("(%p)->(%p)\n", this, piItem);
3581
3582 *piItem = m_ListView.GetNextItem(-1, LVNI_FOCUSED);
3583
3584 return S_OK;
3585}
#define LVNI_FOCUSED
Definition: commctrl.h:2428

◆ GetFolder()

HRESULT STDMETHODCALLTYPE CDefView::GetFolder ( REFIID  riid,
void **  ppv 
)
override

Implements IFolderView.

Definition at line 3531 of file CDefView.cpp.

3532{
3533 if (m_pSFParent == NULL)
3534 return E_FAIL;
3535
3536 return m_pSFParent->QueryInterface(riid, ppv);
3537}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ GetItemObject()

HRESULT WINAPI CDefView::GetItemObject ( UINT  uItem,
REFIID  riid,
void **  ppv 
)
override

Implements IShellView.

Definition at line 3417 of file CDefView.cpp.

3418{
3420
3421 TRACE("(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n", this, uItem, debugstr_guid(&riid), ppvOut);
3422
3423 if (!ppvOut)
3424 return E_INVALIDARG;
3425
3426 *ppvOut = NULL;
3427
3428 switch (uItem)
3429 {
3430 case SVGIO_BACKGROUND:
3431 if (IsEqualIID(riid, IID_IContextMenu))
3432 {
3435 return hr;
3436
3437 IUnknown_SetSite(*((IUnknown**)ppvOut), (IShellView *)this);
3438 }
3439 else if (IsEqualIID(riid, IID_IDispatch))
3440 {
3442 {
3445 return hr;
3446 }
3447 hr = m_pShellFolderViewDual->QueryInterface(riid, ppvOut);
3448 }
3449 break;
3450 case SVGIO_SELECTION:
3451 GetSelections();
3452 hr = m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl, m_apidl, riid, 0, ppvOut);
3454 return hr;
3455
3456 if (IsEqualIID(riid, IID_IContextMenu))
3457 IUnknown_SetSite(*((IUnknown**)ppvOut), (IShellView *)this);
3458
3459 break;
3460 }
3461
3462 TRACE("-- (%p)->(interface=%p)\n", this, *ppvOut);
3463
3464 return hr;
3465}
HRESULT CDefViewBckgrndMenu_CreateInstance(IShellFolder *psf, REFIID riid, void **ppv)
HRESULT WINAPI CDefViewDual_Constructor(REFIID riid, LPVOID *ppvOut)
CComPtr< IShellFolderViewDual > m_pShellFolderViewDual
Definition: CDefView.cpp:235
const GUID IID_IDispatch
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by FillFileMenu(), OnContextMenu(), OnExplorerCommand(), and OpenSelectedItems().

◆ GetItemPosition()