Author: dreimer
Date: Mon Feb 3 20:32:25 2014
New Revision: 61968
URL:
http://svn.reactos.org/svn/reactos?rev=61968&view=rev
Log:
[mplay32]
Media Player error handling by Ricardo Hanke
CORE-7800 #resolve #comment Committed in r61968. Thx for help.
Modified:
trunk/reactos/base/applications/mplay32/lang/bg-BG.rc
trunk/reactos/base/applications/mplay32/lang/cs-CZ.rc
trunk/reactos/base/applications/mplay32/lang/de-DE.rc
trunk/reactos/base/applications/mplay32/lang/en-US.rc
trunk/reactos/base/applications/mplay32/lang/es-ES.rc
trunk/reactos/base/applications/mplay32/lang/fr-FR.rc
trunk/reactos/base/applications/mplay32/lang/he-IL.rc
trunk/reactos/base/applications/mplay32/lang/it-IT.rc
trunk/reactos/base/applications/mplay32/lang/ja-JP.rc
trunk/reactos/base/applications/mplay32/lang/nl-NL.rc
trunk/reactos/base/applications/mplay32/lang/no-NO.rc
trunk/reactos/base/applications/mplay32/lang/pl-PL.rc
trunk/reactos/base/applications/mplay32/lang/pt-BR.rc
trunk/reactos/base/applications/mplay32/lang/ro-RO.rc
trunk/reactos/base/applications/mplay32/lang/ru-RU.rc
trunk/reactos/base/applications/mplay32/lang/sk-SK.rc
trunk/reactos/base/applications/mplay32/lang/sq-AL.rc
trunk/reactos/base/applications/mplay32/lang/sv-SE.rc
trunk/reactos/base/applications/mplay32/lang/tr-TR.rc
trunk/reactos/base/applications/mplay32/lang/uk-UA.rc
trunk/reactos/base/applications/mplay32/lang/zh-CN.rc
trunk/reactos/base/applications/mplay32/lang/zh-TW.rc
trunk/reactos/base/applications/mplay32/mplay32.c
trunk/reactos/base/applications/mplay32/resource.h
Modified: trunk/reactos/base/applications/mplay32/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/bg-BG.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/bg-BG.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -38,4 +38,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/cs-CZ.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/cs-CZ.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -39,4 +39,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/de-DE.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/en-US.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/es-ES.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/fr-FR.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/he-IL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/he-IL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/he-IL.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/it-IT.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/ja-JP.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/nl-NL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/nl-NL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/nl-NL.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/no-NO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/no-NO.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/pl-PL.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -41,4 +41,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/pt-BR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/pt-BR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/pt-BR.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -36,4 +36,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/ro-RO.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -40,4 +40,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/ru-RU.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -34,4 +34,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/sk-SK.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -39,4 +39,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/sq-AL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/sq-AL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/sq-AL.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -38,4 +38,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/sv-SE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/sv-SE.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -41,4 +41,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/tr-TR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/tr-TR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/tr-TR.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -36,4 +36,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/uk-UA.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -42,4 +42,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/zh-CN.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -36,4 +36,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/lang/zh-TW.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/lang/zh-TW.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/lang/zh-TW.rc [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -42,4 +42,5 @@
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
Modified: trunk/reactos/base/applications/mplay32/mplay32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/mplay32.c [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -216,7 +216,7 @@
DisableMenuItems();
- return TRUE;
+ return 0;
}
static DWORD
@@ -241,7 +241,6 @@
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 @@
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 @@
EnableMenuItems();
- return TRUE;
+ return 0;
}
static VOID
@@ -415,7 +413,7 @@
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 @@
TCHAR szLocalFileName[MAX_PATH];
TCHAR szDeviceName[MAX_PATH];
DWORD dwSize;
- BOOL IsSupported;
MCIERROR mciError;
if (lpFileName == NULL)
@@ -470,11 +467,21 @@
dwSize = sizeof(szDeviceName) - 2;
_tcsnset(szDeviceName, _T('\0'), dwSize / sizeof(TCHAR));
- IsSupported = IsSupportedFileExtension(szLocalFileName, szDeviceName, &dwSize);
-
- if (IsSupported == TRUE)
- {
- OpenMciDevice(hwnd, szDeviceName, szLocalFileName);
+
+ if (!IsSupportedFileExtension(szLocalFileName, szDeviceName, &dwSize))
+ {
+ 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 @@
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;
Modified: trunk/reactos/base/applications/mplay32/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mplay32/…
==============================================================================
--- trunk/reactos/base/applications/mplay32/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mplay32/resource.h [iso-8859-1] Mon Feb 3 20:32:25
2014
@@ -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