void populate_dir (void) { char buf[MAX_PATH]; char mask[MAX_MASK_LEN]; GetWindowText(GetDlgItem(hMainWindow, IDC_MANPATH), buf, sizeof(buf)); GetWindowText(GetDlgItem(hMainWindow, IDC_MASK), mask, sizeof(mask)); if (!DirectoryExists(buf)) { current_path_to_edit (); strcpy (buf, CurrentPath); } else { size_t off; off = strlen(buf); if ((off) && (buf[off-1] != '\\') && (buf[off-1] != '/')) { buf[off] = '\\'; buf[off+1] = 0; } strcpy (CurrentPath, buf); current_path_to_edit (); } DlgDirListComboBox(hMainWindow, buf, IDC_DRIVES, 0, DDL_DRIVES); DlgDirList (hMainWindow, buf, IDC_DIRS, 0, DDL_DIRECTORY + DDL_EXCLUSIVE); /* if you want to show only files that match mask - uncomment next line */ //strcat (buf, mask); DlgDirList (hMainWindow, buf, IDC_FILES, IDC_REALPATH, 0x27); snprintf (mask, sizeof(mask), "[-%c-]", 'a' +_getdrive() - 1); ComboBox_SelectString (GetDlgItem(hMainWindow, IDC_DRIVES), 0, mask); }
int far pascal zDlgDirListComboBox( HWND pp1, LPSTR pp2, int pp3, int pp4, UINT pp5 ) { int r; SaveRegs(); /* ** Log IN Parameters (No Create/Destroy Checking Yet!) */ LogIn( (LPSTR)"APICALL:DlgDirListComboBox HWND+LPSTR+int+int+UINT+", pp1, pp2, pp3, pp4, pp5 ); /* ** Call the API! */ RestoreRegs(); GrovelDS(); r = DlgDirListComboBox(pp1,pp2,pp3,pp4,pp5); UnGrovelDS(); SaveRegs(); /* ** Log Return Code & OUT Parameters (No Create/Destroy Checking Yet!) */ LogOut( (LPSTR)"APIRET:DlgDirListComboBox int++++++", r, (short)0, (short)0, (short)0, (short)0, (short)0 ); RestoreRegs(); return( r ); }
ULONG FASTCALL WU32DlgDirListComboBox(PVDMFRAME pFrame) { ULONG ul; PSZ psz2; register PDLGDIRLISTCOMBOBOX16 parg16; UpdateDosCurrentDirectory(DIR_DOS_TO_NT); GETARGPTR(pFrame, sizeof(DLGDIRLISTCOMBOBOX16), parg16); GETPSZPTR(parg16->f2, psz2); ul = GETINT16(DlgDirListComboBox( HWND32(parg16->f1), psz2, WORD32(parg16->f3), WORD32(parg16->f4), WORD32(parg16->f5) )); UpdateDosCurrentDirectory(DIR_NT_TO_DOS); FREEPSZPTR(psz2); FREEARGPTR(parg16); RETURN(ul); }