Add support for some MCIWNDF_ styles, indicate that we do not support

MCIWNDM_* messages at all.
This commit is contained in:
Dmitry Timoshkov 2003-12-10 02:10:18 +00:00 committed by Alexandre Julliard
parent 5f32566530
commit 853329befe
1 changed files with 35 additions and 18 deletions

View File

@ -55,22 +55,18 @@ BOOL WINAPI MCIWndRegisterClass(HINSTANCE hInst)
{ {
WNDCLASSA wc; WNDCLASSA wc;
/* since window creation will also require some common controls, init them */ wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS | CS_OWNDC;
InitCommonControls();
wc.style = 0;
wc.lpfnWndProc = MCIWndProc; wc.lpfnWndProc = MCIWndProc;
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof(MCIWndInfo*); wc.cbWndExtra = sizeof(MCIWndInfo*);
wc.hInstance = hInst; wc.hInstance = hInst;
wc.hIcon = 0; wc.hIcon = 0;
wc.hCursor = 0; wc.hCursor = LoadCursorW(0, MAKEINTRESOURCEW(IDC_ARROW));
wc.hbrBackground = 0; wc.hbrBackground = 0;
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = "MCIWndClass"; wc.lpszClassName = "MCIWndClass";
return RegisterClassA(&wc); return RegisterClassA(&wc);
} }
/*********************************************************************** /***********************************************************************
@ -232,23 +228,38 @@ static void MCIWND_Create(HWND hWnd, LPCREATESTRUCTA cs)
SetWindowPos(hWnd, 0, 0, 0, mdrct.rc.right - mdrct.rc.left, SetWindowPos(hWnd, 0, 0, 0, mdrct.rc.right - mdrct.rc.left,
mdrct.rc.bottom - mdrct.rc.top + 32, SWP_NOMOVE|SWP_NOZORDER); mdrct.rc.bottom - mdrct.rc.top + 32, SWP_NOMOVE|SWP_NOZORDER);
if (!(mwi->dwStyle & MCIWNDF_NOMENU))
{
hChld = CreateWindowExA(0, "BUTTON", "Menu", WS_CHILD|WS_VISIBLE, 32, cy, 32, 32,
hWnd, (HMENU)CTL_MENU,
(HINSTANCE)GetWindowLongA(hWnd, GWL_HINSTANCE), 0L);
TRACE("Get Button2: %p\n", hChld);
}
if (!(mwi->dwStyle & MCIWNDF_NOPLAYBAR))
{
INITCOMMONCONTROLSEX init;
/* adding the other elements: play/stop button, menu button, status */ /* adding the other elements: play/stop button, menu button, status */
hChld = CreateWindowExA(0, "BUTTON", "Play", WS_CHILD|WS_VISIBLE, 0, cy, 32, 32, hChld = CreateWindowExA(0, "BUTTON", "Play", WS_CHILD|WS_VISIBLE, 0, cy, 32, 32,
hWnd, (HMENU)CTL_PLAYSTOP, hWnd, (HMENU)CTL_PLAYSTOP,
(HINSTANCE)GetWindowLongA(hWnd, GWL_HINSTANCE), 0L); (HINSTANCE)GetWindowLongA(hWnd, GWL_HINSTANCE), 0L);
TRACE("Get Button1: %p\n", hChld); TRACE("Get Button1: %p\n", hChld);
hChld = CreateWindowExA(0, "BUTTON", "Menu", WS_CHILD|WS_VISIBLE, 32, cy, 32, 32,
hWnd, (HMENU)CTL_MENU, init.dwSize = sizeof(init);
(HINSTANCE)GetWindowLongA(hWnd, GWL_HINSTANCE), 0L); init.dwICC = ICC_BAR_CLASSES;
TRACE("Get Button2: %p\n", hChld); InitCommonControlsEx(&init);
hChld = CreateWindowExA(0, TRACKBAR_CLASSA, "", WS_CHILD|WS_VISIBLE, 64, cy, cx - 64, 32, hChld = CreateWindowExA(0, TRACKBAR_CLASSA, "", WS_CHILD|WS_VISIBLE, 64, cy, cx - 64, 32,
hWnd, (HMENU)CTL_TRACKBAR, hWnd, (HMENU)CTL_TRACKBAR,
(HINSTANCE)GetWindowLongA(hWnd, GWL_HINSTANCE), 0L); (HINSTANCE)GetWindowLongA(hWnd, GWL_HINSTANCE), 0L);
TRACE("Get status: %p\n", hChld); TRACE("Get status: %p\n", hChld);
SendMessageA(hChld, TBM_SETRANGEMIN, 0L, 0L); SendMessageA(hChld, TBM_SETRANGEMIN, 0L, 0L);
SendMessageA(hChld, TBM_SETRANGEMAX, 1L, MCIWND_Get(mwi, MCI_STATUS_LENGTH)); SendMessageA(hChld, TBM_SETRANGEMAX, 1L, MCIWND_Get(mwi, MCI_STATUS_LENGTH));
}
/* FIXME: no need to set it if child window */ /* FIXME: no need to set it if child window */
if (mwi->dwStyle & MCIWNDF_SHOWNAME)
MCIWND_SetText(mwi); MCIWND_SetText(mwi);
} }
@ -345,5 +356,11 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lP
} }
} }
if ((wMsg >= WM_USER) && (wMsg < WM_APP))
{
FIXME("support for MCIWNDM_ message WM_USER+%d not implemented\n", wMsg - WM_USER);
return 0;
}
return DefWindowProcA(hWnd, wMsg, lParam1, lParam2); return DefWindowProcA(hWnd, wMsg, lParam1, lParam2);
} }