changeset 20:63cbfb167240

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.
author Jordan Miner <jminer7@gmail.com>
date Fri, 24 Jul 2009 15:11:22 -0500
parents e4dabffaa784
children d0ce1db78819
files dynamin/c/windows.d dynamin/gui/windows_directory_dialog.d
diffstat 2 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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,
--- 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;