diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-16 19:44:46 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-16 19:44:46 +0200 |
commit | 10ea3185eeaf7c8859bef5044f5a224bf0cd3e3f (patch) | |
tree | c13288619ac85e80c902f8a0d87f8035477982bd | |
parent | 5fac4f2baf2eb08948ceb0abdca18510de8fbdd5 (diff) | |
download | alpine-usb-creator-10ea3185eeaf7c8859bef5044f5a224bf0cd3e3f.tar.bz2 alpine-usb-creator-10ea3185eeaf7c8859bef5044f5a224bf0cd3e3f.tar.xz |
List disk devices on windows
-rw-r--r-- | dialog.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -4,6 +4,10 @@ #include "dialog.h" +#ifdef __WINDOWS__ +#include <windows.h> +#endif + Dialog::Dialog(wxWindow *parent) : DialogUI(parent) { @@ -12,7 +16,23 @@ Dialog::Dialog(wxWindow *parent) void Dialog::RefreshDrives(void) { - wxMessageBox(wxT("To be implemented")); +#ifdef __WINDOWS__ +// SetErrorMode(SEM_NOOPENFILEERRORBOX); + wchar_t drives[256], *pdrv = drives; + memset(drives, 0, sizeof(drives)); + GetLogicalDriveStrings(sizeof(drives), drives); + m_target->Clear(); + while(pdrv[0] != '\0') { +// if (GetDriveType(pdrv) == DRIVE_REMOVABLE) { + m_target->Append(pdrv); +// } + pdrv += lstrlen(pdrv) + 1; + } + +#else + m_target->Clear(); + m_target->Append(wxT("~/tmp/alpine")); +#endif } void Dialog::OnRefreshDrives(wxCommandEvent &event) |