diff --git a/dlls/comdlg32/cdlg.h b/dlls/comdlg32/cdlg.h index f88e2d4f68c..d0c0591e5c4 100644 --- a/dlls/comdlg32/cdlg.h +++ b/dlls/comdlg32/cdlg.h @@ -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); diff --git a/dlls/comdlg32/cdlg32.c b/dlls/comdlg32/cdlg32.c index 57f30363977..0f0f69bee17 100644 --- a/dlls/comdlg32/cdlg32.c +++ b/dlls/comdlg32/cdlg32.c @@ -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 */ diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 57c76f831f3..618fc229e96 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -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; diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index 03192bab31e..abceb15c6a4 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -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", diff --git a/include/commdlg.h b/include/commdlg.h index cd4dc59f128..914e4c879b6 100644 --- a/include/commdlg.h +++ b/include/commdlg.h @@ -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)