Handle ESC key press in the MCIWND class as an alias to stop command. Take 2

Dmitry Timoshkov dmitry at baikal.ru
Wed Dec 21 03:34:56 CST 2005


Hello,

this time with ERR replaced by TRACE.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Handle ESC key press in the MCIWND class as an alias to stop command.

--- cvs/hq/wine/dlls/msvideo/mciwnd.c	2005-05-08 14:59:17.000000000 +0900
+++ wine/dlls/msvideo/mciwnd.c	2005-12-21 15:33:51.000000000 +0800
@@ -429,6 +429,21 @@ static LRESULT mci_get_devcaps(MCIWndInf
     return mci_devcaps.dwReturn;
 }
 
+static LRESULT MCIWND_KeyDown(MCIWndInfo *mwi, UINT key)
+{
+    TRACE("%p, key %04x\n", mwi->hWnd, key);
+
+    switch(key)
+    {
+    case VK_ESCAPE:
+        SendMessageW(mwi->hWnd, MCI_STOP, 0, 0);
+        return 0;
+
+    default:
+        return 0;
+    }
+}
+
 static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
 {
     MCIWndInfo *mwi;
@@ -477,6 +492,9 @@ static LRESULT WINAPI MCIWndProc(HWND hW
     case WM_COMMAND:
         return MCIWND_Command(mwi, wParam, lParam);
 
+    case WM_KEYDOWN:
+        return MCIWND_KeyDown(mwi, wParam);
+
     case WM_NCACTIVATE:
         if (mwi->uTimer)
         {





More information about the wine-patches mailing list