[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
Re: [MD:4630] cannot select directory by mw32-file-dialog
- X-ml-count: 4637
- Subject: Re: [MD:4630] cannot select directory by mw32-file-dialog
- From: Mito <mito@xxxxxxxxxxxxxxxxx>
- Date: Mon, 08 Sep 2003 21:17:05 +0900
- User-agent: Wanderlust/2.11.9 SEMI/1.14.5 FLIM/1.14.5 APEL/10.6 Emacs/21.1 MULE/5.0 Meadow/2.00 (Beta2-dev)
At Sat, 06 Sep 2003 09:57:00 +0900,
miyoshi@xxxxxxxxxxxxxxxx wrote:
> Open common dialog box (またはその代替手段)でディレクトリも選択可
> 能にする方法をご存知の方いますか?
GetOpenFileName/GetSaveFileName で OPENFILENAME の lpfnHook
に hook を指定して、ディレクトリを選択した状態で[開く]を押し
ても CDN_FILEOK は発生しませんでした。
shell32.lib の SHBrowseForFolder を使ったらできるようです。
| #include <shlobj.h>
| :
|
| BROWSEINFO browse_info;
| ITEMIDLIST *item_id_list;
| memset(&browse_info, 0, sizeof(browse_info));
| browse_info.ulFlags = BIF_BROWSEINCLUDEFILES;
| item_id_list = SHBrowseForFolder(&browse_info);
| if (item_id_list) {
| char file_or_directory[MAX_PATH];
| IMalloc *pMalloc;
| if (SHGetPathFromIDList(item_id_list, file_or_directory))
| printf("%s\n", file_or_directory); /* ←これ */
| if (SHGetMalloc(&pMalloc) == NOERROR && pMalloc) {
| pMalloc->lpVtbl->Free(pMalloc, item_id_list);
| pMalloc->lpVtbl->Release(pMalloc);
| }
| }
# いまだに Meadow のソースは取得していない不届き者です。(_ _)
---
09/08 21:17頃
NECソフト 水戸