17#define SHV_CHANGE_NOTIFY (WM_USER + 0x1111)
49#define SUPPORTED_FLAGS (BIF_STATUSTEXT | BIF_BROWSEFORCOMPUTER | BIF_RETURNFSANCESTORS | \
50 BIF_RETURNONLYFSDIRS | BIF_NONEWFOLDERBUTTON | BIF_NEWDIALOGSTYLE | \
51 BIF_BROWSEINCLUDEFILES)
70 if (!lpBrowseInfo->
lpfn)
82 ERR(
"TreeView_GetItem failed\n");
107 ULONG attrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
122 hr = psfChild->EnumObjects(
info->hWnd,
flags, &pEnumIL);
125 if ((pEnumIL->Skip(1) !=
S_OK) ||
FAILED(pEnumIL->Reset()))
129 if (!pEnumIL || !(attrs & SFGAO_HASSUBFOLDER))
133 *ppEnum = pEnumIL.
Detach();
249 TRACE(
"%p %p %x %p\n", lpsf, pidlChild,
dwFlags, lpFriendlyName);
270 while (pEnum->Next(1, &pidlTemp,
NULL) ==
S_OK)
317 if (pEnum->Next(1, &pidlTemp,
NULL) ==
S_OK)
362 pItemData->
pidlFull.Attach(pidlFull);
393 TRACE(
"%p %p %p\n", lpsf, pidlFull, hParent);
407 while (
S_OK == pEnum->Next(1, &pidlTemp, &ulFetched))
441 dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM;
450 ((
dwAttributes & (SFGAO_FOLDER | SFGAO_FILESYSTEM)) != (SFGAO_FOLDER | SFGAO_FILESYSTEM)))
469 TRACE(
"TVN_DELETEITEMA/W %p\n", pItemData);
480 TRACE(
"TVN_ITEMEXPANDINGA/W\n");
549 data->pidlFull.Free();
550 data->pidlFull.Attach(newFull);
583 ERR(
"SHGetPathFromIDListW failed\n");
587 fileop.
pFrom = szzFrom;
607 switch (keydown->
wVKey)
659 return !(att & SFGAO_CANRENAME);
687 FIXME(
"flags BIF_NEWDIALOGSTYLE partially implemented\n");
701 RECT rcEdit, rcTreeView;
706 rcTreeView.
top -=
cy;
708 rcTreeView.
left, rcTreeView.
top,
745 if (
info->hwndTreeView)
748 ERR(
"treeview control missing!\n");
753 ntreg.
pidl = pidlDesktop;
816 item.hItem = hParent;
911 enum { IDC_TOGGLE = 1, ID_FIRSTCMD, ID_LASTCMD = 0xffff };
913 CMINVOKECOMMANDINFOEX ici = {
sizeof(ici), CMIC_MASK_PTINVOKE,
info.hWnd };
934 tvi.hItem = hSelected;
939 IID_IContextMenu,
NULL, (
void**)&pcm);
946 info.pContextMenu = pcm;
948 hr = pcm->QueryContextMenu(hMenu, 0, ID_FIRSTCMD, ID_LASTCMD, CMF_EXPLORE | cmf);
957 if (
cmd == IDC_TOGGLE)
969 ici.fMask |= CMIC_MASK_SHIFT_DOWN;
971 ici.fMask |= CMIC_MASK_CONTROL_DOWN;
972 pcm->InvokeCommand((CMINVOKECOMMANDINFO*)&ici);
1036 *phItem =
item.hItem;
1123 while (
S_OK == pEnum->Next(1, &pidlTemp,
NULL))
1210 ERR(
"hLock == NULL\n");
1232 if (
info->pContextMenu)
1354 TRACE(
"%p\n", lpbi);
1372 return info.pidlRet;
BOOL _ILIsDesktop(LPCITEMIDLIST pidl)
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define shell32_hInstance
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void shell(int argc, const char *argv[])
static HRESULT BrFolder_Rename(BrFolder *info, HTREEITEM hItem)
static void BrFolder_OnContextMenu(BrFolder &info, LPARAM lParam)
static void BrFolder_OnChange(BrFolder *info, WPARAM wParam, LPARAM lParam)
static BOOL BrFolder_OnSetSelectionPidl(BrFolder *info, LPITEMIDLIST pidlSelection)
static void GetTreeViewItemContextMenuPos(HWND hWnd, HTREEITEM hItem, POINT *ppt)
EXTERN_C LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
static HRESULT BrFolder_NewFolder(BrFolder *info)
static void BrFolder_Callback(LPBROWSEINFOW lpBrowseInfo, HWND hWnd, UINT uMsg, LPARAM lParam)
static void BrFolder_OnChangeEx(_Inout_ BrFolder *info, _In_ PCIDLIST_ABSOLUTE pidl0, _In_ PCIDLIST_ABSOLUTE pidl1, _In_ LONG event)
static BOOL BrFolder_OnSetSelectionW(BrFolder *info, LPWSTR pszSelection)
static INT_PTR CALLBACK BrFolderDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static const LAYOUT_INFO g_layout_info[]
static void BrFolder_Refresh(_Inout_ BrFolder *info)
#define SHV_CHANGE_NOTIFY
static LRESULT BrFolder_Treeview_Expand(BrFolder *info, NMTREEVIEWW *pnmtv)
static BOOL BrFolder_IsTreeItemInEnum(_Inout_ BrFolder *info, _In_ HTREEITEM hItem, _Inout_ IEnumIDList *pEnum)
static BOOL PIDLIsType(LPCITEMIDLIST pidl, PIDLTYPE type)
static SFGAOF BrFolder_GetItemAttributes(BrFolder *info, HTREEITEM hItem, SFGAOF Att)
static BrItemData * BrFolder_GetItemData(BrFolder *info, HTREEITEM hItem)
static void BrFolder_Delete(BrFolder *info, HTREEITEM hItem)
static void BrFolder_RefreshRecurse(_Inout_ BrFolder *info, _In_ HTREEITEM hTarget)
static HRESULT BrFolder_GetChildrenEnum(_In_ BrFolder *info, _In_ BrItemData *pItemData, _Outptr_opt_ IEnumIDList **ppEnum)
static HRESULT BrFolder_Treeview_Changed(BrFolder *info, NMTREEVIEWW *pnmtv)
static void BrFolder_GetIconPair(PCIDLIST_ABSOLUTE pidl, LPTVITEMW pItem)
static INT BrFolder_GetIcon(PCIDLIST_ABSOLUTE pidl, UINT uFlags)
static DWORD BrowseFlagsToSHCONTF(UINT ulFlags)
static LRESULT BrFolder_Treeview_Keydown(BrFolder *info, LPNMTVKEYDOWN keydown)
static HTREEITEM BrFolder_InsertItem(_Inout_ BrFolder *info, _Inout_ IShellFolder *lpsf, _In_ PCUITEMID_CHILD pidlChild, _In_ PCIDLIST_ABSOLUTE pidlParent, _In_ HTREEITEM hParent)
static void BrFolder_OnOK(BrFolder *info)
static LRESULT BrFolder_OnNotify(BrFolder *info, UINT CtlID, LPNMHDR lpnmh)
static void BrFolder_UpdateItem(_In_ BrFolder *info, _In_ HTREEITEM hItem)
static void BrFolder_InitTreeView(BrFolder *info)
static void BrFolder_CheckValidSelection(BrFolder *info, BrItemData *pItemData)
EXTERN_C LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi)
static BOOL BrFolder_OnSetSelectionA(BrFolder *info, LPSTR pszSelectionA)
static BOOL BrFolder_TreeItemHasThisChild(_In_ BrFolder *info, _In_ HTREEITEM hItem, _Outptr_opt_ PITEMID_CHILD pidlChild)
static BOOL BrFolder_OnInitDialog(HWND hWnd, BrFolder *info)
static BOOL BrFolder_OnSetExpandedString(BrFolder *info, LPWSTR pszString, HTREEITEM *phItem)
static void BrFolder_OnCommand(BrFolder *info, UINT id)
static void BrFolder_Expand(_In_ BrFolder *info, _In_ IShellFolder *lpsf, _In_ PCIDLIST_ABSOLUTE pidlFull, _In_ HTREEITEM hParent)
static BOOL BrFolder_OnSetExpandedPidl(BrFolder *info, LPITEMIDLIST pidlSelection, HTREEITEM *phItem)
static LRESULT BrFolder_Treeview_Rename(BrFolder *info, NMTVDISPINFOW *pnmtv)
static LRESULT BrFolder_Treeview_Delete(BrFolder *info, NMTREEVIEWW *pnmtv)
static BOOL BrFolder_GetName(IShellFolder *lpsf, PCIDLIST_RELATIVE pidlChild, DWORD dwFlags, LPWSTR lpFriendlyName)
static void BrFolder_OnDestroy(BrFolder *info)
EXTERN_C HANDLE WINAPI SHChangeNotification_Lock(HANDLE hTicket, DWORD dwOwnerPID, LPITEMIDLIST **lppidls, LPLONG lpwEventId)
EXTERN_C ULONG WINAPI SHChangeNotifyRegister(HWND hwnd, INT fSources, LONG wEventMask, UINT uMsg, INT cItems, SHChangeNotifyEntry *lpItems)
EXTERN_C BOOL WINAPI SHChangeNotification_Unlock(HANDLE hLock)
EXTERN_C BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
void pdump(LPCITEMIDLIST pidl)
#define FAILED_UNEXPECTEDLY(hr)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
UINT GetDfmCmd(_In_ IContextMenu *pCM, _In_ LPCSTR verba)
HRESULT SHILAppend(_Inout_ LPITEMIDLIST pidl, _Inout_ LPITEMIDLIST *ppidl)
HRESULT SHILClone(_In_opt_ LPCITEMIDLIST pidl, _Outptr_ LPITEMIDLIST *ppidl)
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
BOOL WINAPI PathYetAnotherMakeUniqueName(LPWSTR buffer, LPCWSTR path, LPCWSTR shortname, LPCWSTR longname)
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen)
BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim)
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
BOOL WINAPI Shell_GetImageLists(HIMAGELIST *lpBigList, HIMAGELIST *lpSmallList)
HRESULT BindToObject([in] PCUIDLIST_RELATIVE pidl, [in] LPBC pbcReserved, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut)
HRESULT GetDisplayNameOf([in] PCUITEMID_CHILD pidl, [in] SHGDNF uFlags, [out] STRRET *lpName)
HRESULT GetAttributesOf([in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in, out] SFGAOF *rgfInOut)
static __inline LAYOUT_DATA * LayoutInit(HWND hwndParent, const LAYOUT_INFO *pLayouts, INT cLayouts)
static __inline void LayoutDestroy(LAYOUT_DATA *pData)
static __inline void LayoutUpdate(HWND ignored1, LAYOUT_DATA *pData, LPCVOID ignored2, UINT ignored3)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
void WINAPI ILFree(LPITEMIDLIST pidl)
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
LPITEMIDLIST _ILCreateDesktop(void)
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
BOOL _ILIsMyComputer(LPCITEMIDLIST pidl)
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
static BOOL _ILIsEqualSimple(LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB)
static BOOL _ILIsEmpty(LPCITEMIDLIST pidl)
static const WCHAR szName[]
_Out_opt_ int _Out_opt_ int * cy
#define TreeView_SelectItem(hwnd, hitem)
#define TreeView_Expand(hwnd, hitem, code)
#define TreeView_GetChild(hwnd, hitem)
#define TVN_ITEMEXPANDINGA
#define TreeView_SortChildren(hwnd, hitem, recurse)
#define TVN_BEGINLABELEDITA
#define TVIS_EXPANDEDONCE
#define TreeView_GetSelection(hwnd)
#define TreeView_GetItem(hwnd, pitem)
#define TreeView_GetItemRect(hwnd, hitem, prc, code)
#define TreeView_GetRoot(hwnd)
#define TreeView_GetNextSibling(hwnd, hitem)
#define TVN_ITEMEXPANDINGW
#define TVN_BEGINLABELEDITW
#define TreeView_EditLabel(hwnd, hitem)
#define TreeView_SetImageList(hwnd, himl, iImage)
#define TreeView_HitTest(hwnd, lpht)
#define TreeView_InsertItem(hwnd, lpis)
#define TVIF_SELECTEDIMAGE
#define TVN_ENDLABELEDITW
#define TreeView_SetItem(hwnd, pitem)
#define TreeView_DeleteItem(hwnd, hitem)
HRESULT WINAPI SHForwardContextMenuMsg(IUnknown *pUnk, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult, BOOL useIContextMenu2)
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source)
#define SHGFI_SYSICONINDEX
#define SHGFI_DISPLAYNAME
BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
void WINAPI _InsertMenuItemW(HMENU hmenu, UINT indexMenu, BOOL fByPosition, UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState)
int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
#define SHCNE_DRIVEREMOVED
#define CSIDL_DESKTOPDIRECTORY
#define BIF_RETURNONLYFSDIRS
#define BIF_RETURNFSANCESTORS
#define SHCNE_RENAMEFOLDER
#define SHCNRF_NewDelivery
#define SHCNRF_ShellLevel
#define BFFM_SETSELECTIONW
#define BIF_BROWSEINCLUDEFILES
#define BFFM_SETSTATUSTEXTW
#define BFFM_SETSTATUSTEXTA
#define BIF_NONEWFOLDERBUTTON
#define BIF_NEWDIALOGSTYLE
#define BIF_BROWSEFORCOMPUTER
#define BFFM_SETSELECTIONA
HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags)
#define SHACF_FILESYS_ONLY
#define IDD_BROWSE_FOR_FOLDER_NEW
#define IDC_BROWSE_FOR_FOLDER_FOLDER_TEXT
#define IDC_BROWSE_FOR_FOLDER_TREEVIEW
#define IDC_BROWSE_FOR_FOLDER_NEW_FOLDER
#define IDD_BROWSE_FOR_FOLDER
#define IDC_BROWSE_FOR_FOLDER_STATUS
#define IDC_BROWSE_FOR_FOLDER_TITLE
#define IDC_BROWSE_FOR_FOLDER_FOLDER
ITEMIDLIST UNALIGNED * LPITEMIDLIST
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
IContextMenu * pContextMenu
LPBROWSEINFOW lpBrowseInfo
PCIDLIST_RELATIVE pidlChild
CComHeapPtr< ITEMIDLIST_ABSOLUTE > pidlFull
CComPtr< IShellFolder > lpsfParent
WCHAR szDisplayName[MAX_PATH]
PCIDLIST_ABSOLUTE pidlRoot
PCIDLIST_ABSOLUTE pidlRoot
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
HWND WINAPI SetCapture(_In_ HWND hWnd)
HMENU WINAPI CreatePopupMenu(void)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI ReleaseCapture(void)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL WINAPI SetDlgItemTextA(_In_ HWND, _In_ int, _In_ LPCSTR)
#define MAKEINTRESOURCEA(i)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
BOOL WINAPI DestroyMenu(_In_ HMENU)
struct tagMINMAXINFO * LPMINMAXINFO
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
SHORT WINAPI GetKeyState(_In_ int)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define IID_PPV_ARG(Itype, ppType)