ReactOS 0.4.16-dev-336-gb667d82
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 220 of file CDefView.cpp.

Constructor & Destructor Documentation

◆ CDefView()

CDefView::CDefView ( )

Definition at line 573 of file CDefView.cpp.

573 :
574 m_ListView(),
576 m_hMenu(NULL),
581 m_uState(0),
582 m_cidl(0),
583 m_apidl(NULL),
586 m_hNotify(0),
587 m_hAccel(NULL),
588 m_dwAspects(0),
589 m_dwAdvf(0),
596{
603
607}
#define shell32_hInstance
HMENU m_hMenu
Definition: CDefView.cpp:244
HDPA m_LoadColumnsList
Definition: CDefView.cpp:253
bool m_ScheduledStatusbarUpdate
Definition: CDefView.cpp:276
HMENU m_hMenuArrangeModes
Definition: CDefView.cpp:245
HWND m_hWndParent
Definition: CDefView.cpp:242
DWORD m_dwAdvf
Definition: CDefView.cpp:259
DWORD m_dwAspects
Definition: CDefView.cpp:258
BOOL m_isParentFolderSpecial
Definition: CDefView.cpp:275
UINT m_cScrollDelay
Definition: CDefView.cpp:266
LISTVIEW_SORT_INFO m_sortInfo
Definition: CDefView.cpp:255
PIDLIST_ABSOLUTE m_pidlParent
Definition: CDefView.cpp:252
HMENU m_hContextMenu
Definition: CDefView.cpp:247
BOOL m_Destroyed
Definition: CDefView.cpp:279
PCUITEMID_CHILD * m_apidl
Definition: CDefView.cpp:251
HDPA m_ListToFolderColMap
Definition: CDefView.cpp:254
CLSID m_Category
Definition: CDefView.cpp:278
HICON m_hMyComputerIcon
Definition: CDefView.cpp:282
BOOL m_bmenuBarInitialized
Definition: CDefView.cpp:248
UINT m_cidl
Definition: CDefView.cpp:250
UINT m_uState
Definition: CDefView.cpp:249
BOOL m_isEditing
Definition: CDefView.cpp:274
POINT m_ptLastMousePos
Definition: CDefView.cpp:267
ULONG m_hNotify
Definition: CDefView.cpp:256
LONG m_iDragOverItem
Definition: CDefView.cpp:265
HMENU m_hMenuViewModes
Definition: CDefView.cpp:246
HACCEL m_hAccel
Definition: CDefView.cpp:257
FOLDERSETTINGS m_FolderSettings
Definition: CDefView.cpp:243
CListView m_ListView
Definition: CDefView.cpp:241
SFVM_CUSTOMVIEWINFO_DATA m_viewinfo_data
Definition: CDefView.cpp:280
#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:647
#define ZeroMemory
Definition: winbase.h:1737
#define CLR_INVALID
Definition: wingdi.h:883
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127

◆ ~CDefView()

CDefView::~CDefView ( )

Definition at line 609 of file CDefView.cpp.

610{
611 TRACE(" destroying IShellView(%p)\n", this);
612
614
616 {
619 }
620
621 if (m_hWnd)
622 {
624 }
625
629}
#define SFVM_VIEWRELEASE
HWND m_hWnd
Definition: atlwin.h:273
STDMETHOD() DestroyViewWindow() override
Definition: CDefView.cpp:3101
HRESULT _DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CDefView.cpp:4646
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 2385 of file CDefView.cpp.

2386{
2387 if (!GetSelections())
2388 return;
2389
2390 SFGAOF rfg = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_FILESYSTEM;
2391 HRESULT hr = m_pSFParent->GetAttributesOf(m_cidl, m_apidl, &rfg);
2393 return;
2394
2395 if (!bCopy && !(rfg & SFGAO_CANMOVE))
2396 return;
2397 if (bCopy && !(rfg & SFGAO_CANCOPY))
2398 return;
2399
2401 hr = m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl, m_apidl, IID_IContextMenu, 0, (void **)&pCM);
2403 return;
2404
2405 InvokeContextMenuCommand(pCM, (bCopy ? "copyto" : "moveto"), NULL);
2406}
CComPtr< IShellFolder > m_pSFParent
Definition: CDefView.cpp:233
HRESULT InvokeContextMenuCommand(CComPtr< IContextMenu > &pCM, LPCSTR lpVerb, POINT *pt=NULL)
Definition: CDefView.cpp:2064
UINT GetSelections()
Definition: CDefView.cpp:2031
#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 4646 of file CDefView.cpp.

4647{
4649
4651 {
4652 hr = m_pShellFolderViewCB->MessageSFVCB(uMsg, wParam, lParam);
4653 }
4654
4655 return hr;
4656}
CComPtr< IShellFolderViewCB > m_pShellFolderViewCB
Definition: CDefView.cpp:236
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 4299 of file CDefView.cpp.

4300{
4301 RECT rcBound;
4302 INT i, nCount = m_ListView.GetItemCount();
4303 DWORD dwSpacing;
4304 INT dx, dy;
4305 BOOL bSmall = ((m_ListView.GetStyle() & LVS_TYPEMASK) != LVS_ICON);
4306
4307 // FIXME: LVM_GETORIGIN is broken. See CORE-17266
4308 pt.x += m_ListView.GetScrollPos(SB_HORZ);
4309 pt.y += m_ListView.GetScrollPos(SB_VERT);
4310
4311 if (m_ListView.GetStyle() & LVS_ALIGNLEFT)
4312 {
4313 // vertically
4314 for (i = 0; i < nCount; ++i)
4315 {
4316 dwSpacing = ListView_GetItemSpacing(m_ListView, bSmall);
4317 dx = LOWORD(dwSpacing);
4318 dy = HIWORD(dwSpacing);
4320 rcBound.right = rcBound.left + dx;
4321 rcBound.bottom = rcBound.top + dy;
4322 if (pt.x < rcBound.right && pt.y < (rcBound.top + rcBound.bottom) / 2)
4323 {
4324 return i;
4325 }
4326 }
4327 for (i = nCount - 1; i >= 0; --i)
4328 {
4330 if (rcBound.left < pt.x && rcBound.top < pt.y)
4331 {
4332 return i + 1;
4333 }
4334 }
4335 }
4336 else
4337 {
4338 // horizontally
4339 for (i = 0; i < nCount; ++i)
4340 {
4341 dwSpacing = ListView_GetItemSpacing(m_ListView, bSmall);
4342 dx = LOWORD(dwSpacing);
4343 dy = HIWORD(dwSpacing);
4345 rcBound.right = rcBound.left + dx;
4346 rcBound.bottom = rcBound.top + dy;
4347 if (pt.y < rcBound.bottom && pt.x < rcBound.left)
4348 {
4349 return i;
4350 }
4351 if (pt.y < rcBound.bottom && pt.x < rcBound.right)
4352 {
4353 return i + 1;
4354 }
4355 }
4356 for (i = nCount - 1; i >= 0; --i)
4357 {
4359 if (rcBound.left < pt.x && rcBound.top < pt.y)
4360 {
4361 return i + 1;
4362 }
4363 }
4364 }
4365
4366 return nCount;
4367}
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 4395 of file CDefView.cpp.

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

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

◆ _GetSnapToGrid()

HRESULT CDefView::_GetSnapToGrid ( )
private

Definition at line 3632 of file CDefView.cpp.

3633{
3634 DWORD dwExStyle = (DWORD)m_ListView.SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
3635 return ((dwExStyle & LVS_EX_SNAPTOGRID) ? S_OK : S_FALSE);
3636}
#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 4369 of file CDefView.cpp.

4370{
4371 LRESULT lResult;
4372
4374 {
4375 int nPartArray[] = {-1};
4376 m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, _countof(nPartArray), (LPARAM)nPartArray, &lResult);
4377 return;
4378 }
4379
4380 int nFileSizePartLength = 125;
4381 const int nLocationPartLength = 150;
4382 const int nRightPartsLength = nFileSizePartLength + nLocationPartLength;
4383 int nObjectsPartLength = nWidth - nRightPartsLength;
4384
4385 // If the window is small enough just divide each part into thirds
4386 // to match the behavior of Windows Server 2003
4387 if (nObjectsPartLength <= nLocationPartLength)
4388 nObjectsPartLength = nFileSizePartLength = nWidth / 3;
4389
4390 int nPartArray[] = {nObjectsPartLength, nObjectsPartLength + nFileSizePartLength, -1};
4391
4392 m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, _countof(nPartArray), (LPARAM)nPartArray, &lResult);
4393}
#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 4619 of file CDefView.cpp.

4620{
4622 HRESULT hr = S_OK;
4623
4624 hr = IUnknown_QueryService(m_pShellBrowser, IID_IExplorerToolbar, IID_PPV_ARG(IExplorerToolbar, &ptb));
4625 if (FAILED(hr))
4626 return hr;
4627
4628 m_Category = CGID_DefViewFrame;
4629
4630 hr = ptb->SetCommandTarget(static_cast<IOleCommandTarget*>(this), &m_Category, 0);
4631 if (FAILED(hr))
4632 return hr;
4633
4634 if (hr == S_FALSE)
4635 return S_OK;
4636
4637#if 0
4638 hr = ptb->AddButtons(&m_Category, buttonsCount, buttons);
4639 if (FAILED(hr))
4640 return hr;
4641#endif
4642
4643 return S_OK;
4644}
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 4423 of file CDefView.cpp.

4424{
4425 // get insertable index from position
4427
4428 // create identity mapping of indexes
4430 INT nCount = m_ListView.GetItemCount();
4431 for (INT i = 0; i < nCount; ++i)
4432 {
4433 array.Add(i);
4434 }
4435
4436 // re-ordering mapping
4437 INT iItem = -1;
4438 while ((iItem = m_ListView.GetNextItem(iItem, LVNI_SELECTED)) >= 0)
4439 {
4440 INT iFrom = iItem, iTo = iPosition;
4441 if (iFrom < iTo)
4442 --iTo;
4443 if (iFrom >= nCount)
4444 iFrom = nCount - 1;
4445 if (iTo >= nCount)
4446 iTo = nCount - 1;
4447
4448 // shift indexes by swapping (like a bucket relay)
4449 if (iFrom < iTo)
4450 {
4451 for (INT i = iFrom; i < iTo; ++i)
4452 {
4453 // swap array[i] and array[i + 1]
4454 INT tmp = array[i];
4455 array[i] = array[i + 1];
4456 array[i + 1] = tmp;
4457 }
4458 }
4459 else
4460 {
4461 for (INT i = iFrom; i > iTo; --i)
4462 {
4463 // swap array[i] and array[i - 1]
4464 INT tmp = array[i];
4465 array[i] = array[i - 1];
4466 array[i - 1] = tmp;
4467 }
4468 }
4469 }
4470
4471 // create mapping (ListView's lParam to index) from array
4473 for (INT i = 0; i < nCount; ++i)
4474 {
4476 map.Add(lParam, i);
4477 }
4478
4479 // finally sort
4481}
static INT CALLBACK SelectionMoveCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: CDefView.cpp:4412
INT _FindInsertableIndexFromPoint(POINT pt)
Definition: CDefView.cpp:4299
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 1288 of file CDefView.cpp.

1289{
1290 if (!m_ListView)
1291 return nullptr;
1292 return reinterpret_cast<PCUITEMID_CHILD>(m_ListView.GetItemData(i));
1293}
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 1295 of file CDefView.cpp.

1296{
1297 if (!m_ListView)
1298 return nullptr;
1299 return reinterpret_cast<PCUITEMID_CHILD>(lvItem.lParam);
1300}

◆ _Sort()

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

Definition at line 1236 of file CDefView.cpp.

1237{
1238 HWND hHeader;
1239 HDITEM hColumn;
1240 int prevCol = m_sortInfo.ListColumn;
1242
1243 // FIXME: Is this correct? Who sets this style?
1244 // And if it is set, should it also block sorting using the menu?
1245 // Any why should it block sorting when the view is loaded initially?
1246 if (m_ListView.GetWindowLongPtr(GWL_STYLE) & LVS_NOSORTHEADER)
1247 return TRUE;
1248
1249 hHeader = ListView_GetHeader(m_ListView.m_hWnd);
1250 if (Col != -1)
1251 {
1252 if (Col >= Header_GetItemCount(hHeader))
1253 {
1254 ERR("Sort column out of range\n");
1255 return FALSE;
1256 }
1257
1258 if (prevCol == Col)
1259 m_sortInfo.Direction *= -1;
1260 else
1262 m_sortInfo.ListColumn = Col;
1263 }
1264 if (!m_sortInfo.Direction)
1265 m_sortInfo.Direction += 1;
1266
1267 /* If the sorting column changed, remove the sorting style from the old column */
1268 if (prevCol != -1 && prevCol != m_sortInfo.ListColumn)
1269 {
1270 hColumn.mask = HDI_FORMAT;
1271 Header_GetItem(hHeader, prevCol, &hColumn);
1272 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1273 Header_SetItem(hHeader, prevCol, &hColumn);
1274 }
1275
1276 /* Set the sorting style on the new column */
1277 hColumn.mask = HDI_FORMAT;
1278 Header_GetItem(hHeader, m_sortInfo.ListColumn, &hColumn);
1279 hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1280 hColumn.fmt |= (m_sortInfo.Direction > 0 ? HDF_SORTUP : HDF_SORTDOWN);
1281 Header_SetItem(hHeader, m_sortInfo.ListColumn, &hColumn);
1282
1283 /* Sort the list, using the current values of ListColumn and bIsAscending */
1286}
#define ERR(fmt,...)
Definition: precomp.h:57
static INT CALLBACK ListViewCompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
Definition: CDefView.cpp:1222
#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 3839 of file CDefView.cpp.

3840{
3841 TRACE("(%p)->(%p %p)\n", this, pidl, item);
3842 if (!m_ListView)
3843 {
3844 ERR("!m_ListView\n");
3845 return E_FAIL;
3846 }
3847 *item = LV_AddItem(pidl);
3848 return (int)*item >= 0 ? S_OK : E_OUTOFMEMORY;
3849}
int LV_AddItem(PCUITEMID_CHILD pidl)
Definition: CDefView.cpp:1331
#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 3161 of file CDefView.cpp.

3162{
3163 TRACE("(%p)->(0x%lX, %p, %p)\n", this, dwReserved, lpfn, lparam);
3164
3167 return S_OK;
3168}
@ 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 3826 of file CDefView.cpp.

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

Referenced by OnCommand().

◆ AutoArrange()

HRESULT STDMETHODCALLTYPE CDefView::AutoArrange ( )
override

Definition at line 3832 of file CDefView.cpp.

3833{
3834 m_ListView.ModifyStyle(0, LVS_AUTOARRANGE);
3836 return S_OK;
3837}
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 691 of file CDefView.cpp.

692{
694
695 TRACE("\n");
696
697 if (m_pCommDlgBrowser != NULL)
698 {
699 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON,
701 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON,
703 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON,
705 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON,
707 }
708}
CComPtr< ICommDlgBrowser > m_pCommDlgBrowser
Definition: CDefView.cpp:238
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:859
#define FCIDM_TB_REPORTVIEW
Definition: shresdef.h:860

Referenced by CreateViewWindow3(), and OnCommand().

◆ CheckViewMode()

HRESULT CDefView::CheckViewMode ( HMENU  hmenuView)

Definition at line 1911 of file CDefView.cpp.

1912{
1914 {
1915 UINT iItemFirst = FCIDM_SHVIEW_BIGICON;
1916 UINT iItemLast = iItemFirst + FVM_LAST - FVM_FIRST;
1917 UINT iItem = iItemFirst + m_FolderSettings.ViewMode - FVM_FIRST;
1918 CheckMenuRadioItem(hmenuView, iItemFirst, iItemLast, iItem, MF_BYCOMMAND);
1919 }
1920
1921 return S_OK;
1922}
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:838
#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 1157 of file CDefView.cpp.

1158{
1160 m_ListToFolderColMap = NULL; // No cache while we are building the cache
1162 for (UINT i = 0;; ++i)
1163 {
1165 if (FAILED(hr))
1166 break; // No more columns
1167 if (!DPA_SetPtr(cache, i, (void*)(INT_PTR) hr))
1168 break; // Cannot allow holes in the cache, must stop now.
1169 }
1171
1172 for (;;)
1173 {
1175 break;
1176 }
1178 if (hMenu)
1179 {
1180 hMenu = GetSubmenuByID(hMenu, FCIDM_SHVIEW_ARRANGE);
1181 for (UINT i = DVIDM_ARRANGESORT_FIRST; i <= DVIDM_ARRANGESORT_LAST && hMenu; ++i)
1182 {
1183 RemoveMenu(hMenu, i, MF_BYCOMMAND);
1184 }
1185 if ((int) GetMenuItemID(hMenu, 0) <= 0)
1186 RemoveMenu(hMenu, 0, MF_BYPOSITION); // Separator
1187 }
1189 LVCOLUMN lvc;
1190 lvc.mask = LVCF_TEXT;
1191 lvc.pszText = buf;
1192 lvc.cchTextMax = _countof(buf);
1193 for (UINT listCol = 0; listCol < DEFVIEW_ARRANGESORT_MAXENUM; ++listCol)
1194 {
1195 if (!ListView_GetColumn(m_ListView.m_hWnd, listCol, &lvc))
1196 break;
1197 HRESULT foldCol = MapListColumnToFolderColumn(listCol);
1198 assert(SUCCEEDED(foldCol));
1200 DVIDM_ARRANGESORT_FIRST + listCol, lvc.pszText, listCol);
1201 }
1202
1203 ListView_RedrawItems(m_ListView.m_hWnd, 0, 0x7fffffff);
1204 m_ListView.InvalidateRect(NULL, TRUE);
1205}
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:1003
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:824
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 3030 of file CDefView.cpp.

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

◆ CreateList()

BOOL CDefView::CreateList ( )

Definition at line 808 of file CDefView.cpp.

809{
810 HRESULT hr;
811 DWORD dwStyle, dwExStyle, ListExStyle;
812 UINT ViewMode;
813
814 TRACE("%p\n", this);
815
817 LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_AUTOARRANGE; // FIXME: Remove LVS_AUTOARRANGE when the view is able to save ItemPos
819 ListExStyle = LVS_EX_INFOTIP | LVS_EX_LABELTIP;
820
822 {
824 dwStyle |= LVS_ALIGNLEFT;
825 // LVS_EX_REGIONAL?
826 }
827 else
828 {
829 dwStyle |= LVS_SHOWSELALWAYS; // MSDN says FWF_SHOWSELALWAYS is deprecated, always turn on for folders
831 ListExStyle |= LVS_EX_DOUBLEBUFFER;
832 }
833
834 ViewMode = m_FolderSettings.ViewMode;
835 hr = _DoFolderViewCB(SFVM_DEFVIEWMODE, 0, (LPARAM)&ViewMode);
836 if (SUCCEEDED(hr))
837 {
838 if (ViewMode >= FVM_FIRST && ViewMode <= FVM_LAST)
839 m_FolderSettings.ViewMode = ViewMode;
840 else
841 ERR("Ignoring invalid ViewMode from SFVM_DEFVIEWMODE: %u (was: %u)\n", ViewMode, m_FolderSettings.ViewMode);
842 }
843
845 {
846 case FVM_ICON:
847 dwStyle |= LVS_ICON;
848 break;
849 case FVM_DETAILS:
850 dwStyle |= LVS_REPORT;
851 break;
852 case FVM_SMALLICON:
853 dwStyle |= LVS_SMALLICON;
854 break;
855 case FVM_LIST:
856 dwStyle |= LVS_LIST;
857 break;
858 default:
859 dwStyle |= LVS_LIST;
860 break;
861 }
862
864 dwStyle |= LVS_AUTOARRANGE;
865
867 ListExStyle |= LVS_EX_SNAPTOGRID;
868
870 dwStyle |= LVS_SINGLESEL;
871
873 ListExStyle |= LVS_EX_FULLROWSELECT;
874
876 (!SHELL_GetSetting(SSF_DOUBLECLICKINWEBVIEW, fDoubleClickInWebView) && !SHELL_GetSetting(SSF_WIN95CLASSIC, fWin95Classic)))
878
880 dwStyle |= LVS_NOCOLUMNHEADER;
881
882#if 0
883 // FIXME: Because this is a negative, everyone gets the new flag by default unless they
884 // opt out. This code should be enabled when shell looks like Vista instead of 2003
886 ListExStyle |= LVS_EX_HEADERINALLVIEWS;
887#endif
888
890 dwExStyle &= ~WS_EX_CLIENTEDGE;
891
892 RECT rcListView = {0,0,0,0};
893 m_ListView.Create(m_hWnd, rcListView, L"FolderView", dwStyle, dwExStyle, ID_LISTVIEW);
894
895 if (!m_ListView)
896 return FALSE;
897
899
900 /* UpdateShellSettings(); */
901 return TRUE;
902}
#define ID_LISTVIEW
Definition: CDefView.cpp:564
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:826
#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 3095 of file CDefView.cpp.

3096{
3097 return CreateViewWindow3(psb, lpPrevView, SV3CVW3_DEFAULT,
3098 (FOLDERFLAGS)lpfs->fFlags, (FOLDERFLAGS)lpfs->fFlags, (FOLDERVIEWMODE)lpfs->ViewMode, NULL, prcView, phWnd);
3099}
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:3706
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 3699 of file CDefView.cpp.

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

◆ 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 3706 of file CDefView.cpp.

3707{
3708 OLEMENUGROUPWIDTHS omw = { { 0, 0, 0, 0, 0, 0 } };
3709 const UINT SUPPORTED_SV3CVW3 = SV3CVW3_FORCEVIEWMODE | SV3CVW3_FORCEFOLDERFLAGS;
3710 const UINT IGNORE_FWF = FWF_OWNERDATA; // FIXME: Support this
3711
3712 *hwnd = NULL;
3713
3714 TRACE("(%p)->(shlview=%p shlbrs=%p rec=%p hwnd=%p vmode=%x flags=%x)\n", this, psvPrevious, psb, prcView, hwnd, mode, flags);
3715 if (prcView != NULL)
3716 TRACE("-- left=%i top=%i right=%i bottom=%i\n", prcView->left, prcView->top, prcView->right, prcView->bottom);
3717
3718 /* Validate the Shell Browser */
3719 if (psb == NULL || m_hWnd)
3720 return E_UNEXPECTED;
3721
3722 if (view_flags & ~SUPPORTED_SV3CVW3)
3723 FIXME("unsupported view flags 0x%08x\n", view_flags & ~SUPPORTED_SV3CVW3);
3724
3725 if (mode == FVM_AUTO)
3727
3728 /* Set up the member variables */
3729 m_pShellBrowser = psb;
3731 m_FolderSettings.fFlags = (mask & flags) & ~IGNORE_FWF;
3732
3733 if (view_id)
3734 {
3735 if (IsEqualIID(*view_id, VID_LargeIcons))
3737 else if (IsEqualIID(*view_id, VID_SmallIcons))
3739 else if (IsEqualIID(*view_id, VID_List))
3741 else if (IsEqualIID(*view_id, VID_Details))
3743 else if (IsEqualIID(*view_id, VID_Thumbnails))
3745 else if (IsEqualIID(*view_id, VID_Tile))
3747 else if (IsEqualIID(*view_id, VID_ThumbStrip))
3749 else
3750 FIXME("Ignoring unrecognized VID %s\n", debugstr_guid(view_id));
3751 }
3752 const UINT requestedViewMode = m_FolderSettings.ViewMode;
3753
3754 /* Get our parent window */
3755 m_pShellBrowser->GetWindow(&m_hWndParent);
3757
3758 /* Try to get the ICommDlgBrowserInterface, adds a reference !!! */
3761 {
3762 TRACE("-- CommDlgBrowser\n");
3763 }
3764
3765 LoadViewState();
3766 if (view_flags & SV3CVW3_FORCEVIEWMODE)
3767 m_FolderSettings.ViewMode = requestedViewMode;
3768 if (view_flags & SV3CVW3_FORCEFOLDERFLAGS)
3769 m_FolderSettings.fFlags = (mask & flags) & ~IGNORE_FWF;
3770
3771 RECT rcView = *prcView;
3773 if (m_hWnd == NULL)
3774 return E_FAIL;
3775
3776 *hwnd = m_hWnd;
3777
3778 CheckToolbar();
3779
3780 if (!*hwnd)
3781 return E_FAIL;
3782
3784
3786 UpdateWindow();
3787
3788 if (!m_hMenu)
3789 {
3790 m_hMenu = CreateMenu();
3791 m_pShellBrowser->InsertMenusSB(m_hMenu, &omw);
3792 TRACE("-- after fnInsertMenusSB\n");
3793 }
3794
3795 _MergeToolbar();
3796
3797 return S_OK;
3798}
#define U(x)
Definition: wordpad.c:45
@ Create
Definition: registry.c:563
BOOL UpdateWindow()
Definition: atlwin.h:1345
HRESULT _MergeToolbar()
Definition: CDefView.cpp:4619
void CheckToolbar()
Definition: CDefView.cpp:691
FOLDERVIEWMODE GetDefaultViewMode()
Definition: CDefView.cpp:3464
HRESULT LoadViewState()
Definition: CDefView.cpp:3209
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 3101 of file CDefView.cpp.

3102{
3103 TRACE("(%p)\n", this);
3104
3105 /* Make absolutely sure all our UI is cleaned up */
3107
3108 if (m_hAccel)
3109 {
3110 // MSDN: Accelerator tables loaded from resources are freed automatically when application terminates
3111 m_hAccel = NULL;
3112 }
3113
3115 {
3118 }
3119
3120 if (m_hMenuViewModes)
3121 {
3124 }
3125
3126 if (m_hMenu)
3127 {
3129 m_hMenu = NULL;
3130 }
3131
3132 if (m_ListView)
3133 {
3134 m_ListView.DestroyWindow();
3135 }
3136
3137 if (m_hWnd)
3138 {
3140 DestroyWindow();
3141 }
3142
3145
3146 return S_OK;
3147}
#define SFVM_WINDOWCLOSING
void Release()
Definition: atlcomcli.h:170
BOOL DestroyWindow()
Definition: atlwin.h:462
STDMETHOD() UIActivate(UINT uState) override
Definition: CDefView.cpp:3060
@ SVUIA_DEACTIVATE
Definition: shobjidl.idl:753
BOOL WINAPI DestroyMenu(_In_ HMENU)

Referenced by ~CDefView().

◆ DoActivate()

void CDefView::DoActivate ( UINT  uState)

Definition at line 2351 of file CDefView.cpp.

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

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

◆ DoColumnContextMenu()

LRESULT CDefView::DoColumnContextMenu ( LRESULT  lParam)

Definition at line 1924 of file CDefView.cpp.

1925{
1926 const UINT maxItems = 15; // Feels about right
1927 const UINT idMore = 0x1337;
1928 UINT idFirst = idMore + 1, idLast = idFirst;
1929 UINT lastValidListCol = 0; // Keep track of where the new column should be inserted
1930 UINT showMore = GetKeyState(VK_SHIFT) < 0;
1932 HWND hWndHdr = ListView_GetHeader(m_ListView.m_hWnd);
1933
1934 if (lParam == ~0)
1935 {
1936 RECT r;
1937 ::GetWindowRect(hWndHdr, &r);
1938 pt.x = r.left + ((r.right - r.left) / 2);
1939 pt.y = r.top + ((r.bottom - r.top) / 2);
1940 }
1941
1942 HMENU hMenu = CreatePopupMenu();
1943 if (!hMenu)
1944 return 0;
1945
1946 for (UINT foldCol = 0;; ++foldCol)
1947 {
1950 sd.str.uType = !STRRET_WSTR;
1951 if (FAILED(GetDetailsByFolderColumn(NULL, foldCol, sd)))
1952 break;
1953 if (FAILED(StrRetToStrNW(buf, _countof(buf), &sd.str, NULL)))
1954 break;
1955
1956 SHCOLSTATEF state = 0;
1957 if (!m_pSF2Parent || FAILED(m_pSF2Parent->GetDefaultColumnState(foldCol, &state)))
1958 state = 0;
1959 showMore |= (state & (SHCOLSTATE_SECONDARYUI));
1960
1961 UINT mf = MF_STRING;
1962 HRESULT listCol = MapFolderColumnToListColumn(foldCol);
1963
1964 if (foldCol == 0)
1965 mf |= MF_CHECKED | MF_GRAYED | MF_DISABLED; // Force column 0
1967 continue;
1968 else if (SUCCEEDED(listCol))
1969 mf |= MF_CHECKED;
1970
1971 if (AppendMenuItem(hMenu, mf, idLast, buf, lastValidListCol + 1))
1972 {
1973 idLast++;
1974 if (SUCCEEDED(listCol))
1975 lastValidListCol = listCol;
1976 }
1977
1978 if (idLast - idFirst == maxItems)
1979 {
1980 showMore++;
1981 break;
1982 }
1983 }
1984
1985 if (showMore)
1986 {
1987#if 0 // TODO
1988 InsertMenuW(hMenu, -1, MF_SEPARATOR, 0, NULL);
1989 InsertMenuW(hMenu, -1, MF_STRING, idMore, L"More...");
1990#endif
1991 }
1992
1993 // A cludge to force the cursor to update so we are not stuck with "size left/right" if
1994 // the right-click was on a column divider.
1996
1997 // Note: Uses the header as the owner so CDefView::OnInitMenuPopup does not mess us up.
1999 pt.x, pt.y, 0, hWndHdr, NULL);
2000 if (idCmd == idMore)
2001 {
2002 FIXME("Open More dialog\n");
2003 }
2004 else if (idCmd)
2005 {
2006 UINT foldCol = idCmd - idFirst;
2007 HRESULT listCol = MapFolderColumnToListColumn(foldCol);
2008 if (SUCCEEDED(listCol))
2009 {
2010 ListView_DeleteColumn(m_ListView.m_hWnd, listCol);
2011 }
2012 else
2013 {
2014 listCol = (UINT) GetMenuItemDataById(hMenu, idCmd);
2015 LoadColumn(foldCol, listCol, TRUE);
2016 }
2018 }
2019 DestroyMenu(hMenu);
2020 return 0;
2021}
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:1055
CComPtr< IShellFolder2 > m_pSF2Parent
Definition: CDefView.cpp:234
HRESULT MapFolderColumnToListColumn(UINT FoldCol)
Definition: CDefView.cpp:990
void ColumnListChanged()
Definition: CDefView.cpp:1157
HRESULT GetDetailsByFolderColumn(PCUITEMID_CHILD pidl, UINT FoldCol, SHELLDETAILS &sd)
Definition: CDefView.cpp:1024
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 4137 of file CDefView.cpp.

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

4253{
4254 if (*pdwEffect == DROPEFFECT_NONE)
4255 return S_OK;
4256
4257 /* Get a hold on the data object for later calls to DragEnter on the sub-folders */
4258 m_pCurDataObject = pDataObject;
4259
4260 HRESULT hr = drag_notify_subitem(grfKeyState, pt, pdwEffect);
4261 if (SUCCEEDED(hr))
4262 {
4263 POINT ptClient = {pt.x, pt.y};
4264 ScreenToClient(&ptClient);
4265 ImageList_DragEnter(m_hWnd, ptClient.x, ptClient.y);
4266 }
4267
4268 return hr;
4269}
HRESULT drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CDefView.cpp:4137
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 4279 of file CDefView.cpp.

4280{
4282
4283 if (m_pCurDropTarget)
4284 {
4285 m_pCurDropTarget->DragLeave();
4287 }
4288
4289 if (m_pCurDataObject != NULL)
4290 {
4292 }
4293
4294 m_iDragOverItem = 0;
4295
4296 return S_OK;
4297}
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 4271 of file CDefView.cpp.

4272{
4273 POINT ptClient = {pt.x, pt.y};
4274 ScreenToClient(&ptClient);
4275 ImageList_DragMove(ptClient.x, ptClient.y);
4276 return drag_notify_subitem(grfKeyState, pt, pdwEffect);
4277}
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 4554 of file CDefView.cpp.

4555{
4556 FIXME("Stub: this=%p\n", this);
4557 return E_NOTIMPL;
4558}

◆ Drop()

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

Implements IDropTarget.

Definition at line 4483 of file CDefView.cpp.

4484{
4487
4488 if ((IsDropOnSource(NULL) == S_OK) &&
4489 (*pdwEffect & DROPEFFECT_MOVE) &&
4491 {
4492 if (m_pCurDropTarget)
4493 {
4494 m_pCurDropTarget->DragLeave();
4496 }
4497
4498 POINT ptDrop = { pt.x, pt.y };
4499 ::ScreenToClient(m_ListView, &ptDrop);
4501 m_ptLastMousePos = ptDrop;
4502
4504 if (m_ListView.GetStyle() & LVS_AUTOARRANGE)
4505 {
4507 }
4508 else
4509 {
4510 POINT ptItem;
4511 INT iItem = -1;
4512 while ((iItem = m_ListView.GetNextItem(iItem, LVNI_SELECTED)) >= 0)
4513 {
4514 if (m_ListView.GetItemPosition(iItem, &ptItem))
4515 {
4518 m_ListView.SetItemPosition(iItem, &ptItem);
4519 }
4520 }
4521 }
4523 }
4524 else if (m_pCurDropTarget)
4525 {
4526 m_pCurDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect);
4528 }
4529
4531 m_iDragOverItem = 0;
4532 return S_OK;
4533}
POINT m_ptFirstMousePos
Definition: CDefView.cpp:268
STDMETHOD() IsDropOnSource(IDropTarget *drop_target) override
Definition: CDefView.cpp:3941
void _MoveSelectionOnAutoArrange(POINT pt)
Definition: CDefView.cpp:4423
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 3054 of file CDefView.cpp.

3055{
3056 FIXME("(%p)\n", this);
3057 return E_NOTIMPL;
3058}

◆ Exec()

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

Implements IOleCommandTarget.

Definition at line 4054 of file CDefView.cpp.

4055{
4056 FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08x Opt:0x%08x %p %p)\n",
4057 this, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, pvaIn, pvaOut);
4058
4059 if (!pguidCmdGroup)
4060 return OLECMDERR_E_UNKNOWNGROUP;
4061
4062 if (IsEqualCLSID(*pguidCmdGroup, m_Category))
4063 {
4064 if (nCmdID == FCIDM_SHVIEW_AUTOARRANGE)
4065 {
4066 if (V_VT(pvaIn) != VT_INT_PTR)
4067 return OLECMDERR_E_NOTSUPPORTED;
4068
4070 params.cbSize = sizeof(params);
4071 params.rcExclude = *(RECT*) V_INTREF(pvaIn);
4072
4073 if (m_hMenuViewModes)
4074 {
4075 // Duplicate all but the last two items of the view modes menu
4076 HMENU hmenuViewPopup = CreatePopupMenu();
4077 Shell_MergeMenus(hmenuViewPopup, m_hMenuViewModes, 0, 0, 0xFFFF, 0);
4078 DeleteMenu(hmenuViewPopup, GetMenuItemCount(hmenuViewPopup) - 1, MF_BYPOSITION);
4079 DeleteMenu(hmenuViewPopup, GetMenuItemCount(hmenuViewPopup) - 1, MF_BYPOSITION);
4080 CheckViewMode(hmenuViewPopup);
4081 TrackPopupMenuEx(hmenuViewPopup, TPM_LEFTALIGN | TPM_TOPALIGN, params.rcExclude.left, params.rcExclude.bottom, m_hWndParent, &params);
4082 ::DestroyMenu(hmenuViewPopup);
4083 }
4084
4085 // pvaOut is VT_I4 with value 0x403 (cmd id of the new mode maybe?)
4086 V_VT(pvaOut) = VT_I4;
4087 V_I4(pvaOut) = 0x403;
4088 }
4089 }
4090
4091 if (IsEqualIID(*pguidCmdGroup, CGID_Explorer) &&
4092 (nCmdID == 0x29) &&
4093 (nCmdexecopt == 4) && pvaOut)
4094 return S_OK;
4095
4096 if (IsEqualIID(*pguidCmdGroup, CGID_ShellDocView) &&
4097 (nCmdID == 9) &&
4098 (nCmdexecopt == 0))
4099 return 1;
4100
4101 if (IsEqualIID(*pguidCmdGroup, CGID_DefView))
4102 {
4103 CComPtr<IStream> pStream;
4104 WCHAR SubKey[MAX_PATH];
4105 switch (nCmdID)
4106 {
4108 SHDeleteKey(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\ShellNoRoam\\Bags");
4110 SaveViewState(pStream);
4111 break;
4113 wsprintfW(SubKey, L"%s\\%s", REGSTR_PATH_EXPLORER, L"Streams\\Default");
4115 SHDeleteKey(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\ShellNoRoam\\Bags");
4116 m_FolderSettings.fFlags |= FWF_NOBROWSERVIEWSTATE; // Don't let this folder save itself
4117 break;
4118 }
4119 }
4120
4121 return OLECMDERR_E_UNKNOWNGROUP;
4122}
STDMETHOD() SaveViewState() override
Definition: CDefView.cpp:3343
HRESULT CheckViewMode(HMENU hmenuView)
Definition: CDefView.cpp:1911
HRESULT GetDefaultViewStream(DWORD Stgm, IStream **ppStream)
Definition: CDefView.cpp:3184
@ 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:843
#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 1461 of file CDefView.cpp.

1462{
1463 PITEMID_CHILD pidl = static_cast<PITEMID_CHILD>(ptr);
1464 CDefView *pThis = static_cast<CDefView *>(arg);
1465
1466 // in a commdlg this works as a filemask
1467 if (pThis->IncludeObject(pidl) == S_OK && pThis->m_ListView)
1468 pThis->LV_AddItem(pidl);
1469
1470 SHFree(pidl);
1471 return TRUE;
1472}
HRESULT IncludeObject(PCUITEMID_CHILD pidl)
Definition: CDefView.cpp:642
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 1855 of file CDefView.cpp.

1856{
1857 bool forceMerge = false;
1859
1860 // Make sure the column we currently sort by is in the menu
1863 {
1867 LVCOLUMN lvc;
1868 lvc.mask = LVCF_TEXT;
1869 lvc.pszText = buf;
1870 lvc.cchTextMax = _countof(buf);
1871 currentSortId = DVIDM_ARRANGESORT_LAST;
1872 forceMerge = true;
1874 AppendMenuItem(m_hMenuArrangeModes, MF_STRING, currentSortId, lvc.pszText, m_sortInfo.ListColumn);
1875 }
1876
1877 // Prepend the sort-by items unless they are aleady there
1878 if (GetMenuItemID(hmenuArrange, 0) == FCIDM_SHVIEW_AUTOARRANGE || forceMerge)
1879 {
1880 Shell_MergeMenus(hmenuArrange, m_hMenuArrangeModes, 0, 0, 0xFFFF, MM_ADDSEPARATOR);
1881 }
1882
1883 CheckMenuRadioItem(hmenuArrange,
1885 currentSortId, MF_BYCOMMAND);
1886
1888 {
1891 }
1892 else
1893 {
1896
1897 if (GetAutoArrange() == S_OK)
1899 else
1901
1902 if (_GetSnapToGrid() == S_OK)
1904 else
1906 }
1907
1908 return S_OK;
1909}
@ DEFVIEW_ARRANGESORT_MAX
Definition: CDefView.cpp:48
STDMETHOD() GetAutoArrange() override
Definition: CDefView.cpp:3627
HRESULT _GetSnapToGrid()
Definition: CDefView.cpp:3632
#define C_ASSERT(e)
Definition: intsafe.h:73
#define MM_ADDSEPARATOR
Definition: shlobj.h:2528
#define FCIDM_SHVIEW_ALIGNTOGRID
Definition: shresdef.h:845
#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 1822 of file CDefView.cpp.

1823{
1825 if (!hEditMenu)
1826 return E_FAIL;
1827
1828 HMENU hmenuContents = ::LoadMenuW(shell32_hInstance, L"MENU_003");
1829 if (!hmenuContents)
1830 return E_FAIL;
1831
1832 Shell_MergeMenus(hEditMenu, hmenuContents, 0, 0, 0xFFFF, 0);
1833
1834 ::DestroyMenu(hmenuContents);
1835
1836 return S_OK;
1837}
#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 1776 of file CDefView.cpp.

1777{
1779 if (!hFileMenu)
1780 return E_FAIL;
1781
1782 /* Cleanup the items added previously */
1783 for (int i = GetMenuItemCount(hFileMenu) - 1; i >= 0; i--)
1784 {
1785 UINT id = GetMenuItemID(hFileMenu, i);
1786 if (id < FCIDM_BROWSERFIRST || id > FCIDM_BROWSERLAST)
1787 DeleteMenu(hFileMenu, i, MF_BYPOSITION);
1788 }
1789
1790 // In case we still have this left over, clean it up
1791 if (m_pFileMenu)
1792 {
1795 }
1796 UINT selcount = m_ListView.GetSelectedCount();
1797 // Store context menu in m_pFileMenu and keep it to invoke the selected command later on
1800 return hr;
1801
1803
1804 UINT cmf = GetContextMenuFlags(m_pShellBrowser, SFGAO_CANRENAME);
1805 hr = m_pFileMenu->QueryContextMenu(hmenu, 0, DVIDM_CONTEXTMENU_FIRST, DVIDM_CONTEXTMENU_LAST, cmf);
1807 return hr;
1808
1809 // TODO: filter or something
1810 if (!selcount)
1811 {
1815 }
1816
1817 Shell_MergeMenus(hFileMenu, hmenu, 0, 0, 0xFFFF, MM_ADDSEPARATOR | MM_SUBMENUSHAVEIDS);
1819 return S_OK;
1820}
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:3414
CComPtr< IContextMenu > m_pFileMenu
Definition: CDefView.cpp:272
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
#define FCIDM_SHVIEW_REFRESH
Definition: shresdef.h:853
#define FCIDM_SHVIEW_VIEW
Definition: shresdef.h:825
static HMENU hmenu
Definition: win.c:66

Referenced by OnInitMenuPopup().

◆ FillList()

HRESULT CDefView::FillList ( BOOL  IsRefreshCommand = TRUE)

Definition at line 1478 of file CDefView.cpp.

1479{
1480 CComPtr<IEnumIDList> pEnumIDList;
1481 PITEMID_CHILD pidl;
1482 DWORD dwFetched;
1483 HRESULT hRes;
1484 HDPA hdpa;
1485 DWORD dFlags = SHCONTF_NONFOLDERS | ((m_FolderSettings.fFlags & FWF_NOSUBFOLDERS) ? 0 : SHCONTF_FOLDERS);
1486
1487 TRACE("%p\n", this);
1488
1489 SHELLSTATE shellstate;
1491 if (GetCommDlgViewFlags() & CDB2GVF_SHOWALLFILES)
1492 shellstate.fShowAllObjects = shellstate.fShowSuperHidden = TRUE;
1493
1494 if (shellstate.fShowAllObjects)
1495 {
1496 dFlags |= SHCONTF_INCLUDEHIDDEN;
1497 m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
1498 }
1499 if (shellstate.fShowSuperHidden)
1500 {
1501 dFlags |= SHCONTF_INCLUDESUPERHIDDEN;
1502 m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
1503 }
1504
1505 // get the itemlist from the shfolder
1506 hRes = m_pSFParent->EnumObjects(m_hWnd, dFlags, &pEnumIDList);
1507 if (hRes != S_OK)
1508 {
1509 if (hRes == S_FALSE)
1510 return(NOERROR);
1511 return(hRes);
1512 }
1513
1514 // create a pointer array
1515 hdpa = DPA_Create(16);
1516 if (!hdpa)
1517 return(E_OUTOFMEMORY);
1518
1519 // copy the items into the array
1520 while((S_OK == pEnumIDList->Next(1, &pidl, &dwFetched)) && dwFetched)
1521 {
1522 if (DPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
1523 {
1524 SHFree(pidl);
1525 }
1526 }
1527
1528 // turn listview's redrawing off
1530
1531 DPA_DestroyCallback( hdpa, fill_list, this);
1532
1533 /* sort the array */
1534 int sortCol = -1;
1535 if (!IsRefreshCommand && !m_sortInfo.bLoadedFromViewState) // Are we loading for the first time?
1536 {
1538 sortCol = 0; // In case the folder does not know/care
1539 if (m_pSF2Parent)
1540 {
1541 ULONG folderSortCol = sortCol, dummy;
1542 HRESULT hr = m_pSF2Parent->GetDefaultColumn(NULL, &folderSortCol, &dummy);
1543 if (SUCCEEDED(hr))
1544 hr = MapFolderColumnToListColumn(folderSortCol);
1545 if (SUCCEEDED(hr))
1546 sortCol = (int) hr;
1547 }
1548 }
1549 _Sort(sortCol);
1550
1552 {
1555 }
1556
1557 // load custom background image and custom text color
1560
1561 // turn listview's redrawing back on and force it to draw
1563
1565
1567 {
1568 // redraw now
1569 m_ListView.InvalidateRect(NULL, TRUE);
1570 }
1571
1573
1574 return S_OK;
1575}
#define SFVM_GET_CUSTOMVIEWINFO
#define SFVM_LISTREFRESHED
DWORD GetCommDlgViewFlags()
Definition: CDefView.cpp:346
static INT CALLBACK fill_list(LPVOID ptr, LPVOID arg)
Definition: CDefView.cpp:1461
void UpdateListColors()
Definition: CDefView.cpp:904
BOOL _Sort(int Col=-1)
Definition: CDefView.cpp:1236
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 1839 of file CDefView.cpp.

1840{
1842 if (!hViewMenu)
1843 return E_FAIL;
1844
1846 if (!m_hMenuViewModes)
1847 return E_FAIL;
1848
1851
1852 return S_OK;
1853}
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 4566 of file CDefView.cpp.

4567{
4568 FIXME("Stub: this=%p\n", this);
4569 return E_NOTIMPL;
4570}

◆ GetAdvise()

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

Implements IViewObject.

Definition at line 4590 of file CDefView.cpp.

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

◆ GetArrangeParam()

HRESULT STDMETHODCALLTYPE CDefView::GetArrangeParam ( LPARAM sort)
override

Definition at line 3820 of file CDefView.cpp.

3821{
3822 FIXME("(%p)->(%p) stub\n", this, sort);
3823 return E_NOTIMPL;
3824}
_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 3627 of file CDefView.cpp.

3628{
3629 return ((m_ListView.GetStyle() & LVS_AUTOARRANGE) ? S_OK : S_FALSE);
3630}

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 4560 of file CDefView.cpp.

4561{
4562 FIXME("Stub: this=%p\n", this);
4563 return E_NOTIMPL;
4564}

◆ GetCommDlgViewFlags()

DWORD CDefView::GetCommDlgViewFlags ( )
inline

Definition at line 346 of file CDefView.cpp.

347 {
350 {
351 DWORD flags;
352 if (SUCCEEDED(pcdb2->GetViewFlags(&flags)))
353 return flags;
354 }
355 return 0;
356 }

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

◆ GetCurrentInfo()

HRESULT WINAPI CDefView::GetCurrentInfo ( LPFOLDERSETTINGS  pfs)
override

Implements IShellView.

Definition at line 3149 of file CDefView.cpp.

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

◆ GetCurrentViewMode()

HRESULT STDMETHODCALLTYPE CDefView::GetCurrentViewMode ( UINT pViewMode)
override

Implements IFolderView.

Definition at line 3473 of file CDefView.cpp.

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

Referenced by SaveViewState().

◆ GetDefaultSpacing()

HRESULT STDMETHODCALLTYPE CDefView::GetDefaultSpacing ( POINT ppt)
override

Implements IFolderView.

Definition at line 3622 of file CDefView.cpp.

3623{
3624 return E_NOTIMPL;
3625}

◆ GetDefaultViewMode()

FOLDERVIEWMODE CDefView::GetDefaultViewMode ( )

Definition at line 3464 of file CDefView.cpp.

3465{
3469 mode = temp;
3470 return mode;
3471}
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:2078

Referenced by CreateViewWindow3().

◆ GetDefaultViewStream()

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

Definition at line 3184 of file CDefView.cpp.

3185{
3186 CLSID clsid;
3188 if (SUCCEEDED(hr))
3189 {
3190 WCHAR path[MAX_PATH], name[39];
3191 wsprintfW(path, L"%s\\%s", REGSTR_PATH_EXPLORER, L"Streams\\Default");
3193 *ppStream = SHOpenRegStream2W(HKEY_CURRENT_USER, path, name, Stgm);
3194 hr = *ppStream ? S_OK : E_FAIL;
3195 }
3196 return hr;
3197}
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 1024 of file CDefView.cpp.

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

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

◆ GetDetailsByListColumn()

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

Definition at line 1046 of file CDefView.cpp.

1047{
1049 if (SUCCEEDED(hr))
1050 return GetDetailsByFolderColumn(pidl, hr, sd);
1051 ERR("Unable to determine folder column from list column %d\n", (int) ListCol);
1052 return hr;
1053}

Referenced by OnNotify().

◆ GetDragPoint()

HRESULT STDMETHODCALLTYPE CDefView::GetDragPoint ( POINT pt)
override

Definition at line 3952 of file CDefView.cpp.

3953{
3954 if (!pt)
3955 return E_INVALIDARG;
3956
3958 return S_OK;
3959}

◆ GetDropPoint()

HRESULT STDMETHODCALLTYPE CDefView::GetDropPoint ( POINT pt)
override

Definition at line 3961 of file CDefView.cpp.

3962{
3963 FIXME("(%p)->(%p) stub\n", this, pt);
3964 return E_NOTIMPL;
3965}

◆ GetFocusedItem()

HRESULT STDMETHODCALLTYPE CDefView::GetFocusedItem ( int piItem)
override

Implements IFolderView.

Definition at line 3575 of file CDefView.cpp.

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

◆ GetFolder()

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

Implements IFolderView.

Definition at line 3528 of file CDefView.cpp.

3529{
3530 if (m_pSFParent == NULL)
3531 return E_FAIL;
3532
3533 return m_pSFParent->QueryInterface(riid, ppv);
3534}
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 3414 of file CDefView.cpp.

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