comdlg32: Implement CDM_GETFOLDERIDLIST.

This commit is contained in:
Mikołaj Zalewski 2008-06-19 15:31:35 +02:00 committed by Alexandre Julliard
parent 30899341cd
commit bbd8706e73
5 changed files with 24 additions and 1 deletions

View File

@ -177,6 +177,7 @@ extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILCombine)(LPCITEMIDLIST,LPCITEMIDLIS
extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILGetNext)(LPITEMIDLIST);
extern BOOL (WINAPI *COMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST);
extern BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
extern UINT (WINAPI *COMDLG32_PIDL_ILGetSize)(LPCITEMIDLIST);
/* SHELL */
extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);

View File

@ -47,6 +47,7 @@ LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILCombine)(LPCITEMIDLIST,LPCITEMIDLIST);
LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILGetNext)(LPITEMIDLIST);
BOOL (WINAPI *COMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST);
BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
UINT (WINAPI *COMDLG32_PIDL_ILGetSize)(LPCITEMIDLIST);
/* SHELL */
LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
@ -95,6 +96,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
GPA(COMDLG32_PIDL_ILGetNext, SHELL32_hInstance, (LPCSTR)153L);
GPA(COMDLG32_PIDL_ILClone, SHELL32_hInstance, (LPCSTR)18L);
GPA(COMDLG32_PIDL_ILRemoveLastID, SHELL32_hInstance, (LPCSTR)17L);
GPA(COMDLG32_PIDL_ILGetSize, SHELL32_hInstance, (LPCSTR)152L);
/* SHELL */

View File

@ -928,6 +928,12 @@ static INT_PTR FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM
retval = lstrlenW(lpstrPath);
break;
case CDM_GETFOLDERIDLIST:
retval = COMDLG32_PIDL_ILGetSize(fodInfos->ShellInfos.pidlAbsCurrent);
if (retval <= wParam)
memcpy((void*)lParam, fodInfos->ShellInfos.pidlAbsCurrent, retval);
break;
case CDM_GETSPEC:
TRACE("CDM_GETSPEC:\n");
retval = SendMessageW(fodInfos->DlgInfos.hwndFileName, WM_GETTEXTLENGTH, 0, 0) + 1;

View File

@ -35,6 +35,16 @@ static UINT CALLBACK OFNHookProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPa
if( nmh->code == CDN_INITDONE)
{
PostMessage( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE);
} else if (nmh->code == CDN_FOLDERCHANGE )
{
char buf[1024];
int ret;
memset(buf, 0x66, sizeof(buf));
ret = SendMessage( GetParent(hDlg), CDM_GETFOLDERIDLIST, 5, (LPARAM)buf);
ok(ret > 0, "CMD_GETFOLDERIDLIST not implemented\n");
if (ret > 5)
ok(buf[0] == 0x66 && buf[1] == 0x66, "CMD_GETFOLDERIDLIST: The buffer was touched on failure\n");
}
}
@ -47,6 +57,9 @@ static void test_DialogCancel(void)
OPENFILENAMEA ofn;
BOOL result;
char szFileName[MAX_PATH] = "";
char szInitialDir[MAX_PATH];
GetWindowsDirectory(szInitialDir, MAX_PATH);
ZeroMemory(&ofn, sizeof(ofn));
@ -58,6 +71,7 @@ static void test_DialogCancel(void)
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_ENABLEHOOK;
ofn.lpstrDefExt = "txt";
ofn.lpfnHook = (LPOFNHOOKPROC) OFNHookProc;
ofn.lpstrInitialDir = szInitialDir;
PrintDlgA(NULL);
ok(CDERR_INITIALIZATION == CommDlgExtendedError(), "expected %d, got %d\n",

View File

@ -435,7 +435,7 @@ static const WCHAR HELPMSGSTRINGW[] = { 'c','o','m','m','d','l','g','_',
#define CDM_GETSPEC (CDM_FIRST + 0x0000)
#define CDM_GETFILEPATH (CDM_FIRST + 0x0001)
#define CDM_GETFOLDERPATH (CDM_FIRST + 0x0002)
#define CDM_GETFOLDERLIST (CDM_FIRST + 0x0003)
#define CDM_GETFOLDERIDLIST (CDM_FIRST + 0x0003)
#define CDM_SETCONTROLTEXT (CDM_FIRST + 0x0004)
#define CDM_HIDECONTROL (CDM_FIRST + 0x0005)
#define CDM_SETDEFEXT (CDM_FIRST + 0x0006)