diff --git a/reactos/base/applications/mplay32/lang/bg-BG.rc b/reactos/base/applications/mplay32/lang/bg-BG.rc index 094f82da059..71ad20bb529 100644 --- a/reactos/base/applications/mplay32/lang/bg-BG.rc +++ b/reactos/base/applications/mplay32/lang/bg-BG.rc @@ -38,4 +38,5 @@ BEGIN IDS_APPTITLE "Мултимедийният възпроизводител на РеактОС" IDS_PLAY "Възпроизвеждане" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/cs-CZ.rc b/reactos/base/applications/mplay32/lang/cs-CZ.rc index 54b2642e454..05e0528bb53 100644 --- a/reactos/base/applications/mplay32/lang/cs-CZ.rc +++ b/reactos/base/applications/mplay32/lang/cs-CZ.rc @@ -39,4 +39,5 @@ BEGIN IDS_APPTITLE "ReactOS Přehrávač multimédií" IDS_PLAY "Přehrát" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/de-DE.rc b/reactos/base/applications/mplay32/lang/de-DE.rc index da981305d96..10dfb85d4cc 100644 --- a/reactos/base/applications/mplay32/lang/de-DE.rc +++ b/reactos/base/applications/mplay32/lang/de-DE.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "ReactOS Multimedia Player" IDS_PLAY "Abspielen" IDS_DEFAULTMCIERRMSG "Für diesen Fehler steht keine Beschreibung zur Verfügung" + IDS_UNKNOWNFILEEXT "Kann keinen Gerätetyp aus der angegebenen Dateinamenerweiterung ermitteln." END diff --git a/reactos/base/applications/mplay32/lang/en-US.rc b/reactos/base/applications/mplay32/lang/en-US.rc index 1d051caff2f..ce326d352f1 100644 --- a/reactos/base/applications/mplay32/lang/en-US.rc +++ b/reactos/base/applications/mplay32/lang/en-US.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "ReactOS Multimedia Player" IDS_PLAY "Play" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/es-ES.rc b/reactos/base/applications/mplay32/lang/es-ES.rc index 32820edce02..dbf0f6eb350 100644 --- a/reactos/base/applications/mplay32/lang/es-ES.rc +++ b/reactos/base/applications/mplay32/lang/es-ES.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "Reproductor Multimedia de ReactOS" IDS_PLAY "Reproducir" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/fr-FR.rc b/reactos/base/applications/mplay32/lang/fr-FR.rc index 9a16e97fd2c..db3b38daa26 100644 --- a/reactos/base/applications/mplay32/lang/fr-FR.rc +++ b/reactos/base/applications/mplay32/lang/fr-FR.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "ReactOS Multimedia Player" IDS_PLAY "Lire" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/he-IL.rc b/reactos/base/applications/mplay32/lang/he-IL.rc index b4509eae544..56c18d82449 100644 --- a/reactos/base/applications/mplay32/lang/he-IL.rc +++ b/reactos/base/applications/mplay32/lang/he-IL.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "נגן המולטימדיה של ReactOS" IDS_PLAY "נגן" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/it-IT.rc b/reactos/base/applications/mplay32/lang/it-IT.rc index 3787b5fe3ed..c45d241caf2 100644 --- a/reactos/base/applications/mplay32/lang/it-IT.rc +++ b/reactos/base/applications/mplay32/lang/it-IT.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "Riproduttore multimediale ReactOS" IDS_PLAY "Riproduci" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/ja-JP.rc b/reactos/base/applications/mplay32/lang/ja-JP.rc index cb620a0818e..f8856aad263 100644 --- a/reactos/base/applications/mplay32/lang/ja-JP.rc +++ b/reactos/base/applications/mplay32/lang/ja-JP.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "ReactOS マルチメディア プレーヤー" IDS_PLAY "再生" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/nl-NL.rc b/reactos/base/applications/mplay32/lang/nl-NL.rc index 228f59d5692..bf8dc6a317f 100644 --- a/reactos/base/applications/mplay32/lang/nl-NL.rc +++ b/reactos/base/applications/mplay32/lang/nl-NL.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "ReactOS Multimedia Player" IDS_PLAY "Play" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/no-NO.rc b/reactos/base/applications/mplay32/lang/no-NO.rc index 558d5127973..ccc77a535c2 100644 --- a/reactos/base/applications/mplay32/lang/no-NO.rc +++ b/reactos/base/applications/mplay32/lang/no-NO.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "ReactOS Multimedia avspiller" IDS_PLAY "Spill" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/pl-PL.rc b/reactos/base/applications/mplay32/lang/pl-PL.rc index 1b89df31e3f..5c21137ef55 100644 --- a/reactos/base/applications/mplay32/lang/pl-PL.rc +++ b/reactos/base/applications/mplay32/lang/pl-PL.rc @@ -41,4 +41,5 @@ BEGIN IDS_APPTITLE "ReactOS Multimedia Player" IDS_PLAY "Odtwórz" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/pt-BR.rc b/reactos/base/applications/mplay32/lang/pt-BR.rc index 5724bfb2097..e1bf6e24caf 100644 --- a/reactos/base/applications/mplay32/lang/pt-BR.rc +++ b/reactos/base/applications/mplay32/lang/pt-BR.rc @@ -36,4 +36,5 @@ BEGIN IDS_APPTITLE "ReactOS Multimedia Player" IDS_PLAY "Executar" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/ro-RO.rc b/reactos/base/applications/mplay32/lang/ro-RO.rc index c95e48f008f..6490db17f23 100644 --- a/reactos/base/applications/mplay32/lang/ro-RO.rc +++ b/reactos/base/applications/mplay32/lang/ro-RO.rc @@ -40,4 +40,5 @@ BEGIN IDS_APPTITLE "Lector multimedia" IDS_PLAY "Lecturare" IDS_DEFAULTMCIERRMSG "Nu există descriere pentru această eroare" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/ru-RU.rc b/reactos/base/applications/mplay32/lang/ru-RU.rc index 58355bd5f28..260b738898b 100644 --- a/reactos/base/applications/mplay32/lang/ru-RU.rc +++ b/reactos/base/applications/mplay32/lang/ru-RU.rc @@ -34,4 +34,5 @@ BEGIN IDS_APPTITLE "Проигрыватель ReactOS" IDS_PLAY "Воспроизвести" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/sk-SK.rc b/reactos/base/applications/mplay32/lang/sk-SK.rc index 06786d6391b..9f52f4f0f71 100644 --- a/reactos/base/applications/mplay32/lang/sk-SK.rc +++ b/reactos/base/applications/mplay32/lang/sk-SK.rc @@ -39,4 +39,5 @@ BEGIN IDS_APPTITLE "Multimediálny prehrávač systému ReactOS" IDS_PLAY "Prehrať" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/sq-AL.rc b/reactos/base/applications/mplay32/lang/sq-AL.rc index 60f1acefc20..20d2af13b21 100644 --- a/reactos/base/applications/mplay32/lang/sq-AL.rc +++ b/reactos/base/applications/mplay32/lang/sq-AL.rc @@ -38,4 +38,5 @@ BEGIN IDS_APPTITLE "Programi muzikor i ReactOS" IDS_PLAY "Fillo" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/sv-SE.rc b/reactos/base/applications/mplay32/lang/sv-SE.rc index da17bec4694..dec23858ef3 100644 --- a/reactos/base/applications/mplay32/lang/sv-SE.rc +++ b/reactos/base/applications/mplay32/lang/sv-SE.rc @@ -41,4 +41,5 @@ BEGIN IDS_APPTITLE "ReactOS Multimediaspelare" IDS_PLAY "Play" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/tr-TR.rc b/reactos/base/applications/mplay32/lang/tr-TR.rc index 187004ca956..3ea689d897b 100644 --- a/reactos/base/applications/mplay32/lang/tr-TR.rc +++ b/reactos/base/applications/mplay32/lang/tr-TR.rc @@ -36,4 +36,5 @@ BEGIN IDS_APPTITLE "Ortam Oynatıcısı" IDS_PLAY "Çal" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/uk-UA.rc b/reactos/base/applications/mplay32/lang/uk-UA.rc index 395a693fc9e..724bf0f4faf 100644 --- a/reactos/base/applications/mplay32/lang/uk-UA.rc +++ b/reactos/base/applications/mplay32/lang/uk-UA.rc @@ -42,4 +42,5 @@ BEGIN IDS_APPTITLE "Програвач ReactOS" IDS_PLAY "Відтворити" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/zh-CN.rc b/reactos/base/applications/mplay32/lang/zh-CN.rc index 3c3068d3574..3106fc6db1a 100644 --- a/reactos/base/applications/mplay32/lang/zh-CN.rc +++ b/reactos/base/applications/mplay32/lang/zh-CN.rc @@ -36,4 +36,5 @@ BEGIN IDS_APPTITLE "ReactOS 多媒体播放器" IDS_PLAY "播放" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/lang/zh-TW.rc b/reactos/base/applications/mplay32/lang/zh-TW.rc index a2a8bdeb8c6..63689ebf776 100644 --- a/reactos/base/applications/mplay32/lang/zh-TW.rc +++ b/reactos/base/applications/mplay32/lang/zh-TW.rc @@ -42,4 +42,5 @@ BEGIN IDS_APPTITLE "ReactOS 多媒體播放器" IDS_PLAY "播放" IDS_DEFAULTMCIERRMSG "No description is available for this error" + IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." END diff --git a/reactos/base/applications/mplay32/mplay32.c b/reactos/base/applications/mplay32/mplay32.c index e5dc33009b6..f4220f2feb3 100644 --- a/reactos/base/applications/mplay32/mplay32.c +++ b/reactos/base/applications/mplay32/mplay32.c @@ -216,7 +216,7 @@ CloseMciDevice(VOID) DisableMenuItems(); - return TRUE; + return 0; } static DWORD @@ -241,7 +241,6 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName) dwError = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT | MCI_WAIT, (DWORD_PTR)&mciOpen); if (dwError != 0) { - ShowMCIError(hwnd, dwError); return dwError; } @@ -250,7 +249,6 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName) dwError = mciSendCommand(mciOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD_PTR)&mciStatus); if (dwError != 0) { - ShowMCIError(hwnd, dwError); return dwError; } @@ -287,7 +285,7 @@ OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName) EnableMenuItems(); - return TRUE; + return 0; } static VOID @@ -415,7 +413,7 @@ ShowDeviceProperties(HWND hwnd) dwError = mciSendCommand(wDeviceId, MCI_CONFIGURE, MCI_WAIT, (DWORD_PTR)&mciGeneric); if (dwError != 0) { - MessageBox(0, _T("Can't display the device properties!"), NULL, MB_OK); + ShowMCIError(hwnd, dwError); } } @@ -448,7 +446,6 @@ PlayFile(HWND hwnd, LPTSTR lpFileName) TCHAR szLocalFileName[MAX_PATH]; TCHAR szDeviceName[MAX_PATH]; DWORD dwSize; - BOOL IsSupported; MCIERROR mciError; if (lpFileName == NULL) @@ -470,11 +467,21 @@ PlayFile(HWND hwnd, LPTSTR lpFileName) dwSize = sizeof(szDeviceName) - 2; _tcsnset(szDeviceName, _T('\0'), dwSize / sizeof(TCHAR)); - IsSupported = IsSupportedFileExtension(szLocalFileName, szDeviceName, &dwSize); - if (IsSupported == TRUE) + if (!IsSupportedFileExtension(szLocalFileName, szDeviceName, &dwSize)) { - OpenMciDevice(hwnd, szDeviceName, szLocalFileName); + TCHAR szErrorMessage[256]; + + LoadString(hInstance, IDS_UNKNOWNFILEEXT, szErrorMessage, sizeof(szErrorMessage) / sizeof(TCHAR)); + MessageBox(hwnd, szErrorMessage, szAppTitle, MB_OK | MB_ICONEXCLAMATION); + return; + } + + mciError = OpenMciDevice(hwnd, szDeviceName, szLocalFileName); + if (mciError != 0) + { + ShowMCIError(hwnd, mciError); + return; } SetTimer(hwnd, IDT_PLAYTIMER, 100, (TIMERPROC) PlayTimerProc); @@ -540,7 +547,7 @@ MainWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) TCHAR droppedfile[MAX_PATH]; drophandle = (HDROP)wParam; - DragQueryFile(drophandle, 0, droppedfile, sizeof(droppedfile)); + DragQueryFile(drophandle, 0, droppedfile, sizeof(droppedfile) / sizeof(TCHAR)); DragFinish(drophandle); PlayFile(hwnd, droppedfile); break; diff --git a/reactos/base/applications/mplay32/resource.h b/reactos/base/applications/mplay32/resource.h index ea7588585e0..19c6d3eac3f 100644 --- a/reactos/base/applications/mplay32/resource.h +++ b/reactos/base/applications/mplay32/resource.h @@ -25,6 +25,7 @@ #define IDS_ALL_TYPES_FILTER 108 #define IDS_PLAY 109 #define IDS_DEFAULTMCIERRMSG 110 +#define IDS_UNKNOWNFILEEXT 111 /* Menu */ #define IDR_MAINMENU 500