/*********************************************************************** * FD31_ScanDir [internal] */ static BOOL FD31_ScanDir(HWND hWnd, LPWSTR newPath) { WCHAR buffer[BUFFILE]; HWND hdlg, hdlgDir; LRESULT lRet = TRUE; HCURSOR hCursorWait, oldCursor; TRACE("Trying to change to %s\n", debugstr_w(newPath)); if ( newPath[0] && !SetCurrentDirectoryW( newPath )) return FALSE; lstrcpynW(buffer, newPath, sizeof(buffer)/sizeof(WCHAR)); /* get the list of spec files */ GetDlgItemTextW(hWnd, edt1, buffer, sizeof(buffer)/sizeof(WCHAR)); hCursorWait = LoadCursorA(0, (LPSTR)IDC_WAIT); oldCursor = SetCursor(hCursorWait); /* list of files */ if ((hdlg = GetDlgItem(hWnd, lst1)) != 0) { WCHAR* scptr; /* ptr on semi-colon */ WCHAR* filter = buffer; TRACE("Using filter %s\n", debugstr_w(filter)); SendMessageW(hdlg, LB_RESETCONTENT, 0, 0); while (filter) { scptr = strchrW(filter, ';'); if (scptr) *scptr = 0; while (*filter == ' ') filter++; TRACE("Using file spec %s\n", debugstr_w(filter)); if (SendMessageW(hdlg, LB_DIR, 0, (LPARAM)filter) == LB_ERR) return FALSE; if (scptr) *scptr = ';'; filter = (scptr) ? (scptr + 1) : 0; } } /* list of directories */ strcpyW(buffer, FILE_star); if ((hdlgDir = GetDlgItem(hWnd, lst2)) != 0) { lRet = DlgDirListW(hWnd, buffer, lst2, stc1, DDL_EXCLUSIVE | DDL_DIRECTORY); } SetCursor(oldCursor); return lRet; }
/*********************************************************************** * FD31_ScanDir [internal] */ static BOOL FD31_ScanDir(const OPENFILENAMEW *ofn, HWND hWnd, LPCWSTR newPath) { WCHAR buffer[BUFFILE]; HWND hdlg; LRESULT lRet = TRUE; HCURSOR hCursorWait, oldCursor; TRACE("Trying to change to %s\n", debugstr_w(newPath)); if ( newPath[0] && !SetCurrentDirectoryW( newPath )) return FALSE; /* get the list of spec files */ lstrcpynW(buffer, FD31_GetFileType(ofn->lpstrCustomFilter, ofn->lpstrFilter, ofn->nFilterIndex - 1), BUFFILE); hCursorWait = LoadCursorA(0, (LPSTR)IDC_WAIT); oldCursor = SetCursor(hCursorWait); /* list of files */ if ((hdlg = GetDlgItem(hWnd, lst1)) != 0) { WCHAR* scptr; /* ptr on semi-colon */ WCHAR* filter = buffer; TRACE("Using filter %s\n", debugstr_w(filter)); SendMessageW(hdlg, LB_RESETCONTENT, 0, 0); while (filter) { scptr = strchrW(filter, ';'); if (scptr) *scptr = 0; while (*filter == ' ') filter++; TRACE("Using file spec %s\n", debugstr_w(filter)); SendMessageW(hdlg, LB_DIR, 0, (LPARAM)filter); if (scptr) *scptr = ';'; filter = (scptr) ? (scptr + 1) : 0; } } /* list of directories */ strcpyW(buffer, FILE_star); if (GetDlgItem(hWnd, lst2) != 0) { lRet = DlgDirListW(hWnd, buffer, lst2, stc1, DDL_EXCLUSIVE | DDL_DIRECTORY); } SetCursor(oldCursor); return lRet; }