QuinnJohns
August 2nd, 2005, 09:56 PM
case IDC_CHANGEDIR:
{
TCHAR buf[512] = {0};
int iSelection = SendMessage(GetDlgItem(hDlg,IDC_LOCALDIRLIST), LB_GETCURSEL, 0, 0);
SendMessage(GetDlgItem(hDlg,IDC_LOCALDIRLIST), LB_GETTEXT, iSelection, reinterpret_cast<LPARAM>(buf));
_chdir(buf);
getcwd(CurrentDirectory,50-1);
SetDlgItemText(hDlg, IDC_LocalCWD, CurrentDirectory);
GetDirectoryListing(hDlg, CurrentDirectory);
}break;
Basically, I want to make it, so that when the user clicks my IDC_CHANGEDIR button, I want the object selected in my listbox, to be the object that the directory changes to. I figured this was correct, but it doesn't work. GetDirectoryListing...getcwd,_chdir -- all work correctly, I believe it deals with my SendMessage statements.
{
TCHAR buf[512] = {0};
int iSelection = SendMessage(GetDlgItem(hDlg,IDC_LOCALDIRLIST), LB_GETCURSEL, 0, 0);
SendMessage(GetDlgItem(hDlg,IDC_LOCALDIRLIST), LB_GETTEXT, iSelection, reinterpret_cast<LPARAM>(buf));
_chdir(buf);
getcwd(CurrentDirectory,50-1);
SetDlgItemText(hDlg, IDC_LocalCWD, CurrentDirectory);
GetDirectoryListing(hDlg, CurrentDirectory);
}break;
Basically, I want to make it, so that when the user clicks my IDC_CHANGEDIR button, I want the object selected in my listbox, to be the object that the directory changes to. I figured this was correct, but it doesn't work. GetDirectoryListing...getcwd,_chdir -- all work correctly, I believe it deals with my SendMessage statements.