ReactOS 0.4.15-dev-7928-g68a8619
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 ()
 
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_ProdItem (PCUITEMID_CHILD pidl)
 
HRESULT FillList ()
 
HRESULT FillFileMenu ()
 
HRESULT FillEditMenu ()
 
HRESULT FillViewMenu ()
 
HRESULT FillArrangeAsMenu (HMENU hmenuArrange)
 
HRESULT CheckViewMode (HMENU hmenuView)
 
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)
 
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 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 ()
 
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)
 

Private Attributes

CComPtr< IShellFolderm_pSFParent
 
CComPtr< IShellFolder2m_pSF2Parent
 
CComPtr< IShellFolderViewCB > m_pShellFolderViewCB
 
CComPtr< IShellBrowserm_pShellBrowser
 
CComPtr< ICommDlgBrowserm_pCommDlgBrowser
 
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
 
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
 
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 97 of file CDefView.cpp.

Constructor & Destructor Documentation

◆ CDefView()

CDefView::CDefView ( )

Definition at line 420 of file CDefView.cpp.

420 :
421 m_ListView(),
423 m_hMenu(NULL),
428 m_uState(0),
429 m_cidl(0),
430 m_apidl(NULL),
432 m_hNotify(0),
433 m_hAccel(NULL),
434 m_dwAspects(0),
435 m_dwAdvf(0),
441{
449
451}
#define shell32_hInstance
HMENU m_hMenu
Definition: CDefView.cpp:119
HMENU m_hMenuArrangeModes
Definition: CDefView.cpp:120
HWND m_hWndParent
Definition: CDefView.cpp:117
DWORD m_dwAdvf
Definition: CDefView.cpp:132
DWORD m_dwAspects
Definition: CDefView.cpp:131
BOOL m_isParentFolderSpecial
Definition: CDefView.cpp:148
UINT m_cScrollDelay
Definition: CDefView.cpp:139
LISTVIEW_SORT_INFO m_sortInfo
Definition: CDefView.cpp:128
PIDLIST_ABSOLUTE m_pidlParent
Definition: CDefView.cpp:127
HMENU m_hContextMenu
Definition: CDefView.cpp:122
BOOL m_Destroyed
Definition: CDefView.cpp:151
PCUITEMID_CHILD * m_apidl
Definition: CDefView.cpp:126
CLSID m_Category
Definition: CDefView.cpp:150
HICON m_hMyComputerIcon
Definition: CDefView.cpp:154
BOOL m_bmenuBarInitialized
Definition: CDefView.cpp:123
UINT m_cidl
Definition: CDefView.cpp:125
UINT m_uState
Definition: CDefView.cpp:124
BOOL m_isEditing
Definition: CDefView.cpp:147
POINT m_ptLastMousePos
Definition: CDefView.cpp:140
ULONG m_hNotify
Definition: CDefView.cpp:129
LONG m_iDragOverItem
Definition: CDefView.cpp:138
HMENU m_hMenuViewModes
Definition: CDefView.cpp:121
HACCEL m_hAccel
Definition: CDefView.cpp:130
FOLDERSETTINGS m_FolderSettings
Definition: CDefView.cpp:118
CListView m_ListView
Definition: CDefView.cpp:116
SFVM_CUSTOMVIEWINFO_DATA m_viewinfo_data
Definition: CDefView.cpp:152
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define IDI_SHELL_COMPUTER_DESKTOP
Definition: shresdef.h:645
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_WINDOW
Definition: winuser.h:918
#define COLOR_WINDOWTEXT
Definition: winuser.h:921
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075

◆ ~CDefView()

CDefView::~CDefView ( )

Definition at line 453 of file CDefView.cpp.

454{
455 TRACE(" destroying IShellView(%p)\n", this);
456
458
460 {
463 }
464
465 if (m_hWnd)
466 {
468 }
469
471}
#define SFVM_VIEWRELEASE
HWND m_hWnd
Definition: atlwin.h:273
STDMETHOD() DestroyViewWindow() override
Definition: CDefView.cpp:2501
HRESULT _DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CDefView.cpp:3818
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 1793 of file CDefView.cpp.

1794{
1795 if (!GetSelections())
1796 return;
1797
1798 SFGAOF rfg = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_FILESYSTEM;
1799 HRESULT hr = m_pSFParent->GetAttributesOf(m_cidl, m_apidl, &rfg);
1801 return;
1802
1803 if (!bCopy && !(rfg & SFGAO_CANMOVE))
1804 return;
1805 if (bCopy && !(rfg & SFGAO_CANCOPY))
1806 return;
1807
1809 hr = m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl, m_apidl, IID_IContextMenu, 0, (void **)&pCM);
1811 return;
1812
1813 InvokeContextMenuCommand(pCM, (bCopy ? "copyto" : "moveto"), NULL);
1814}
CComPtr< IShellFolder > m_pSFParent
Definition: CDefView.cpp:110
HRESULT InvokeContextMenuCommand(CComPtr< IContextMenu > &pCM, LPCSTR lpVerb, POINT *pt=NULL)
Definition: CDefView.cpp:1505
UINT GetSelections()
Definition: CDefView.cpp:1475
#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 3818 of file CDefView.cpp.

3819{
3821
3823 {
3824 hr = m_pShellFolderViewCB->MessageSFVCB(uMsg, wParam, lParam);
3825 }
3826
3827 return hr;
3828}
CComPtr< IShellFolderViewCB > m_pShellFolderViewCB
Definition: CDefView.cpp:112
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by CreateList(), CreateViewWindow3(), DestroyViewWindow(), FillList(), LV_AddItem(), OnNotify(), OnSize(), Refresh(), and ~CDefView().

◆ _FindInsertableIndexFromPoint()

INT CDefView::_FindInsertableIndexFromPoint ( POINT  pt)
private

Definition at line 3471 of file CDefView.cpp.

3472{
3473 RECT rcBound;
3474 INT i, nCount = m_ListView.GetItemCount();
3475 DWORD dwSpacing;
3476 INT dx, dy;
3477 BOOL bSmall = ((m_ListView.GetStyle() & LVS_TYPEMASK) != LVS_ICON);
3478
3479 // FIXME: LVM_GETORIGIN is broken. See CORE-17266
3480 pt.x += m_ListView.GetScrollPos(SB_HORZ);
3481 pt.y += m_ListView.GetScrollPos(SB_VERT);
3482
3483 if (m_ListView.GetStyle() & LVS_ALIGNLEFT)
3484 {
3485 // vertically
3486 for (i = 0; i < nCount; ++i)
3487 {
3488 dwSpacing = ListView_GetItemSpacing(m_ListView, bSmall);
3489 dx = LOWORD(dwSpacing);
3490 dy = HIWORD(dwSpacing);
3492 rcBound.right = rcBound.left + dx;
3493 rcBound.bottom = rcBound.top + dy;
3494 if (pt.x < rcBound.right && pt.y < (rcBound.top + rcBound.bottom) / 2)
3495 {
3496 return i;
3497 }
3498 }
3499 for (i = nCount - 1; i >= 0; --i)
3500 {
3502 if (rcBound.left < pt.x && rcBound.top < pt.y)
3503 {
3504 return i + 1;
3505 }
3506 }
3507 }
3508 else
3509 {
3510 // horizontally
3511 for (i = 0; i < nCount; ++i)
3512 {
3513 dwSpacing = ListView_GetItemSpacing(m_ListView, bSmall);
3514 dx = LOWORD(dwSpacing);
3515 dy = HIWORD(dwSpacing);
3517 rcBound.right = rcBound.left + dx;
3518 rcBound.bottom = rcBound.top + dy;
3519 if (pt.y < rcBound.bottom && pt.x < rcBound.left)
3520 {
3521 return i;
3522 }
3523 if (pt.y < rcBound.bottom && pt.x < rcBound.right)
3524 {
3525 return i + 1;
3526 }
3527 }
3528 for (i = nCount - 1; i >= 0; --i)
3529 {
3531 if (rcBound.left < pt.x && rcBound.top < pt.y)
3532 {
3533 return i + 1;
3534 }
3535 }
3536 }
3537
3538 return nCount;
3539}
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:2478
#define LVS_ICON
Definition: commctrl.h:2261
#define LVS_TYPEMASK
Definition: commctrl.h:2265
#define LVIR_SELECTBOUNDS
Definition: commctrl.h:2475
#define LVS_ALIGNLEFT
Definition: commctrl.h:2280
#define ListView_GetItemSpacing(hwndLV, fSmall)
Definition: commctrl.h:2712
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 3567 of file CDefView.cpp.

3568{
3569 // Get the handle for the status bar
3570 HWND fStatusBar;
3571 m_pShellBrowser->GetControlWindow(FCW_STATUS, &fStatusBar);
3572
3573 // Get the size of our status bar
3574 RECT statusBarSize;
3575 ::GetWindowRect(fStatusBar, &statusBarSize);
3576
3577 // Resize the status bar
3578 _HandleStatusBarResize(statusBarSize.right - statusBarSize.left);
3579}
CComPtr< IShellBrowser > m_pShellBrowser
Definition: CDefView.cpp:113
void _HandleStatusBarResize(int width)
Definition: CDefView.cpp:3541
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

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

◆ _GetSnapToGrid()

HRESULT CDefView::_GetSnapToGrid ( )
private

Definition at line 2840 of file CDefView.cpp.

2841{
2842 DWORD dwExStyle = (DWORD)m_ListView.SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
2843 return ((dwExStyle & LVS_EX_SNAPTOGRID) ? S_OK : S_FALSE);
2844}
#define S_OK
Definition: intsafe.h:52
#define DWORD
Definition: nt_native.h:44
#define LVS_EX_SNAPTOGRID
Definition: commctrl.h:2748
#define LVM_GETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2727
#define S_FALSE
Definition: winerror.h:2357

Referenced by FillArrangeAsMenu(), and OnCommand().

◆ _HandleStatusBarResize()

void CDefView::_HandleStatusBarResize ( int  width)
private

Definition at line 3541 of file CDefView.cpp.

3542{
3543 LRESULT lResult;
3544
3546 {
3547 int nPartArray[] = {-1};
3548 m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, _countof(nPartArray), (LPARAM)nPartArray, &lResult);
3549 return;
3550 }
3551
3552 int nFileSizePartLength = 125;
3553 const int nLocationPartLength = 150;
3554 const int nRightPartsLength = nFileSizePartLength + nLocationPartLength;
3555 int nObjectsPartLength = nWidth - nRightPartsLength;
3556
3557 // If the window is small enough just divide each part into thirds
3558 // to match the behavior of Windows Server 2003
3559 if (nObjectsPartLength <= nLocationPartLength)
3560 nObjectsPartLength = nFileSizePartLength = nWidth / 3;
3561
3562 int nPartArray[] = {nObjectsPartLength, nObjectsPartLength + nFileSizePartLength, -1};
3563
3564 m_pShellBrowser->SendControlMsg(FCW_STATUS, SB_SETPARTS, _countof(nPartArray), (LPARAM)nPartArray, &lResult);
3565}
#define SB_SETPARTS
Definition: commctrl.h:1954
#define _countof(array)
Definition: sndvol32.h:68
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 3791 of file CDefView.cpp.

3792{
3794 HRESULT hr = S_OK;
3795
3796 hr = IUnknown_QueryService(m_pShellBrowser, IID_IExplorerToolbar, IID_PPV_ARG(IExplorerToolbar, &ptb));
3797 if (FAILED(hr))
3798 return hr;
3799
3800 m_Category = CGID_DefViewFrame;
3801
3802 hr = ptb->SetCommandTarget(static_cast<IOleCommandTarget*>(this), &m_Category, 0);
3803 if (FAILED(hr))
3804 return hr;
3805
3806 if (hr == S_FALSE)
3807 return S_OK;
3808
3809#if 0
3810 hr = ptb->AddButtons(&m_Category, buttonsCount, buttons);
3811 if (FAILED(hr))
3812 return hr;
3813#endif
3814
3815 return S_OK;
3816}
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1497
#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 3595 of file CDefView.cpp.

3596{
3597 // get insertable index from position
3599
3600 // create identity mapping of indexes
3602 INT nCount = m_ListView.GetItemCount();
3603 for (INT i = 0; i < nCount; ++i)
3604 {
3605 array.Add(i);
3606 }
3607
3608 // re-ordering mapping
3609 INT iItem = -1;
3610 while ((iItem = m_ListView.GetNextItem(iItem, LVNI_SELECTED)) >= 0)
3611 {
3612 INT iFrom = iItem, iTo = iPosition;
3613 if (iFrom < iTo)
3614 --iTo;
3615 if (iFrom >= nCount)
3616 iFrom = nCount - 1;
3617 if (iTo >= nCount)
3618 iTo = nCount - 1;
3619
3620 // shift indexes by swapping (like a bucket relay)
3621 if (iFrom < iTo)
3622 {
3623 for (INT i = iFrom; i < iTo; ++i)
3624 {
3625 // swap array[i] and array[i + 1]
3626 INT tmp = array[i];
3627 array[i] = array[i + 1];
3628 array[i + 1] = tmp;
3629 }
3630 }
3631 else
3632 {
3633 for (INT i = iFrom; i > iTo; --i)
3634 {
3635 // swap array[i] and array[i - 1]
3636 INT tmp = array[i];
3637 array[i] = array[i - 1];
3638 array[i - 1] = tmp;
3639 }
3640 }
3641 }
3642
3643 // create mapping (ListView's lParam to index) from array
3645 for (INT i = 0; i < nCount; ++i)
3646 {
3648 map.Add(lParam, i);
3649 }
3650
3651 // finally sort
3653}
static INT CALLBACK SelectionMoveCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: CDefView.cpp:3584
INT _FindInsertableIndexFromPoint(POINT pt)
Definition: CDefView.cpp:3471
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:2424

Referenced by Drop().

◆ _PidlByItem() [1/2]

PCUITEMID_CHILD CDefView::_PidlByItem ( int  i)

Definition at line 887 of file CDefView.cpp.

888{
889 if (!m_ListView)
890 return nullptr;
891 return reinterpret_cast<PCUITEMID_CHILD>(m_ListView.GetItemData(i));
892}
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 894 of file CDefView.cpp.

895{
896 if (!m_ListView)
897 return nullptr;
898 return reinterpret_cast<PCUITEMID_CHILD>(lvItem.lParam);
899}

◆ _Sort()

BOOL CDefView::_Sort ( )
private

Definition at line 853 of file CDefView.cpp.

854{
855 HWND hHeader;
856 HDITEM hColumn;
857
858 if (m_ListView.GetWindowLongPtr(GWL_STYLE) & LVS_NOSORTHEADER)
859 return TRUE;
860
861 hHeader = (HWND)m_ListView.SendMessage(LVM_GETHEADER, 0, 0);
862 ZeroMemory(&hColumn, sizeof(hColumn));
863
864 // If the sorting column changed, remove sorting style from the old column
865 if ( (m_sortInfo.nLastHeaderID != -1) &&
867 {
868 hColumn.mask = HDI_FORMAT;
869 Header_GetItem(hHeader, m_sortInfo.nLastHeaderID, &hColumn);
870 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
871 Header_SetItem(hHeader, m_sortInfo.nLastHeaderID, &hColumn);
872 }
873
874 /* Set the sorting style to the new column */
875 hColumn.mask = HDI_FORMAT;
876 Header_GetItem(hHeader, m_sortInfo.nHeaderID, &hColumn);
877
878 hColumn.fmt &= (m_sortInfo.bIsAscending ? ~HDF_SORTDOWN : ~HDF_SORTUP );
879 hColumn.fmt |= (m_sortInfo.bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
880 Header_SetItem(hHeader, m_sortInfo.nHeaderID, &hColumn);
881
882 /* Sort the list, using the current values of nHeaderID and bIsAscending */
885}
static INT CALLBACK ListViewCompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
Definition: CDefView.cpp:837
#define TRUE
Definition: types.h:120
HANDLE HWND
Definition: compat.h:19
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:751
#define LVM_GETHEADER
Definition: commctrl.h:2650
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:758
#define HDF_SORTUP
Definition: commctrl.h:724
#define HDI_FORMAT
Definition: commctrl.h:705
#define LVS_NOSORTHEADER
Definition: commctrl.h:2285
#define HDITEM
Definition: commctrl.h:697
#define HDF_SORTDOWN
Definition: commctrl.h:725
#define GWL_STYLE
Definition: winuser.h:852

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

◆ AddObject()

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

Definition at line 3034 of file CDefView.cpp.

3035{
3036 TRACE("(%p)->(%p %p)\n", this, pidl, item);
3037 if (!m_ListView)
3038 {
3039 ERR("!m_ListView\n");
3040 return E_FAIL;
3041 }
3042 *item = LV_AddItem(pidl);
3043 return (int)*item >= 0 ? S_OK : E_OUTOFMEMORY;
3044}
#define ERR(fmt,...)
Definition: debug.h:110
int LV_AddItem(PCUITEMID_CHILD pidl)
Definition: CDefView.cpp:916
#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 2561 of file CDefView.cpp.

2562{
2563 FIXME("(%p) stub\n", this);
2564
2565 return E_NOTIMPL;
2566}
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ArrangeGrid()

HRESULT STDMETHODCALLTYPE CDefView::ArrangeGrid ( )
override

Definition at line 3021 of file CDefView.cpp.

3022{
3024 return S_OK;
3025}
DWORD SetExtendedListViewStyle(DWORD dw, DWORD dwMask=0)
Definition: rosctrls.h:47

Referenced by OnCommand().

◆ AutoArrange()

HRESULT STDMETHODCALLTYPE CDefView::AutoArrange ( )
override

Definition at line 3027 of file CDefView.cpp.

3028{
3029 m_ListView.ModifyStyle(0, LVS_AUTOARRANGE);
3031 return S_OK;
3032}
BOOL Arrange(UINT nCode)
Definition: rosctrls.h:241
#define LVA_DEFAULT
Definition: commctrl.h:2527
#define LVS_AUTOARRANGE
Definition: commctrl.h:2272

Referenced by OnCommand().

◆ CheckToolbar()

void CDefView::CheckToolbar ( )

Definition at line 530 of file CDefView.cpp.

531{
533
534 TRACE("\n");
535
536 if (m_pCommDlgBrowser != NULL)
537 {
538 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON,
540 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_CHECKBUTTON,
542 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON,
544 m_pShellBrowser->SendControlMsg(FCW_TOOLBAR, TB_ENABLEBUTTON,
546 }
547}
CComPtr< ICommDlgBrowser > m_pCommDlgBrowser
Definition: CDefView.cpp:114
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:677
@ FVM_DETAILS
Definition: shobjidl.idl:678
#define FCIDM_TB_SMALLICON
Definition: shresdef.h:857
#define FCIDM_TB_REPORTVIEW
Definition: shresdef.h:858

Referenced by CreateViewWindow3(), and OnCommand().

◆ CheckViewMode()

HRESULT CDefView::CheckViewMode ( HMENU  hmenuView)

Definition at line 1457 of file CDefView.cpp.

1458{
1460 {
1461 UINT iItemFirst = FCIDM_SHVIEW_BIGICON;
1462 UINT iItemLast = iItemFirst + FVM_LAST - FVM_FIRST;
1463 UINT iItem = iItemFirst + m_FolderSettings.ViewMode - FVM_FIRST;
1464 CheckMenuRadioItem(hmenuView, iItemFirst, iItemLast, iItem, MF_BYCOMMAND);
1465 }
1466
1467 return S_OK;
1468}
unsigned int UINT
Definition: ndis.h:50
@ FVM_LAST
Definition: shobjidl.idl:683
@ FVM_FIRST
Definition: shobjidl.idl:675
#define FCIDM_SHVIEW_BIGICON
Definition: shresdef.h:836
#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().

◆ ContextSensitiveHelp()

HRESULT WINAPI CDefView::ContextSensitiveHelp ( BOOL  fEnterMode)
override

Implements IOleWindow.

Definition at line 2430 of file CDefView.cpp.

2431{
2432 FIXME("(%p) stub\n", this);
2433
2434 return E_NOTIMPL;
2435}

◆ CreateList()

BOOL CDefView::CreateList ( )

Definition at line 629 of file CDefView.cpp.

630{
631 HRESULT hr;
632 DWORD dwStyle, dwExStyle, ListExStyle;
633 UINT ViewMode;
634
635 TRACE("%p\n", this);
636
638 LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_AUTOARRANGE; // FIXME: Why is LVS_AUTOARRANGE here?
639 dwExStyle = WS_EX_CLIENTEDGE;
640 ListExStyle = 0;
641
643 {
645 dwStyle |= LVS_ALIGNLEFT;
646 }
647 else
648 {
649 dwStyle |= LVS_SHOWSELALWAYS; // MSDN says FWF_SHOWSELALWAYS is deprecated, always turn on for folders
651 ListExStyle = LVS_EX_DOUBLEBUFFER;
652 }
653
654 ViewMode = m_FolderSettings.ViewMode;
655 hr = _DoFolderViewCB(SFVM_DEFVIEWMODE, 0, (LPARAM)&ViewMode);
656 if (SUCCEEDED(hr))
657 {
658 if (ViewMode >= FVM_FIRST && ViewMode <= FVM_LAST)
659 m_FolderSettings.ViewMode = ViewMode;
660 else
661 ERR("Ignoring invalid ViewMode from SFVM_DEFVIEWMODE: %u (was: %u)\n", ViewMode, m_FolderSettings.ViewMode);
662 }
663
665 {
666 case FVM_ICON:
667 dwStyle |= LVS_ICON;
668 break;
669 case FVM_DETAILS:
670 dwStyle |= LVS_REPORT;
671 break;
672 case FVM_SMALLICON:
673 dwStyle |= LVS_SMALLICON;
674 break;
675 case FVM_LIST:
676 dwStyle |= LVS_LIST;
677 break;
678 default:
679 dwStyle |= LVS_LIST;
680 break;
681 }
682
684 dwStyle |= LVS_AUTOARRANGE;
685
687 ListExStyle |= LVS_EX_SNAPTOGRID;
688
690 dwStyle |= LVS_SINGLESEL;
691
693 ListExStyle |= LVS_EX_FULLROWSELECT;
694
697
699 dwStyle |= LVS_NOCOLUMNHEADER;
700
701#if 0
702 // FIXME: Because this is a negative, everyone gets the new flag by default unless they
703 // opt out. This code should be enabled when shell looks like Vista instead of 2003
705 ListExStyle |= LVS_EX_HEADERINALLVIEWS;
706#endif
707
709 dwExStyle &= ~WS_EX_CLIENTEDGE;
710
711 RECT rcListView = {0,0,0,0};
712 m_ListView.Create(m_hWnd, rcListView, L"FolderView", dwStyle, dwExStyle, ID_LISTVIEW);
713
714 if (!m_ListView)
715 return FALSE;
716
718
722
723 /* UpdateShellSettings(); */
724 return TRUE;
725}
#define ID_LISTVIEW
Definition: CDefView.cpp:411
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 SUCCEEDED(hr)
Definition: intsafe.h:50
#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:2735
#define LVS_SINGLESEL
Definition: commctrl.h:2266
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2270
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2267
#define LVS_REPORT
Definition: commctrl.h:2262
#define LVS_SMALLICON
Definition: commctrl.h:2263
#define LVS_ALIGNTOP
Definition: commctrl.h:2279
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define LVS_EX_TRACKSELECT
Definition: commctrl.h:2732
#define LVS_EDITLABELS
Definition: commctrl.h:2273
#define LVS_EX_DOUBLEBUFFER
Definition: commctrl.h:2745
#define LVS_LIST
Definition: commctrl.h:2264
#define SFVM_DEFVIEWMODE
Definition: shlobj.h:1311
@ FWF_SNAPTOGRID
Definition: shobjidl.idl:639
@ FWF_AUTOARRANGE
Definition: shobjidl.idl:637
@ FWF_ALIGNLEFT
Definition: shobjidl.idl:648
@ FWF_NOSCROLL
Definition: shobjidl.idl:647
@ FWF_NOHEADERINALLVIEWS
Definition: shobjidl.idl:661
@ FWF_SINGLECLICKACTIVATE
Definition: shobjidl.idl:652
@ FWF_FULLROWSELECT
Definition: shobjidl.idl:658
@ FWF_NOCLIENTEDGE
Definition: shobjidl.idl:646
@ FWF_SINGLESEL
Definition: shobjidl.idl:643
@ FWF_NOCOLUMNHEADER
Definition: shobjidl.idl:660
@ FWF_DESKTOP
Definition: shobjidl.idl:642
@ FVM_SMALLICON
Definition: shobjidl.idl:676
@ FVM_ICON
Definition: shobjidl.idl:674
#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 2495 of file CDefView.cpp.

2496{
2497 return CreateViewWindow3(psb, lpPrevView, SV3CVW3_DEFAULT,
2498 (FOLDERFLAGS)lpfs->fFlags, (FOLDERFLAGS)lpfs->fFlags, (FOLDERVIEWMODE)lpfs->ViewMode, NULL, prcView, phWnd);
2499}
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:2914
FOLDERFLAGS
Definition: shobjidl.idl:636
FOLDERVIEWMODE
Definition: shobjidl.idl:672

◆ CreateViewWindow2()

HRESULT STDMETHODCALLTYPE CDefView::CreateViewWindow2 ( LPSV2CVW2_PARAMS  view_params)
override

Implements IShellView2.

Definition at line 2907 of file CDefView.cpp.

2908{
2909 return CreateViewWindow3(view_params->psbOwner, view_params->psvPrev,
2910 SV3CVW3_DEFAULT, (FOLDERFLAGS)view_params->pfs->fFlags, (FOLDERFLAGS)view_params->pfs->fFlags,
2911 (FOLDERVIEWMODE)view_params->pfs->ViewMode, view_params->pvid, view_params->prcView, &view_params->hwndView);
2912}

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

2915{
2916 OLEMENUGROUPWIDTHS omw = { { 0, 0, 0, 0, 0, 0 } };
2917
2918 *hwnd = NULL;
2919
2920 TRACE("(%p)->(shlview=%p shlbrs=%p rec=%p hwnd=%p vmode=%x flags=%x)\n", this, psvPrevious, psb, prcView, hwnd, mode, flags);
2921 if (prcView != NULL)
2922 TRACE("-- left=%i top=%i right=%i bottom=%i\n", prcView->left, prcView->top, prcView->right, prcView->bottom);
2923
2924 /* Validate the Shell Browser */
2925 if (psb == NULL || m_hWnd)
2926 return E_UNEXPECTED;
2927
2928 if (view_flags != SV3CVW3_DEFAULT)
2929 FIXME("unsupported view flags 0x%08x\n", view_flags);
2930
2931 /* Set up the member variables */
2932 m_pShellBrowser = psb;
2935
2936 if (view_id)
2937 {
2938 if (IsEqualIID(*view_id, VID_LargeIcons))
2940 else if (IsEqualIID(*view_id, VID_SmallIcons))
2942 else if (IsEqualIID(*view_id, VID_List))
2944 else if (IsEqualIID(*view_id, VID_Details))
2946 else if (IsEqualIID(*view_id, VID_Thumbnails))
2948 else if (IsEqualIID(*view_id, VID_Tile))
2950 else if (IsEqualIID(*view_id, VID_ThumbStrip))
2952 else
2953 FIXME("Ignoring unrecognized VID %s\n", debugstr_guid(view_id));
2954 }
2955
2956 /* Get our parent window */
2957 m_pShellBrowser->GetWindow(&m_hWndParent);
2958
2959 /* Try to get the ICommDlgBrowserInterface, adds a reference !!! */
2962 {
2963 TRACE("-- CommDlgBrowser\n");
2964 }
2965
2966 RECT rcView = *prcView;
2968 if (m_hWnd == NULL)
2969 return E_FAIL;
2970
2971 *hwnd = m_hWnd;
2972
2973 CheckToolbar();
2974
2975 if (!*hwnd)
2976 return E_FAIL;
2977
2979
2981 UpdateWindow();
2982
2983 if (!m_hMenu)
2984 {
2985 m_hMenu = CreateMenu();
2986 m_pShellBrowser->InsertMenusSB(m_hMenu, &omw);
2987 TRACE("-- after fnInsertMenusSB\n");
2988 }
2989
2990 _MergeToolbar();
2991
2992 return S_OK;
2993}
#define U(x)
Definition: wordpad.c:45
@ Create
Definition: registry.c:563
BOOL UpdateWindow()
Definition: atlwin.h:1345
HRESULT _MergeToolbar()
Definition: CDefView.cpp:3791
void CheckToolbar()
Definition: CDefView.cpp:530
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum mode
Definition: glext.h:6217
GLbitfield flags
Definition: glext.h:7161
#define debugstr_guid
Definition: kernel32.h:35
#define WS_CHILD
Definition: pedump.c:617
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SFVM_WINDOWCREATED
Definition: shlobj.h:1301
@ FVM_TILE
Definition: shobjidl.idl:680
@ FVM_THUMBNAIL
Definition: shobjidl.idl:679
@ FVM_THUMBSTRIP
Definition: shobjidl.idl:681
_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:1244
#define SWP_NOSIZE
Definition: winuser.h:1245
#define HWND_TOP
Definition: winuser.h:1207
#define SWP_SHOWWINDOW
Definition: winuser.h:1248

Referenced by CreateViewWindow(), and CreateViewWindow2().

◆ DestroyViewWindow()

HRESULT WINAPI CDefView::DestroyViewWindow ( )
override

Implements IShellView.

Definition at line 2501 of file CDefView.cpp.

2502{
2503 TRACE("(%p)\n", this);
2504
2505 /* Make absolutely sure all our UI is cleaned up */
2507
2508 if (m_hAccel)
2509 {
2510 // MSDN: Accelerator tables loaded from resources are freed automatically when application terminates
2511 m_hAccel = NULL;
2512 }
2513
2515 {
2518 }
2519
2520 if (m_hMenuViewModes)
2521 {
2524 }
2525
2526 if (m_hMenu)
2527 {
2529 m_hMenu = NULL;
2530 }
2531
2532 if (m_ListView)
2533 {
2534 m_ListView.DestroyWindow();
2535 }
2536
2537 if (m_hWnd)
2538 {
2540 DestroyWindow();
2541 }
2542
2545
2546 return S_OK;
2547}
#define SFVM_WINDOWCLOSING
void Release()
Definition: atlcomcli.h:170
BOOL DestroyWindow()
Definition: atlwin.h:462
STDMETHOD() UIActivate(UINT uState) override
Definition: CDefView.cpp:2460
@ SVUIA_DEACTIVATE
Definition: shobjidl.idl:748
BOOL WINAPI DestroyMenu(_In_ HMENU)

Referenced by ~CDefView().

◆ DoActivate()

void CDefView::DoActivate ( UINT  uState)

Definition at line 1759 of file CDefView.cpp.

1760{
1761 TRACE("%p uState=%x\n", this, uState);
1762
1763 // don't do anything if the state isn't really changing
1764 if (m_uState == uState)
1765 {
1766 return;
1767 }
1768
1769 if (uState == SVUIA_DEACTIVATE)
1770 {
1771 OnDeactivate();
1772 }
1773 else
1774 {
1776 {
1777 FillEditMenu();
1778 FillViewMenu();
1779 m_pShellBrowser->SetMenuSB(m_hMenu, 0, m_hWnd);
1781 }
1782
1783 if (SVUIA_ACTIVATE_FOCUS == uState)
1784 {
1785 m_ListView.SetFocus();
1786 }
1787 }
1788
1789 m_uState = uState;
1790 TRACE("--\n");
1791}
HRESULT FillEditMenu()
Definition: CDefView.cpp:1385
void OnDeactivate()
Definition: CDefView.cpp:1748
HRESULT FillViewMenu()
Definition: CDefView.cpp:1402
@ SVUIA_ACTIVATE_FOCUS
Definition: shobjidl.idl:750

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

◆ drag_notify_subitem()

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

Definition at line 3309 of file CDefView.cpp.

3310{
3311 LONG lResult;
3312 HRESULT hr;
3313 RECT clientRect;
3314
3315 /* The key state on drop doesn't have MK_LBUTTON or MK_RBUTTON because it
3316 reflects the key state after the user released the button, so we need
3317 to remember the last key state when the button was pressed */
3318 m_grfKeyState = grfKeyState;
3319
3320 // Map from global to client coordinates and query the index of the
3321 // listview-item, which is currently under the mouse cursor.
3322 LVHITTESTINFO htinfo = {{pt.x, pt.y}, LVHT_ONITEM};
3323 ScreenToClient(&htinfo.pt);
3324 lResult = m_ListView.HitTest(&htinfo);
3325
3326 /* Send WM_*SCROLL messages every 250 ms during drag-scrolling */
3327 ::GetClientRect(m_ListView, &clientRect);
3328 if (htinfo.pt.x == m_ptLastMousePos.x && htinfo.pt.y == m_ptLastMousePos.y &&
3329 (htinfo.pt.x < SCROLLAREAWIDTH || htinfo.pt.x > clientRect.right - SCROLLAREAWIDTH ||
3330 htinfo.pt.y < SCROLLAREAWIDTH || htinfo.pt.y > clientRect.bottom - SCROLLAREAWIDTH))
3331 {
3332 m_cScrollDelay = (m_cScrollDelay + 1) % 5; // DragOver is called every 50 ms
3333 if (m_cScrollDelay == 0)
3334 {
3335 /* Mouse did hover another 250 ms over the scroll-area */
3336 if (htinfo.pt.x < SCROLLAREAWIDTH)
3337 m_ListView.SendMessageW(WM_HSCROLL, SB_LINEUP, 0);
3338
3339 if (htinfo.pt.x > clientRect.right - SCROLLAREAWIDTH)
3340 m_ListView.SendMessageW(WM_HSCROLL, SB_LINEDOWN, 0);
3341
3342 if (htinfo.pt.y < SCROLLAREAWIDTH)
3343 m_ListView.SendMessageW(WM_VSCROLL, SB_LINEUP, 0);
3344
3345 if (htinfo.pt.y > clientRect.bottom - SCROLLAREAWIDTH)
3346 m_ListView.SendMessageW(WM_VSCROLL, SB_LINEDOWN, 0);
3347 }
3348 }
3349 else
3350 {
3351 m_cScrollDelay = 0; // Reset, if cursor is not over the listview's scroll-area
3352 }
3353
3354 m_ptLastMousePos = htinfo.pt;
3356
3357 /* We need to check if we drag the selection over itself */
3358 if (lResult != -1 && m_pSourceDataObject.p != NULL)
3359 {
3360 PCUITEMID_CHILD pidl = _PidlByItem(lResult);
3361
3362 for (UINT i = 0; i < m_cidl; i++)
3363 {
3364 if (pidl == m_apidl[i])
3365 {
3366 /* The item that is being draged is hovering itself. */
3367 lResult = -1;
3368 break;
3369 }
3370 }
3371 }
3372
3373 // If we are still over the previous sub-item, notify it via DragOver and return
3374 if (m_pCurDropTarget && lResult == m_iDragOverItem)
3375 return m_pCurDropTarget->DragOver(grfKeyState, pt, pdwEffect);
3376
3377 // We've left the previous sub-item, notify it via DragLeave and release it
3378 if (m_pCurDropTarget)
3379 {
3381 if (pidl)
3382 SelectItem(pidl, 0);
3383
3384 m_pCurDropTarget->DragLeave();
3386 }
3387
3388 m_iDragOverItem = lResult;
3389
3390 if (lResult == -1)
3391 {
3392 // We are not above one of the listview's subitems. Bind to the
3393 // parent folder's DropTarget interface.
3395 }
3396 else
3397 {
3398 // Query the relative PIDL of the shellfolder object represented
3399 // by the currently dragged over listview-item ...
3400 PCUITEMID_CHILD pidl = _PidlByItem(lResult);
3401
3402 // ... and bind m_pCurDropTarget to the IDropTarget interface of an UIObject of this object
3403 hr = m_pSFParent->GetUIObjectOf(m_ListView, 1, &pidl, IID_NULL_PPV_ARG(IDropTarget, &m_pCurDropTarget));
3404 }
3405
3407
3408 // If anything failed, m_pCurDropTarget should be NULL now, which ought to be a save state
3409 if (FAILED(hr))
3410 {
3411 *pdwEffect = DROPEFFECT_NONE;
3412 return hr;
3413 }
3414
3415 if (m_iDragOverItem != -1)
3416 {
3417 SelectItem(m_iDragOverItem, SVSI_SELECT);
3418 }
3419
3420 // Notify the item just entered via DragEnter
3421 return m_pCurDropTarget->DragEnter(m_pCurDataObject, grfKeyState, pt, pdwEffect);
3422}
#define SCROLLAREAWIDTH
Definition: CDefView.cpp:3307
static void ClientToListView(HWND hwndLV, POINT *ppt)
Definition: CDefView.cpp:59
CComPtr< IDataObject > m_pCurDataObject
Definition: CDefView.cpp:137
STDMETHOD() SelectItem(PCUITEMID_CHILD pidlItem, SVSIF uFlags) override
Definition: CDefView.cpp:2575
CComPtr< IDataObject > m_pSourceDataObject
Definition: CDefView.cpp:135
CComPtr< IDropTarget > m_pCurDropTarget
Definition: CDefView.cpp:136
PCUITEMID_CHILD _PidlByItem(int i)
Definition: CDefView.cpp:887
DWORD m_grfKeyState
Definition: CDefView.cpp:142
int HitTest(LV_HITTESTINFO *phtInfo)
Definition: rosctrls.h:199
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1407
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
long LONG
Definition: pedump.c:60
#define LVHT_ONITEM
Definition: commctrl.h:2497
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:1743
#define WM_VSCROLL
Definition: winuser.h:1744
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 3424 of file CDefView.cpp.

3425{
3426 if (*pdwEffect == DROPEFFECT_NONE)
3427 return S_OK;
3428
3429 /* Get a hold on the data object for later calls to DragEnter on the sub-folders */
3430 m_pCurDataObject = pDataObject;
3431
3432 HRESULT hr = drag_notify_subitem(grfKeyState, pt, pdwEffect);
3433 if (SUCCEEDED(hr))
3434 {
3435 POINT ptClient = {pt.x, pt.y};
3436 ScreenToClient(&ptClient);
3437 ImageList_DragEnter(m_hWnd, ptClient.x, ptClient.y);
3438 }
3439
3440 return hr;
3441}
HRESULT drag_notify_subitem(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CDefView.cpp:3309
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 3451 of file CDefView.cpp.

3452{
3454
3455 if (m_pCurDropTarget)
3456 {
3457 m_pCurDropTarget->DragLeave();
3459 }
3460
3461 if (m_pCurDataObject != NULL)
3462 {
3464 }
3465
3466 m_iDragOverItem = 0;
3467
3468 return S_OK;
3469}
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 3443 of file CDefView.cpp.

3444{
3445 POINT ptClient = {pt.x, pt.y};
3446 ScreenToClient(&ptClient);
3447 ImageList_DragMove(ptClient.x, ptClient.y);
3448 return drag_notify_subitem(grfKeyState, pt, pdwEffect);
3449}
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 3726 of file CDefView.cpp.

3727{
3728 FIXME("Stub: this=%p\n", this);
3729 return E_NOTIMPL;
3730}

◆ Drop()

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

Implements IDropTarget.

Definition at line 3655 of file CDefView.cpp.

3656{
3659
3660 if ((IsDropOnSource(NULL) == S_OK) &&
3661 (*pdwEffect & DROPEFFECT_MOVE) &&
3663 {
3664 if (m_pCurDropTarget)
3665 {
3666 m_pCurDropTarget->DragLeave();
3668 }
3669
3670 POINT ptDrop = { pt.x, pt.y };
3671 ::ScreenToClient(m_ListView, &ptDrop);
3673 m_ptLastMousePos = ptDrop;
3674
3676 if (m_ListView.GetStyle() & LVS_AUTOARRANGE)
3677 {
3679 }
3680 else
3681 {
3682 POINT ptItem;
3683 INT iItem = -1;
3684 while ((iItem = m_ListView.GetNextItem(iItem, LVNI_SELECTED)) >= 0)
3685 {
3686 if (m_ListView.GetItemPosition(iItem, &ptItem))
3687 {
3690 m_ListView.SetItemPosition(iItem, &ptItem);
3691 }
3692 }
3693 }
3695 }
3696 else if (m_pCurDropTarget)
3697 {
3698 m_pCurDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect);
3700 }
3701
3703 m_iDragOverItem = 0;
3704 return S_OK;
3705}
POINT m_ptFirstMousePos
Definition: CDefView.cpp:141
STDMETHOD() IsDropOnSource(IDropTarget *drop_target) override
Definition: CDefView.cpp:3136
void _MoveSelectionOnAutoArrange(POINT pt)
Definition: CDefView.cpp:3595
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:2367

◆ EnableModeless()

HRESULT WINAPI CDefView::EnableModeless ( BOOL  fEnable)
override

Implements IShellView.

Definition at line 2454 of file CDefView.cpp.

2455{
2456 FIXME("(%p)\n", this);
2457 return E_NOTIMPL;
2458}

◆ Exec()

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

Implements IOleCommandTarget.

Definition at line 3246 of file CDefView.cpp.

3247{
3248 FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08x Opt:0x%08x %p %p)\n",
3249 this, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, pvaIn, pvaOut);
3250
3251 if (!pguidCmdGroup)
3252 return OLECMDERR_E_UNKNOWNGROUP;
3253
3254 if (IsEqualCLSID(*pguidCmdGroup, m_Category))
3255 {
3256 if (nCmdID == FCIDM_SHVIEW_AUTOARRANGE)
3257 {
3258 if (V_VT(pvaIn) != VT_INT_PTR)
3259 return OLECMDERR_E_NOTSUPPORTED;
3260
3262 params.cbSize = sizeof(params);
3263 params.rcExclude = *(RECT*) V_INTREF(pvaIn);
3264
3265 if (m_hMenuViewModes)
3266 {
3267 // Duplicate all but the last two items of the view modes menu
3268 HMENU hmenuViewPopup = CreatePopupMenu();
3269 Shell_MergeMenus(hmenuViewPopup, m_hMenuViewModes, 0, 0, 0xFFFF, 0);
3270 DeleteMenu(hmenuViewPopup, GetMenuItemCount(hmenuViewPopup) - 1, MF_BYPOSITION);
3271 DeleteMenu(hmenuViewPopup, GetMenuItemCount(hmenuViewPopup) - 1, MF_BYPOSITION);
3272 CheckViewMode(hmenuViewPopup);
3273 TrackPopupMenuEx(hmenuViewPopup, TPM_LEFTALIGN | TPM_TOPALIGN, params.rcExclude.left, params.rcExclude.bottom, m_hWndParent, &params);
3274 ::DestroyMenu(hmenuViewPopup);
3275 }
3276
3277 // pvaOut is VT_I4 with value 0x403 (cmd id of the new mode maybe?)
3278 V_VT(pvaOut) = VT_I4;
3279 V_I4(pvaOut) = 0x403;
3280 }
3281 }
3282
3283 if (IsEqualIID(*pguidCmdGroup, CGID_Explorer) &&
3284 (nCmdID == 0x29) &&
3285 (nCmdexecopt == 4) && pvaOut)
3286 return S_OK;
3287
3288 if (IsEqualIID(*pguidCmdGroup, CGID_ShellDocView) &&
3289 (nCmdID == 9) &&
3290 (nCmdexecopt == 0))
3291 return 1;
3292
3293 return OLECMDERR_E_UNKNOWNGROUP;
3294}
HRESULT CheckViewMode(HMENU hmenuView)
Definition: CDefView.cpp:1457
@ VT_I4
Definition: compat.h:2298
@ VT_INT_PTR
Definition: compat.h:2327
GLenum const GLfloat * params
Definition: glext.h:5645
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#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
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define FCIDM_SHVIEW_AUTOARRANGE
Definition: shresdef.h:841
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
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:2383
#define TPM_LEFTALIGN
Definition: winuser.h:2377
#define MF_BYPOSITION
Definition: winuser.h:203

◆ fill_list()

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

Definition at line 1017 of file CDefView.cpp.

1018{
1019 PITEMID_CHILD pidl = static_cast<PITEMID_CHILD>(ptr);
1020 CDefView *pThis = static_cast<CDefView *>(arg);
1021
1022 // in a commdlg this works as a filemask
1023 if (pThis->IncludeObject(pidl) == S_OK && pThis->m_ListView)
1024 pThis->LV_AddItem(pidl);
1025
1026 SHFree(pidl);
1027 return TRUE;
1028}
HRESULT IncludeObject(PCUITEMID_CHILD pidl)
Definition: CDefView.cpp:483
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 1418 of file CDefView.cpp.

1419{
1420 /* We only need to fill this once */
1421 if (GetMenuItemID(hmenuArrange, 0) == FCIDM_SHVIEW_AUTOARRANGE)
1422 {
1423 Shell_MergeMenus(hmenuArrange, m_hMenuArrangeModes, 0, 0, 0xFFFF,0);
1424 }
1425
1426 /* Also check the menu item according to which we sort */
1427 CheckMenuRadioItem(hmenuArrange,
1428 0x30,
1429 0x100,
1430 m_sortInfo.nHeaderID + 0x30,
1431 MF_BYCOMMAND);
1432
1434 {
1437 }
1438 else
1439 {
1442
1443 if (GetAutoArrange() == S_OK)
1445 else
1447
1448 if (_GetSnapToGrid() == S_OK)
1450 else
1452 }
1453
1454 return S_OK;
1455}
STDMETHOD() GetAutoArrange() override
Definition: CDefView.cpp:2835
HRESULT _GetSnapToGrid()
Definition: CDefView.cpp:2840
#define FCIDM_SHVIEW_ALIGNTOGRID
Definition: shresdef.h:843
#define MF_CHECKED
Definition: winuser.h:132
UINT WINAPI GetMenuItemID(_In_ HMENU, _In_ int)
#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)
#define MF_GRAYED
Definition: winuser.h:129

Referenced by OnInitMenuPopup().

◆ FillEditMenu()

HRESULT CDefView::FillEditMenu ( )

Definition at line 1385 of file CDefView.cpp.

1386{
1388 if (!hEditMenu)
1389 return E_FAIL;
1390
1391 HMENU hmenuContents = ::LoadMenuW(shell32_hInstance, L"MENU_003");
1392 if (!hmenuContents)
1393 return E_FAIL;
1394
1395 Shell_MergeMenus(hEditMenu, hmenuContents, 0, 0, 0xFFFF, 0);
1396
1397 ::DestroyMenu(hmenuContents);
1398
1399 return S_OK;
1400}
HMENU GetSubmenuByID(HMENU hmenu, UINT id)
Definition: CDefView.cpp:1325
#define FCIDM_MENU_EDIT
Definition: shlobj.h:624
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)

Referenced by DoActivate().

◆ FillFileMenu()

HRESULT CDefView::FillFileMenu ( )

Definition at line 1345 of file CDefView.cpp.

1346{
1348 if (!hFileMenu)
1349 return E_FAIL;
1350
1351 /* Cleanup the items added previously */
1352 for (int i = GetMenuItemCount(hFileMenu) - 1; i >= 0; i--)
1353 {
1354 UINT id = GetMenuItemID(hFileMenu, i);
1355 if (id < FCIDM_BROWSERFIRST || id > FCIDM_BROWSERLAST)
1356 DeleteMenu(hFileMenu, i, MF_BYPOSITION);
1357 }
1358
1359 // In case we still have this left over, clean it up
1360 if (m_pFileMenu)
1361 {
1364 }
1365 // Store context menu in m_pFileMenu and keep it to invoke the selected command later on
1368 return hr;
1369
1371
1372 hr = m_pFileMenu->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0);
1374 return hr;
1375
1376 // TODO: filter or something
1377
1378 Shell_MergeMenus(hFileMenu, hmenu, 0, 0, 0xFFFF, MM_ADDSEPARATOR | MM_SUBMENUSHAVEIDS);
1379
1381
1382 return S_OK;
1383}
STDMETHOD() GetItemObject(UINT uItem, REFIID riid, void **ppv) override
Definition: CDefView.cpp:2631
CComPtr< IContextMenu > m_pFileMenu
Definition: CDefView.cpp:145
@ SVGIO_SELECTION
Definition: shobjidl.idl:739
#define FCIDM_BROWSERLAST
Definition: shlobj.h:616
#define MM_SUBMENUSHAVEIDS
Definition: shlobj.h:2514
#define FCIDM_MENU_FILE
Definition: shlobj.h:623
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:573
#define MM_ADDSEPARATOR
Definition: shlobj.h:2513
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:607
static HMENU hmenu
Definition: win.c:66

Referenced by OnInitMenuPopup().

◆ FillList()

HRESULT CDefView::FillList ( )

Definition at line 1034 of file CDefView.cpp.

1035{
1036 CComPtr<IEnumIDList> pEnumIDList;
1037 PITEMID_CHILD pidl;
1038 DWORD dwFetched;
1039 HRESULT hRes;
1040 HDPA hdpa;
1041 DWORD dFlags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS;
1042 DWORD dwValue, cbValue;
1043
1044 TRACE("%p\n", this);
1045
1046 // determine if there is a setting to show all the hidden files/folders
1047 dwValue = 1;
1048 cbValue = sizeof(dwValue);
1050 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
1051 L"Hidden", NULL, &dwValue, &cbValue);
1052 if (dwValue == 1)
1053 {
1054 dFlags |= SHCONTF_INCLUDEHIDDEN;
1055 m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
1056 }
1057
1058 dwValue = 0;
1059 cbValue = sizeof(dwValue);
1061 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
1062 L"ShowSuperHidden", NULL, &dwValue, &cbValue);
1063 if (dwValue)
1064 {
1065 dFlags |= SHCONTF_INCLUDESUPERHIDDEN;
1066 m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
1067 }
1068
1069 // get the itemlist from the shfolder
1070 hRes = m_pSFParent->EnumObjects(m_hWnd, dFlags, &pEnumIDList);
1071 if (hRes != S_OK)
1072 {
1073 if (hRes == S_FALSE)
1074 return(NOERROR);
1075 return(hRes);
1076 }
1077
1078 // create a pointer array
1079 hdpa = DPA_Create(16);
1080 if (!hdpa)
1081 return(E_OUTOFMEMORY);
1082
1083 // copy the items into the array
1084 while((S_OK == pEnumIDList->Next(1, &pidl, &dwFetched)) && dwFetched)
1085 {
1086 if (DPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
1087 {
1088 SHFree(pidl);
1089 }
1090 }
1091
1092 // turn listview's redrawing off
1094
1095 DPA_DestroyCallback( hdpa, fill_list, this);
1096
1097 /* sort the array */
1098 if (m_pSF2Parent)
1099 {
1100 m_pSF2Parent->GetDefaultColumn(NULL, (ULONG*)&m_sortInfo.nHeaderID, NULL);
1101 }
1102 else
1103 {
1104 FIXME("no m_pSF2Parent\n");
1105 }
1107 _Sort();
1108
1110 {
1113 }
1114
1115 // load custom background image and custom text color
1118
1119 // turn listview's redrawing back on and force it to draw
1121
1123
1125 {
1126 // redraw now
1127 m_ListView.InvalidateRect(NULL, TRUE);
1128 }
1129
1131
1132 return S_OK;
1133}
#define SFVM_GET_CUSTOMVIEWINFO
#define SFVM_LISTREFRESHED
static INT CALLBACK fill_list(LPVOID ptr, LPVOID arg)
Definition: CDefView.cpp:1017
void UpdateListColors()
Definition: CDefView.cpp:727
BOOL _Sort()
Definition: CDefView.cpp:853
CComPtr< IShellFolder2 > m_pSF2Parent
Definition: CDefView.cpp:111
void WINAPI DPA_DestroyCallback(HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
Definition: dpa.c:1003
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:591
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1236
#define LVM_SETCALLBACKMASK
Definition: commctrl.h:2419
#define LVIS_CUT
Definition: commctrl.h:2320
Definition: dpa.c:49
uint32_t ULONG
Definition: typedefs.h:59
#define NOERROR
Definition: winerror.h:2354
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by OnCreate(), and Refresh().

◆ FillViewMenu()

HRESULT CDefView::FillViewMenu ( )

Definition at line 1402 of file CDefView.cpp.

1403{
1405 if (!hViewMenu)
1406 return E_FAIL;
1407
1409 if (!m_hMenuViewModes)
1410 return E_FAIL;
1411
1414
1415 return S_OK;
1416}
DWORD WINAPI SHMenuIndexFromID(HMENU hMenu, UINT uID)
Definition: ordinal.c:4504
#define FCIDM_MENU_VIEW_SEP_OPTIONS
Definition: shlobj.h:626
#define MM_DONTREMOVESEPS
Definition: shlobj.h:2515
#define FCIDM_MENU_VIEW
Definition: shlobj.h:625

Referenced by DoActivate().

◆ Freeze()

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

Implements IViewObject.

Definition at line 3738 of file CDefView.cpp.

3739{
3740 FIXME("Stub: this=%p\n", this);
3741 return E_NOTIMPL;
3742}

◆ GetAdvise()

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

Implements IViewObject.

Definition at line 3762 of file CDefView.cpp.

3763{
3764 TRACE("this=%p pAspects=%p pAdvf=%p ppAdvSink=%p\n", this, pAspects, pAdvf, ppAdvSink);
3765
3766 if (ppAdvSink)
3767 {
3768 *ppAdvSink = m_pAdvSink;
3769 m_pAdvSink.p->AddRef();
3770 }
3771
3772 if (pAspects)
3773 *pAspects = m_dwAspects;
3774
3775 if (pAdvf)
3776 *pAdvf = m_dwAdvf;
3777
3778 return S_OK;
3779}
CComPtr< IAdviseSink > m_pAdvSink
Definition: CDefView.cpp:133
ULONG AddRef()

◆ GetArrangeParam()

HRESULT STDMETHODCALLTYPE CDefView::GetArrangeParam ( LPARAM sort)
override

Definition at line 3015 of file CDefView.cpp.

3016{
3017 FIXME("(%p)->(%p) stub\n", this, sort);
3018 return E_NOTIMPL;
3019}
_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 2835 of file CDefView.cpp.

2836{
2837 return ((m_ListView.GetStyle() & LVS_AUTOARRANGE) ? S_OK : S_FALSE);
2838}

Referenced by FillArrangeAsMenu(), and OnCommand().

◆ GetColorSet()

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

Implements IViewObject.

Definition at line 3732 of file CDefView.cpp.

3733{
3734 FIXME("Stub: this=%p\n", this);
3735 return E_NOTIMPL;
3736}

◆ GetCurrentInfo()

HRESULT WINAPI CDefView::GetCurrentInfo ( LPFOLDERSETTINGS  pfs)
override

Implements IShellView.

Definition at line 2549 of file CDefView.cpp.

2550{
2551 TRACE("(%p)->(%p) vmode=%x flags=%x\n", this, lpfs,
2553
2554 if (!lpfs)
2555 return E_INVALIDARG;
2556
2557 *lpfs = m_FolderSettings;
2558 return S_OK;
2559}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ GetCurrentViewMode()

HRESULT STDMETHODCALLTYPE CDefView::GetCurrentViewMode ( UINT pViewMode)
override

Implements IFolderView.

Definition at line 2681 of file CDefView.cpp.

2682{
2683 TRACE("(%p)->(%p), stub\n", this, pViewMode);
2684
2685 if (!pViewMode)
2686 return E_INVALIDARG;
2687
2688 *pViewMode = m_FolderSettings.ViewMode;
2689 return S_OK;
2690}

◆ GetDefaultSpacing()

HRESULT STDMETHODCALLTYPE CDefView::GetDefaultSpacing ( POINT ppt)
override

Implements IFolderView.

Definition at line 2830 of file CDefView.cpp.

2831{
2832 return E_NOTIMPL;
2833}

◆ GetDragPoint()

HRESULT STDMETHODCALLTYPE CDefView::GetDragPoint ( POINT pt)
override

Definition at line 3147 of file CDefView.cpp.

3148{
3149 if (!pt)
3150 return E_INVALIDARG;
3151
3153 return S_OK;
3154}

◆ GetDropPoint()

HRESULT STDMETHODCALLTYPE CDefView::GetDropPoint ( POINT pt)
override

Definition at line 3156 of file CDefView.cpp.

3157{
3158 FIXME("(%p)->(%p) stub\n", this, pt);
3159 return E_NOTIMPL;
3160}

◆ GetFocusedItem()

HRESULT STDMETHODCALLTYPE CDefView::GetFocusedItem ( int piItem)
override

Implements IFolderView.

Definition at line 2783 of file CDefView.cpp.

2784{
2785 TRACE("(%p)->(%p)\n", this, piItem);
2786
2787 *piItem = m_ListView.GetNextItem(-1, LVNI_FOCUSED);
2788
2789 return S_OK;
2790}
#define LVNI_FOCUSED
Definition: commctrl.h:2423

◆ GetFolder()

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

Implements IFolderView.

Definition at line 2736 of file CDefView.cpp.

2737{
2738 if (m_pSFParent == NULL)
2739 return E_FAIL;
2740
2741 return m_pSFParent->QueryInterface(riid, ppv);
2742}
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 2631 of file CDefView.cpp.

2632{
2634
2635 TRACE("(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n", this, uItem, debugstr_guid(&riid), ppvOut);
2636
2637 if (!ppvOut)
2638 return E_INVALIDARG;
2639
2640 *ppvOut = NULL;
2641
2642 switch (uItem)
2643 {
2644 case SVGIO_BACKGROUND:
2645 if (IsEqualIID(riid, IID_IContextMenu))
2646 {
2649 return hr;
2650
2651 IUnknown_SetSite(*((IUnknown**)ppvOut), (IShellView *)this);
2652 }
2653 else if (IsEqualIID(riid, IID_IDispatch))
2654 {
2656 {
2659 return hr;
2660 }
2661 hr = m_pShellFolderViewDual->QueryInterface(riid, ppvOut);
2662 }
2663 break;
2664 case SVGIO_SELECTION:
2665 GetSelections();
2666 hr = m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl, m_apidl, riid, 0, ppvOut);
2668 return hr;
2669
2670 if (IsEqualIID(riid, IID_IContextMenu))
2671 IUnknown_SetSite(*((IUnknown**)ppvOut), (IShellView *)this);
2672
2673 break;
2674 }
2675
2676 TRACE("-- (%p)->(interface=%p)\n", this, *ppvOut);
2677
2678 return hr;
2679}
HRESULT CDefViewBckgrndMenu_CreateInstance(IShellFolder *psf, REFIID riid, void **ppv)
HRESULT WINAPI CDefViewDual_Constructor(REFIID riid, LPVOID *ppvOut)
CComPtr< IShellFolderViewDual > m_pShellFolderViewDual
Definition: CDefView.cpp:115
@ SVGIO_BACKGROUND
Definition: shobjidl.idl:738
const GUID IID_IDispatch
#define E_NOINTERFACE
Definition: winerror.h:2364

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

◆ GetItemPosition()

HRESULT STDMETHODCALLTYPE CDefView::GetItemPosition ( PCUITEMID_CHILD  pidl,
POINT ppt 
)
override

Implements IFolderView.

Definition at line 2792 of file CDefView.cpp.

2793{
2794 if (!m_ListView)
2795 {
2796 ERR("!m_ListView\n");
2797 return E_FAIL;
2798 }
2799
2800 int lvIndex = LV_FindItemByPidl(pidl);
2801 if (lvIndex == -1 || ppt == NULL)
2802 return E_INVALIDARG;
2803
2804 m_ListView.GetItemPosition(lvIndex, ppt);
2805 return S_OK;
2806}
int LV_FindItemByPidl(PCUITEMID_CHILD pidl)
Definition: CDefView.cpp:901

◆ GetItemSpacing()

HRESULT STDMETHODCALLTYPE CDefView::GetItemSpacing ( ITEMSPACING spacing)
override

Definition at line 3192 of file CDefView.cpp.

3193{
3194 FIXME("(%p)->(%p) stub\n", this, spacing);
3195 return E_NOTIMPL;
3196}

◆ GetObject()

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

Definition at line 3046 of file CDefView.cpp.

3047{
3048 TRACE("(%p)->(%p %d)\n", this, pidl, item);
3049 return Item(item, pidl);
3050}
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

◆ GetObjectCount()

HRESULT STDMETHODCALLTYPE CDefView::GetObjectCount ( UINT count)
override

Definition at line 3076 of file CDefView.cpp.

3077{
3078 TRACE("(%p)->(%p)\n", this, count);
3080 return S_OK;
3081}
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ GetSelectedCount()

HRESULT STDMETHODCALLTYPE CDefView::GetSelectedCount ( UINT count)
override

Definition at line 3109 of file CDefView.cpp.

3110{
3111 FIXME("(%p)->(%p) stub\n", this, count);
3112 return E_NOTIMPL;
3113}

◆ GetSelectedObjects()

HRESULT STDMETHODCALLTYPE CDefView::GetSelectedObjects ( PCUITEMID_CHILD **  pidl,
UINT items 
)
override

Definition at line 3115 of file CDefView.cpp.

3116{
3117 TRACE("(%p)->(%p %p)\n", this, pidl, items);
3118
3119 *items = GetSelections();
3120
3121 if (*items)
3122 {
3123 *pidl = static_cast<PCUITEMID_CHILD *>(LocalAlloc(0, *items * sizeof(PCUITEMID_CHILD)));
3124 if (!*pidl)
3125 {
3126 return E_OUTOFMEMORY;
3127 }
3128
3129 /* it's documented that caller shouldn't PIDLs, only array itself */
3130 memcpy(*pidl, m_apidl, *items * sizeof(PCUITEMID_CHILD));
3131 }
3132
3133 return S_OK;
3134}
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static TCHAR * items[]
Definition: page1.c:45

◆ GetSelectionMarkedItem()

HRESULT STDMETHODCALLTYPE CDefView::GetSelectionMarkedItem ( int piItem)
override

Implements IFolderView.

Definition at line 2774 of file CDefView.cpp.

2775{
2776 TRACE("(%p)->(%p)\n", this, piItem);
2777
2778 *piItem = m_ListView.GetSelectionMark();
2779
2780 return S_OK;
2781}
int GetSelectionMark()
Definition: rosctrls.h:156

◆ GetSelections()

UINT CDefView::GetSelections ( )

Definition at line 1475 of file CDefView.cpp.

1476{
1477 SHFree(m_apidl);
1478
1480 m_apidl = static_cast<PCUITEMID_CHILD*>(SHAlloc(m_cidl * sizeof(PCUITEMID_CHILD)));
1481 if (!m_apidl)
1482 {
1483 m_cidl = 0;
1484 return 0;
1485 }
1486
1487 TRACE("-- Items selected =%u\n", m_cidl);
1488
1490
1491 UINT i = 0;
1492 int lvIndex = -1;
1493 while ((lvIndex = m_ListView.GetNextItem(lvIndex, LVNI_SELECTED)) > -1)
1494 {
1495 m_apidl[i] = _PidlByItem(lvIndex);
1496 i++;
1497 if (i == m_cidl)
1498 break;
1499 TRACE("-- selected Item found\n");
1500 }
1501
1502 return m_cidl;
1503}
UINT GetSelectedCount()
Definition: rosctrls.h:136
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
#define ASSERT(a)
Definition: mode.c:44

Referenced by _DoCopyToMoveToFolder(), GetItemObject(), GetSelectedObjects(), OnInitMenuPopup(), and OnNotify().

◆ GetSpacing()

HRESULT STDMETHODCALLTYPE CDefView::GetSpacing ( POINT ppt)
override

Implements IFolderView.

Definition at line 2808 of file CDefView.cpp.

2809{
2810 TRACE("(%p)->(%p)\n", this, ppt);
2811
2812 if (!m_ListView)
2813 {
2814 ERR("!m_ListView\n");
2815 return S_FALSE;
2816 }
2817
2818 if (ppt)
2819 {
2820 SIZE spacing;
2821 m_ListView.GetItemSpacing(spacing);
2822
2823 ppt->x = spacing.cx;
2824 ppt->y = spacing.cy;
2825 }
2826
2827 return S_OK;
2828}
void GetItemSpacing(SIZE &spacing, BOOL bSmallIconView=FALSE)
Definition: rosctrls.h:166
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28

◆ GetView()

HRESULT STDMETHODCALLTYPE CDefView::GetView ( SHELLVIEWID view_guid,
ULONG  view_type 
)
override

Implements IShellView2.

Definition at line 2901 of file CDefView.cpp.

2902{
2903 FIXME("(%p)->(%p, %lu) stub\n", this, view_guid, view_type);
2904 return E_NOTIMPL;
2905}
view_type

◆ GetWindow()

HRESULT WINAPI CDefView::GetWindow ( HWND lphwnd)
override

Implements IOleWindow.

Definition at line 2421 of file CDefView.cpp.

2422{
2423 TRACE("(%p)\n", this);
2424
2425 *phWnd = m_hWnd;
2426
2427 return S_OK;
2428}

◆ GetWindowProc()

virtual WNDPROC CDefView::GetWindowProc ( )
inlinevirtual

Reimplemented from ATL::CWindowImplBaseT< TBase, TWinTraits >.

Definition at line 347 of file CDefView.cpp.

348 {
349 return WindowProc;
350 }
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: CDefView.cpp:352

◆ GetWndClassInfo()

static ATL::CWndClassInfo & CDefView::GetWndClassInfo ( )
inlinestatic

Definition at line 334 of file CDefView.cpp.

335 {
336 static ATL::CWndClassInfo wc =
337 {
339 0, 0, NULL, NULL,
340 LoadCursor(NULL, IDC_ARROW), NULL, NULL, L"SHELLDLL_DefView", NULL
341 },
342 NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
343 };
344 return wc;
345 }
static LRESULT CALLBACK StartWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1619
#define _T(x)
Definition: vfdio.h:22
#define IDC_ARROW
Definition: winuser.h:687
#define LoadCursor
Definition: winuser.h:5812
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5719
#define CS_PARENTDC
Definition: winuser.h:656

◆ GiveFeedback()

HRESULT WINAPI CDefView::GiveFeedback ( DWORD  dwEffect)
override

Implements IDropSource.

Definition at line 3719 of file CDefView.cpp.

3720{
3721 TRACE("(%p)\n", this);
3722
3724}
#define DRAGDROP_S_USEDEFAULTCURSORS
Definition: winerror.h:2648

◆ HandleRename()

HRESULT STDMETHODCALLTYPE CDefView::HandleRename ( LPCITEMIDLIST  new_pidl)
override

Definition at line 2995 of file CDefView.cpp.

2996{
2997 FIXME("(%p)->(%p) stub\n", this, new_pidl);
2998 return E_NOTIMPL;
2999}

◆ IncludeObject()

HRESULT CDefView::IncludeObject ( PCUITEMID_CHILD  pidl)

Definition at line 483 of file CDefView.cpp.

484{
485 HRESULT ret = S_OK;
486
487 if (m_pCommDlgBrowser.p != NULL)
488 {
489 TRACE("ICommDlgBrowser::IncludeObject pidl=%p\n", pidl);
490 ret = m_pCommDlgBrowser->IncludeObject(this, pidl);
491 TRACE("-- returns 0x%08x\n", ret);
492 }
493
494 return ret;
495}
int ret

Referenced by fill_list().

◆ Initialize()

HRESULT WINAPI CDefView::Initialize ( IShellFolder shellFolder)

Definition at line 473 of file CDefView.cpp.

474{
475 m_pSFParent = shellFolder;
477
478 return S_OK;
479}
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)

◆ InitList()

BOOL CDefView::InitList ( )

Definition at line 784 of file CDefView.cpp.

785{
787 WCHAR szTemp[50];
788 HIMAGELIST big_icons, small_icons;
789
790 TRACE("%p\n", this);
791
793
795
796 if (m_pSF2Parent)
797 {
798 for (int i = 0; 1; i++)
799 {
800 if (FAILED(m_pSF2Parent->GetDetailsOf(NULL, i, &sd)))
801 break;
802 StrRetToStrNW( szTemp, 50, &sd.str, NULL);
803 m_ListView.InsertColumn(i, szTemp, sd.fmt, sd.cxChar * 8);
804
805 InsertMenuW(m_hMenuArrangeModes, -1, MF_STRING, 0x30 + i, szTemp);
806 }
807
809 }
810 else
811 {
812 FIXME("no m_pSF2Parent\n");
813 }
814
815 Shell_GetImageLists(&big_icons, &small_icons);
817 m_ListView.SetImageList(small_icons, LVSIL_SMALL);
818
819 return TRUE;
820}
BOOL DeleteAllItems()
Definition: rosctrls.h:126
HIMAGELIST SetImageList(HIMAGELIST himl, int iImageList)
Definition: rosctrls.h:91
int InsertColumn(int iCol, LV_COLUMN *pcol)
Definition: rosctrls.h:52
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
Definition: iconcache.cpp:683
static const WCHAR sd[]
Definition: suminfo.c:286
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define LVSIL_NORMAL
Definition: commctrl.h:2298
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
Definition: shellstring.c:85
BOOL WINAPI InsertMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define MF_STRING
Definition: winuser.h:138
#define MF_SEPARATOR
Definition: winuser.h:137
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by OnCreate().

◆ InvokeContextMenuCommand()

HRESULT CDefView::InvokeContextMenuCommand ( CComPtr< IContextMenu > &  pCM,
LPCSTR  lpVerb,
POINT pt = NULL 
)

Definition at line 1505 of file CDefView.cpp.

1506{
1507 CMINVOKECOMMANDINFOEX cmi;
1508
1509 ZeroMemory(&cmi, sizeof(cmi));
1510 cmi.cbSize = sizeof(cmi);
1511 cmi.hwnd = m_hWnd;
1512 cmi.lpVerb = lpVerb;
1513
1514 if (GetKeyState(VK_SHIFT) & 0x8000)
1515 cmi.fMask |= CMIC_MASK_SHIFT_DOWN;
1516
1517 if (GetKeyState(VK_CONTROL) & 0x8000)
1518 cmi.fMask |= CMIC_MASK_CONTROL_DOWN;
1519
1520 if (pt)
1521 {
1522 cmi.fMask |= CMIC_MASK_PTINVOKE;
1523 cmi.ptInvoke = *pt;
1524 }
1525
1526 HRESULT hr = pCM->InvokeCommand((LPCMINVOKECOMMANDINFO)&cmi);
1527 // Most of our callers will do this, but if they would forget (File menu!)
1528 IUnknown_SetSite(pCM, NULL);
1529 pCM.Release();
1530
1532 return hr;
1533
1534 return S_OK;
1535}
if(dx< 0)
Definition: linetemp.h:194
#define VK_CONTROL
Definition: winuser.h:2203
#define VK_SHIFT
Definition: winuser.h:2202
SHORT WINAPI GetKeyState(_In_ int)

Referenced by _DoCopyToMoveToFolder(), OnCommand(), OnContextMenu(), OnExplorerCommand(), and OpenSelectedItems().

◆ IsBkDropTarget()

HRESULT STDMETHODCALLTYPE CDefView::IsBkDropTarget ( IDropTarget drop_target)
override

Definition at line 3174 of file CDefView.cpp.

3175{
3176 FIXME("(%p)->(%p) stub\n", this, drop_target);
3177 return E_NOTIMPL;
3178}

◆ IsDropOnSource()

HRESULT STDMETHODCALLTYPE CDefView::IsDropOnSource ( IDropTarget drop_target)
override

Definition at line 3136 of file CDefView.cpp.

3137{
3138 if ((m_iDragOverItem == -1 || m_pCurDropTarget == NULL) &&
3140 {
3141 return S_OK;
3142 }
3143
3144 return S_FALSE;
3145}

Referenced by Drop().

◆ Item()

HRESULT STDMETHODCALLTYPE CDefView::Item ( int  iItemIndex,
PITEMID_CHILD ppidl 
)
override

Implements IFolderView.

Definition at line 2744 of file CDefView.cpp.

2745{
2746 PCUITEMID_CHILD pidl = _PidlByItem(iItemIndex);
2747 if (pidl)
2748 {
2749 *ppidl = ILClone(pidl);
2750 return S_OK;
2751 }
2752
2753 *ppidl = 0;
2754 return E_INVALIDARG;
2755}
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237

◆ ItemCount()

HRESULT STDMETHODCALLTYPE CDefView::ItemCount ( UINT  uFlags,
int pcItems 
)
override

Implements IFolderView.

Definition at line 2757 of file CDefView.cpp.

2758{
2759 TRACE("(%p)->(%u %p)\n", this, uFlags, pcItems);
2760
2761 if (uFlags != SVGIO_ALLVIEW)
2762 FIXME("some flags unsupported, %x\n", uFlags & ~SVGIO_ALLVIEW);
2763
2765
2766 return S_OK;
2767}
UINT uFlags
Definition: api.c:59
static int int const SCRIPT_CONTROL const SCRIPT_STATE SCRIPT_ITEM ULONG int * pcItems
Definition: usp10.c:62

◆ Items()

HRESULT STDMETHODCALLTYPE CDefView::Items ( UINT  uFlags,
REFIID  riid,
void **  ppv 
)
override

Implements IFolderView.

Definition at line 2769 of file CDefView.cpp.

2770{
2771 return E_NOTIMPL;
2772}

◆ ListViewCompareItems()

INT CALLBACK CDefView::ListViewCompareItems ( LPARAM  lParam1,
LPARAM  lParam2,
LPARAM  lpData 
)
static

Definition at line 837 of file CDefView.cpp.

838{
839 PCUIDLIST_RELATIVE pidl1 = reinterpret_cast<PCUIDLIST_RELATIVE>(lParam1);
840 PCUIDLIST_RELATIVE pidl2 = reinterpret_cast<PCUIDLIST_RELATIVE>(lParam2);
841 CDefView *pThis = reinterpret_cast<CDefView*>(lpData);
842
843 HRESULT hres = pThis->m_pSFParent->CompareIDs(pThis->m_sortInfo.nHeaderID, pidl1, pidl2);
845 return 0;
846
847 SHORT nDiff = HRESULT_CODE(hres);
848 if (!pThis->m_sortInfo.bIsAscending)
849 nDiff = -nDiff;
850 return nDiff;
851}
HRESULT hres
Definition: protocol.c:465
short SHORT
Definition: pedump.c:59
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
#define HRESULT_CODE(hr)
Definition: winerror.h:76

Referenced by _Sort().

◆ LV_AddItem()

int CDefView::LV_AddItem ( PCUITEMID_CHILD  pidl)

Definition at line 916 of file CDefView.cpp.

917{
918 LVITEMW lvItem;
919
920 TRACE("(%p)(pidl=%p)\n", this, pidl);
921
923
925 return -1;
926
927 lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; // set mask
928 lvItem.iItem = m_ListView.GetItemCount(); // add item to lists end
929 lvItem.iSubItem = 0;
930 lvItem.lParam = reinterpret_cast<LPARAM>(ILClone(pidl)); // set item's data
931 lvItem.pszText = LPSTR_TEXTCALLBACKW; // get text on a callback basis
932 lvItem.iImage = I_IMAGECALLBACK; // get image on a callback basis
933 lvItem.stateMask = LVIS_CUT;
934
935 return m_ListView.InsertItem(&lvItem);
936}
#define SFVM_ADDINGOBJECT
int InsertItem(const LV_ITEM *pitem)
Definition: rosctrls.h:96
#define I_IMAGECALLBACK
Definition: commctrl.h:2385
#define LPSTR_TEXTCALLBACKW
Definition: commctrl.h:2380
#define LVIF_PARAM
Definition: commctrl.h:2311
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVIF_IMAGE
Definition: commctrl.h:2310
LPWSTR pszText
Definition: commctrl.h:2365
int iSubItem
Definition: commctrl.h:2362
UINT mask
Definition: commctrl.h:2360
LPARAM lParam
Definition: commctrl.h:2368
UINT stateMask
Definition: commctrl.h:2364
int iImage
Definition: commctrl.h:2367

Referenced by AddObject(), fill_list(), and OnChangeNotify().

◆ LV_DeleteItem()

BOOLEAN CDefView::LV_DeleteItem ( PCUITEMID_CHILD  pidl)

Definition at line 938 of file CDefView.cpp.

939{
940 int nIndex;
941
942 TRACE("(%p)(pidl=%p)\n", this, pidl);
943
945
946 nIndex = LV_FindItemByPidl(pidl);
947 if (nIndex < 0)
948 return FALSE;
949
950 return m_ListView.DeleteItem(nIndex);
951}
BOOL DeleteItem(int i)
Definition: rosctrls.h:101

Referenced by OnChangeNotify().

◆ LV_FindItemByPidl()

int CDefView::LV_FindItemByPidl ( PCUITEMID_CHILD  pidl)

Definition at line 901 of file CDefView.cpp.

902{
904
905 int cItems = m_ListView.GetItemCount();
906
907 for (int i = 0; i<cItems; i++)
908 {
909 PCUITEMID_CHILD currentpidl = _PidlByItem(i);
910 if (ILIsEqual(pidl, currentpidl))
911 return i;
912 }
913 return -1;
914}
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:548

Referenced by GetItemPosition(), LV_DeleteItem(), LV_ProdItem(), LV_RenameItem(), OnChangeNotify(), RemoveObject(), SelectAndPositionItems(), and SelectItem().

◆ LV_ProdItem()

BOOLEAN CDefView::LV_ProdItem ( PCUITEMID_CHILD  pidl)

Definition at line 992 of file CDefView.cpp.

993{
994 int nItem;
995 LVITEMW lvItem;
996
997 TRACE("(%p)(pidl=%p)\n", this, pidl);
998
1000
1001 nItem = LV_FindItemByPidl(pidl);
1002
1003 if (-1 != nItem)
1004 {
1005 lvItem.mask = LVIF_IMAGE;
1006 lvItem.iItem = nItem;
1007 lvItem.iSubItem = 0;
1009 m_ListView.SetItem(&lvItem);
1010 m_ListView.Update(nItem);
1011 return TRUE;
1012 }
1013
1014 return FALSE;
1015}
BOOL Update(int i)
Definition: rosctrls.h:131
BOOL SetItem(const LV_ITEM *pitem)
Definition: rosctrls.h:111
int WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder *sh, LPCITEMIDLIST pidl, int *pIndex)
Definition: iconcache.cpp:766

Referenced by OnChangeNotify().

◆ LV_RenameItem()

BOOLEAN CDefView::LV_RenameItem ( PCUITEMID_CHILD  pidlOld,
PCUITEMID_CHILD  pidlNew 
)

Definition at line 953 of file CDefView.cpp.

954{
955 int nItem;
956 LVITEMW lvItem;
957
958 TRACE("(%p)(pidlold=%p pidlnew=%p)\n", this, pidlOld, pidlNew);
959
961
962 nItem = LV_FindItemByPidl(pidlOld);
963
964 if (-1 != nItem)
965 {
966 lvItem.mask = LVIF_PARAM; // only the pidl
967 lvItem.iItem = nItem;
968 lvItem.iSubItem = 0;
969 m_ListView.GetItem(&lvItem);
970
971 // Store old pidl until new item is replaced
972 LPVOID oldPidl = reinterpret_cast<LPVOID>(lvItem.lParam