# HG changeset patch # User Jordan Miner # Date 1248466282 18000 # Node ID 63cbfb167240c3f5c13301dcb465be210781e519 # Parent e4dabffaa784af1f7d4f10b7fe9411eb17cd9f29 Got the COM code working in DirectoryDialog, but it doesn't do what I thought it would. Instead of just preselecting the directory, it shows only it and its subfolders. diff -r e4dabffaa784 -r 63cbfb167240 dynamin/c/windows.d --- a/dynamin/c/windows.d Fri Jul 24 00:40:31 2009 -0500 +++ b/dynamin/c/windows.d Fri Jul 24 15:11:22 2009 -0500 @@ -1378,7 +1378,7 @@ HRESULT SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath); -HRESULT SHGetDesktopFolder(IShellFolder** ppshf); +HRESULT SHGetDesktopFolder(IShellFolder* ppshf); struct GUID { align(1): @@ -1390,19 +1390,16 @@ alias GUID IID; alias GUID CLSID; -// I can't get this #!@#! COM stuff working... interface IUnknown { -extern(Windows): HRESULT QueryInterface(IID* riid, void** ppvObject); ULONG AddRef(); ULONG Release(); } -alias void* LPBC; +alias void IBindCtx; interface IShellFolder : IUnknown { -extern(Windows): HRESULT ParseDisplayName( HWND hwnd, - LPBC pbc, + IBindCtx* pbc, wchar* pszDisplayName, ULONG* pchEaten, ITEMIDLIST** ppidl, diff -r e4dabffaa784 -r 63cbfb167240 dynamin/gui/windows_directory_dialog.d --- a/dynamin/gui/windows_directory_dialog.d Fri Jul 24 00:40:31 2009 -0500 +++ b/dynamin/gui/windows_directory_dialog.d Fri Jul 24 15:11:22 2009 -0500 @@ -35,11 +35,10 @@ bi.ulFlags |= BIF_RETURNONLYFSDIRS; bi.ulFlags |= BIF_USENEWUI; - // TODO: I can't get this #!@#! COM stuff working... - //IShellFolder* shf; + //IShellFolder shf; //SHGetDesktopFolder(&shf); //ITEMIDLIST* pidlInit; - //shf.ParseDisplayName(null, null, toWcharPointer(directory), null, &pidlInit, null); + //shf.ParseDisplayName(null, null, toWcharPtr(directory), null, &pidlInit, null); //shf.Release(); //bi.pidlRoot = pidlInit;