Implement connecting and disconnecting of network drives.
This commit is contained in:
parent
4776085c9c
commit
4a0a199fcf
|
@ -64,8 +64,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "Vytvoøit systé&mový disk...", -1 /*@@ */
|
MENUITEM "Vytvoøit systé&mový disk...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Připojit síťový &disk" , 252
|
MENUITEM "Připojit síťový &disk" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Odpojit síťový disk" , 253
|
MENUITEM "&Odpojit síťový disk" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Sdílet jako..." , 254
|
MENUITEM "Sdílet jako..." , 254
|
||||||
MENUITEM "Odst&ranit sdílení..." , 255
|
MENUITEM "Odst&ranit sdílení..." , 255
|
||||||
|
|
|
@ -63,8 +63,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "...", -1 /*@@ */
|
MENUITEM "...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Netzwerklaufwerk &verbinden..." , 252
|
MENUITEM "Netzwerklaufwerk &verbinden..." , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "Netzwerklaufwerk &trennen..." , 253
|
MENUITEM "Netzwerklaufwerk &trennen..." , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "F&reigeben als..." , 254
|
MENUITEM "F&reigeben als..." , 254
|
||||||
MENUITEM "Freigabe been&den..." , 255
|
MENUITEM "Freigabe been&den..." , 255
|
||||||
|
|
|
@ -63,8 +63,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Make System Disk...", -1 /*TODO*/
|
MENUITEM "&Make System Disk...", -1 /*TODO*/
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Connect &Network Drive" , 252
|
MENUITEM "Connect &Network Drive" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Disconnect Network Drive" , 253
|
MENUITEM "&Disconnect Network Drive" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Share as..." , 254
|
MENUITEM "Share as..." , 254
|
||||||
MENUITEM "&Remove Share..." , 255
|
MENUITEM "&Remove Share..." , 255
|
||||||
|
|
|
@ -61,8 +61,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Hacer disco de sistema...", -1 /*TODO*/
|
MENUITEM "&Hacer disco de sistema...", -1 /*TODO*/
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "C&onectar unidad de red" , 252
|
MENUITEM "C&onectar unidad de red" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Desconectar unidad de red" , 253
|
MENUITEM "&Desconectar unidad de red" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Co&mpartir como..." , 254
|
MENUITEM "Co&mpartir como..." , 254
|
||||||
MENUITEM "&Eliminar compartido..." , 255
|
MENUITEM "&Eliminar compartido..." , 255
|
||||||
|
|
|
@ -64,8 +64,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "Créer un disque *système...", -1 /*@@ */
|
MENUITEM "Créer un disque *système...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Connecter un lecteur &réseau" , 252
|
MENUITEM "Connecter un lecteur &réseau" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Déconnecter un lecteur réseau" , 253
|
MENUITEM "&Déconnecter un lecteur réseau" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Partager..." , 254
|
MENUITEM "&Partager..." , 254
|
||||||
MENUITEM "Cesser de parta&ger" , 255
|
MENUITEM "Cesser de parta&ger" , 255
|
||||||
|
|
|
@ -64,8 +64,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Rendszerlemez készítése...", -1 /*@@ */
|
MENUITEM "&Rendszerlemez készítése...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Hálózati meghajtó csatlakoztatása" , 252
|
MENUITEM "&Hálózati meghajtó csatlakoztatása" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "Hálózati meghajtó leválasztása" , 253
|
MENUITEM "Hálózati meghajtó leválasztása" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Megosztás..." , 254
|
MENUITEM "Megosztás..." , 254
|
||||||
MENUITEM "Megosztás &megszüntetése..." , 255
|
MENUITEM "Megosztás &megszüntetése..." , 255
|
||||||
|
|
|
@ -64,8 +64,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Crea Disco di Sistema...", -1 /*@@ */
|
MENUITEM "&Crea Disco di Sistema...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Connetti & Drive di Rete" , 252
|
MENUITEM "Connetti & Drive di Rete" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Disconnetti Drive di Rete" , 253
|
MENUITEM "&Disconnetti Drive di Rete" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Condividi come..." , 254
|
MENUITEM "Condividi come..." , 254
|
||||||
MENUITEM "&Rimuovi condivisione..." , 255
|
MENUITEM "&Rimuovi condivisione..." , 255
|
||||||
|
|
|
@ -5,7 +5,7 @@ SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = winefile.exe
|
MODULE = winefile.exe
|
||||||
APPMODE = -mwindows
|
APPMODE = -mwindows
|
||||||
IMPORTS = shell32 comdlg32 comctl32 ole32 user32 gdi32 kernel32
|
IMPORTS = shell32 comdlg32 comctl32 ole32 user32 gdi32 kernel32 mpr
|
||||||
EXTRALIBS = -luuid
|
EXTRALIBS = -luuid
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
|
|
|
@ -60,8 +60,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "Systeemdisk maken...", -1 /*@@ */
|
MENUITEM "Systeemdisk maken...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Verbinding &maken met netwerkchijf" , 252
|
MENUITEM "Verbinding &maken met netwerkchijf" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "Verbinding &verbreken met netwerkschijf" , 253
|
MENUITEM "Verbinding &verbreken met netwerkschijf" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Schijf &delen..." , 254
|
MENUITEM "Schijf &delen..." , 254
|
||||||
MENUITEM "Delen &ongedaan maken..." , 255
|
MENUITEM "Delen &ongedaan maken..." , 255
|
||||||
|
|
|
@ -64,8 +64,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Stwórz dysk systemowy...", -1 /*@@ */
|
MENUITEM "&Stwórz dysk systemowy...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Podłšcz Dysk Sieciowy" , 252
|
MENUITEM "&Pod³¹cz Dysk Sieciowy" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Odłšcz Dysk Sieciowy" , 253
|
MENUITEM "&Od³¹cz Dysk Sieciowy" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Udostêpnij jako..." , 254
|
MENUITEM "Udostêpnij jako..." , 254
|
||||||
MENUITEM "&Nie udostêpniaj..." , 255
|
MENUITEM "&Nie udostêpniaj..." , 255
|
||||||
|
|
|
@ -63,8 +63,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Gerar disco de sistema...", -1 /*@@ */
|
MENUITEM "&Gerar disco de sistema...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Conecta&r unidade de rede" , 252
|
MENUITEM "Conecta&r unidade de rede" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Desconectar unidade de rede" , 253
|
MENUITEM "&Desconectar unidade de rede" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "C&ompartilhar como..." , 254
|
MENUITEM "C&ompartilhar como..." , 254
|
||||||
MENUITEM "&Remover compartilhamento..." , 255
|
MENUITEM "&Remover compartilhamento..." , 255
|
||||||
|
@ -190,8 +190,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Gerar disco de sistema...", -1 /*@@ */
|
MENUITEM "&Gerar disco de sistema...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Conecta&r unidade de rede" , 252
|
MENUITEM "Conecta&r unidade de rede" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Desconectar unidade de rede" , 253
|
MENUITEM "&Desconectar unidade de rede" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Partilhar como..." , 254
|
MENUITEM "&Partilhar como..." , 254
|
||||||
MENUITEM "&Remover partilha..." , 255
|
MENUITEM "&Remover partilha..." , 255
|
||||||
|
|
|
@ -60,8 +60,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Ñîçäàòü ñèñòåìíûé äèñê...", -1 /*@@ */
|
MENUITEM "&Ñîçäàòü ñèñòåìíûé äèñê...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Подклю&чить сетевой диск" , 252
|
MENUITEM "Ïîäêëþ&÷èòü ñåòåâîé äèñê" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "Отк&лючить сетевой диск" , 253
|
MENUITEM "Îòê&ëþ÷èòü ñåòåâîé äèñê" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Ñäåëàòü î&áùèì êàê..." , 254
|
MENUITEM "Ñäåëàòü î&áùèì êàê..." , 254
|
||||||
MENUITEM "&Çàêðûòü îáùèé äîñòóï..." , 255
|
MENUITEM "&Çàêðûòü îáùèé äîñòóï..." , 255
|
||||||
|
|
|
@ -61,8 +61,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Make System Disk...", -1 /*@@ */
|
MENUITEM "&Make System Disk...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Connect &Network Drive" , 252
|
MENUITEM "Connect &Network Drive" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Disconnect Network Drive" , 253
|
MENUITEM "&Disconnect Network Drive" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Share as..." , 254
|
MENUITEM "Share as..." , 254
|
||||||
MENUITEM "&Remove Share..." , 255
|
MENUITEM "&Remove Share..." , 255
|
||||||
|
|
|
@ -59,13 +59,13 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "&Kopiera disk...", 201
|
MENUITEM "&Kopiera disk...", 201
|
||||||
MENUITEM "&Namnge disk...", 202
|
MENUITEM "&Namnge disk...", 202
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Formatera disk...", 203
|
MENUITEM "&Formatera disk...", ID_FORMAT_DISK
|
||||||
#ifdef _WIN95
|
#ifdef _WIN95
|
||||||
MENUITEM "&Skapa systemdisk...", -1 /*TODO*/
|
MENUITEM "&Skapa systemdisk...", -1 /*TODO*/
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Anslut &Nätverksenhet", 252
|
MENUITEM "Anslut &Nätverksenhet", ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "&Koppla ifrån Nätverksenhet", 253
|
MENUITEM "&Koppla ifrån Nätverksenhet", ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Dela ut...", 254
|
MENUITEM "Dela ut...", 254
|
||||||
MENUITEM "&Ta bort utdelning...", 255
|
MENUITEM "&Ta bort utdelning...", 255
|
||||||
|
|
|
@ -61,8 +61,8 @@ IDM_WINEFILE MENU FIXED IMPURE
|
||||||
MENUITEM "建立系统盘(&M)...", -1 /*@@ */
|
MENUITEM "建立系统盘(&M)...", -1 /*@@ */
|
||||||
#endif
|
#endif
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "连接网络驱动器(&N)" , 252
|
MENUITEM "连接网络驱动器(&N)" , ID_CONNECT_NETWORK_DRIVE
|
||||||
MENUITEM "断开网络驱动器连接(&D)" , 253
|
MENUITEM "断开网络驱动器连接(&D)" , ID_DISCONNECT_NETWORK_DRIVE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "共享为..." , 254
|
MENUITEM "共享为..." , 254
|
||||||
MENUITEM "删除共享(&R)..." , 255
|
MENUITEM "删除共享(&R)..." , 255
|
||||||
|
|
|
@ -42,6 +42,8 @@
|
||||||
#define ID_FILE_MOVE 106
|
#define ID_FILE_MOVE 106
|
||||||
#define ID_FILE_EXIT 115
|
#define ID_FILE_EXIT 115
|
||||||
#define ID_FORMAT_DISK 203
|
#define ID_FORMAT_DISK 203
|
||||||
|
#define ID_CONNECT_NETWORK_DRIVE 252
|
||||||
|
#define ID_DISCONNECT_NETWORK_DRIVE 253
|
||||||
#define ID_VIEW_NAME 401
|
#define ID_VIEW_NAME 401
|
||||||
#define ID_VIEW_ALL_ATTRIBUTES 402
|
#define ID_VIEW_ALL_ATTRIBUTES 402
|
||||||
#define ID_VIEW_SELECTED_ATTRIBUTES 403
|
#define ID_VIEW_SELECTED_ATTRIBUTES 403
|
||||||
|
|
|
@ -170,6 +170,7 @@ extern void WineWarranty(HWND hwnd);
|
||||||
static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd);
|
static void read_directory(Entry* dir, LPCTSTR path, SORT_ORDER sortOrder, HWND hwnd);
|
||||||
static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd);
|
static void set_curdir(ChildWnd* child, Entry* entry, int idx, HWND hwnd);
|
||||||
static void refresh_child(ChildWnd* child);
|
static void refresh_child(ChildWnd* child);
|
||||||
|
static void refresh_drives();
|
||||||
static void get_path(Entry* dir, PTSTR path);
|
static void get_path(Entry* dir, PTSTR path);
|
||||||
|
|
||||||
LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
|
LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
|
||||||
|
@ -227,6 +228,18 @@ static void display_error(HWND hwnd, DWORD error)
|
||||||
LocalFree(msg);
|
LocalFree(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* display network error message using WNetGetLastError() */
|
||||||
|
static void display_network_error(HWND hwnd)
|
||||||
|
{
|
||||||
|
TCHAR msg[BUFFER_LEN], provider[BUFFER_LEN], b2[BUFFER_LEN];
|
||||||
|
DWORD error;
|
||||||
|
|
||||||
|
if (WNetGetLastError(&error, msg, BUFFER_LEN, provider, BUFFER_LEN) == NO_ERROR)
|
||||||
|
MessageBox(hwnd, msg, RS(b2,IDS_WINEFILE), MB_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* allocate and initialise a directory entry */
|
/* allocate and initialise a directory entry */
|
||||||
static Entry* alloc_entry()
|
static Entry* alloc_entry()
|
||||||
{
|
{
|
||||||
|
@ -1880,6 +1893,10 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
|
||||||
free(child);
|
free(child);
|
||||||
break;}
|
break;}
|
||||||
|
|
||||||
|
case ID_REFRESH:
|
||||||
|
refresh_drives();
|
||||||
|
break;
|
||||||
|
|
||||||
case ID_WINDOW_CASCADE:
|
case ID_WINDOW_CASCADE:
|
||||||
SendMessage(Globals.hmdiclient, WM_MDICASCADE, 0, 0);
|
SendMessage(Globals.hmdiclient, WM_MDICASCADE, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -1970,6 +1987,30 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
|
||||||
}
|
}
|
||||||
break;}
|
break;}
|
||||||
|
|
||||||
|
case ID_CONNECT_NETWORK_DRIVE: {
|
||||||
|
DWORD ret = WNetConnectionDialog(hwnd, RESOURCETYPE_DISK);
|
||||||
|
if (ret == NO_ERROR)
|
||||||
|
refresh_drives();
|
||||||
|
else if (ret != (DWORD)-1) {
|
||||||
|
if (ret == ERROR_EXTENDED_ERROR)
|
||||||
|
display_network_error(hwnd);
|
||||||
|
else
|
||||||
|
display_error(hwnd, ret);
|
||||||
|
}
|
||||||
|
break;}
|
||||||
|
|
||||||
|
case ID_DISCONNECT_NETWORK_DRIVE: {
|
||||||
|
DWORD ret = WNetDisconnectDialog(hwnd, RESOURCETYPE_DISK);
|
||||||
|
if (ret == NO_ERROR)
|
||||||
|
refresh_drives();
|
||||||
|
else if (ret != (DWORD)-1) {
|
||||||
|
if (ret == ERROR_EXTENDED_ERROR)
|
||||||
|
display_network_error(hwnd);
|
||||||
|
else
|
||||||
|
display_error(hwnd, ret);
|
||||||
|
}
|
||||||
|
break;}
|
||||||
|
|
||||||
case ID_FORMAT_DISK: {
|
case ID_FORMAT_DISK: {
|
||||||
UINT sem_org = SetErrorMode(0); /* Get the current Error Mode settings. */
|
UINT sem_org = SetErrorMode(0); /* Get the current Error Mode settings. */
|
||||||
SetErrorMode(sem_org & ~SEM_FAILCRITICALERRORS); /* Force O/S to handle */
|
SetErrorMode(sem_org & ~SEM_FAILCRITICALERRORS); /* Force O/S to handle */
|
||||||
|
@ -3289,6 +3330,87 @@ static void refresh_child(ChildWnd* child)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void create_drive_bar()
|
||||||
|
{
|
||||||
|
TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0};
|
||||||
|
TCHAR b1[BUFFER_LEN];
|
||||||
|
int btn = 1;
|
||||||
|
PTSTR p;
|
||||||
|
|
||||||
|
GetLogicalDriveStrings(BUFFER_LEN, Globals.drives);
|
||||||
|
|
||||||
|
Globals.hdrivebar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
|
||||||
|
IDW_DRIVEBAR, 2, Globals.hInstance, IDB_DRIVEBAR, &drivebarBtn,
|
||||||
|
1, 16, 13, 16, 13, sizeof(TBBUTTON));
|
||||||
|
|
||||||
|
#ifndef _NO_EXTENSIONS
|
||||||
|
#ifdef __WINE__
|
||||||
|
/* insert unix file system button */
|
||||||
|
b1[0] = '/';
|
||||||
|
b1[1] = '\0';
|
||||||
|
b1[2] = '\0';
|
||||||
|
SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
|
||||||
|
|
||||||
|
drivebarBtn.idCommand = ID_DRIVE_UNIX_FS;
|
||||||
|
SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
|
||||||
|
drivebarBtn.iString++;
|
||||||
|
#endif
|
||||||
|
#ifdef _SHELL_FOLDERS
|
||||||
|
/* insert shell namespace button */
|
||||||
|
load_string(b1, IDS_SHELL);
|
||||||
|
b1[lstrlen(b1)+1] = '\0';
|
||||||
|
SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
|
||||||
|
|
||||||
|
drivebarBtn.idCommand = ID_DRIVE_SHELL_NS;
|
||||||
|
SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
|
||||||
|
drivebarBtn.iString++;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* register windows drive root strings */
|
||||||
|
SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)Globals.drives);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
drivebarBtn.idCommand = ID_DRIVE_FIRST;
|
||||||
|
|
||||||
|
for(p=Globals.drives; *p; ) {
|
||||||
|
#ifdef _NO_EXTENSIONS
|
||||||
|
/* insert drive letter */
|
||||||
|
TCHAR b[3] = {tolower(*p)};
|
||||||
|
SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b);
|
||||||
|
#endif
|
||||||
|
switch(GetDriveType(p)) {
|
||||||
|
case DRIVE_REMOVABLE: drivebarBtn.iBitmap = 1; break;
|
||||||
|
case DRIVE_CDROM: drivebarBtn.iBitmap = 3; break;
|
||||||
|
case DRIVE_REMOTE: drivebarBtn.iBitmap = 4; break;
|
||||||
|
case DRIVE_RAMDISK: drivebarBtn.iBitmap = 5; break;
|
||||||
|
default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
|
||||||
|
drivebarBtn.idCommand++;
|
||||||
|
drivebarBtn.iString++;
|
||||||
|
|
||||||
|
while(*p++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void refresh_drives()
|
||||||
|
{
|
||||||
|
RECT rect;
|
||||||
|
|
||||||
|
/* destroy drive bar */
|
||||||
|
DestroyWindow(Globals.hdrivebar);
|
||||||
|
Globals.hdrivebar = 0;
|
||||||
|
|
||||||
|
/* re-create drive bar */
|
||||||
|
create_drive_bar();
|
||||||
|
|
||||||
|
/* update window layout */
|
||||||
|
GetClientRect(Globals.hMainWnd, &rect);
|
||||||
|
SendMessage(Globals.hMainWnd, WM_SIZE, 0, MAKELONG(rect.right, rect.bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow)
|
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow)
|
||||||
{
|
{
|
||||||
HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow);
|
HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow);
|
||||||
|
@ -3737,6 +3859,7 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
|
||||||
break;}
|
break;}
|
||||||
|
|
||||||
case ID_REFRESH:
|
case ID_REFRESH:
|
||||||
|
refresh_drives();
|
||||||
refresh_child(child);
|
refresh_child(child);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -4074,70 +4197,9 @@ void show_frame(HWND hwndParent, int cmdshow)
|
||||||
Globals.hMainWnd, 0, Globals.hInstance, &ccs);
|
Globals.hMainWnd, 0, Globals.hInstance, &ccs);
|
||||||
|
|
||||||
|
|
||||||
{
|
CheckMenuItem(Globals.hMenuOptions, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
|
||||||
TBBUTTON drivebarBtn = {0, 0, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
|
|
||||||
int btn = 1;
|
|
||||||
PTSTR p;
|
|
||||||
|
|
||||||
Globals.hdrivebar = CreateToolbarEx(Globals.hMainWnd, WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST,
|
create_drive_bar();
|
||||||
IDW_DRIVEBAR, 2, Globals.hInstance, IDB_DRIVEBAR, &drivebarBtn,
|
|
||||||
1, 16, 13, 16, 13, sizeof(TBBUTTON));
|
|
||||||
CheckMenuItem(Globals.hMenuOptions, ID_VIEW_DRIVE_BAR, MF_BYCOMMAND|MF_CHECKED);
|
|
||||||
|
|
||||||
GetLogicalDriveStrings(BUFFER_LEN, Globals.drives);
|
|
||||||
|
|
||||||
drivebarBtn.fsStyle = BTNS_BUTTON;
|
|
||||||
|
|
||||||
#ifndef _NO_EXTENSIONS
|
|
||||||
#ifdef __WINE__
|
|
||||||
/* insert unix file system button */
|
|
||||||
b1[0] = '/';
|
|
||||||
b1[1] = '\0';
|
|
||||||
b1[2] = '\0';
|
|
||||||
SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
|
|
||||||
|
|
||||||
drivebarBtn.idCommand = ID_DRIVE_UNIX_FS;
|
|
||||||
SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
|
|
||||||
drivebarBtn.iString++;
|
|
||||||
#endif
|
|
||||||
#ifdef _SHELL_FOLDERS
|
|
||||||
/* insert shell namespace button */
|
|
||||||
load_string(b1, IDS_SHELL);
|
|
||||||
b1[lstrlen(b1)+1] = '\0';
|
|
||||||
SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b1);
|
|
||||||
|
|
||||||
drivebarBtn.idCommand = ID_DRIVE_SHELL_NS;
|
|
||||||
SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
|
|
||||||
drivebarBtn.iString++;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* register windows drive root strings */
|
|
||||||
SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)Globals.drives);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
drivebarBtn.idCommand = ID_DRIVE_FIRST;
|
|
||||||
|
|
||||||
for(p=Globals.drives; *p; ) {
|
|
||||||
#ifdef _NO_EXTENSIONS
|
|
||||||
/* insert drive letter */
|
|
||||||
TCHAR b[3] = {tolower(*p)};
|
|
||||||
SendMessage(Globals.hdrivebar, TB_ADDSTRING, 0, (LPARAM)b);
|
|
||||||
#endif
|
|
||||||
switch(GetDriveType(p)) {
|
|
||||||
case DRIVE_REMOVABLE: drivebarBtn.iBitmap = 1; break;
|
|
||||||
case DRIVE_CDROM: drivebarBtn.iBitmap = 3; break;
|
|
||||||
case DRIVE_REMOTE: drivebarBtn.iBitmap = 4; break;
|
|
||||||
case DRIVE_RAMDISK: drivebarBtn.iBitmap = 5; break;
|
|
||||||
default:/*DRIVE_FIXED*/ drivebarBtn.iBitmap = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
SendMessage(Globals.hdrivebar, TB_INSERTBUTTON, btn++, (LPARAM)&drivebarBtn);
|
|
||||||
drivebarBtn.idCommand++;
|
|
||||||
drivebarBtn.iString++;
|
|
||||||
|
|
||||||
while(*p++);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
TBBUTTON toolbarBtns[] = {
|
TBBUTTON toolbarBtns[] = {
|
||||||
|
|
Loading…
Reference in New Issue