* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <string.h>
#include "private_mciavi.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mciavi);
static const WCHAR mciaviW[] = {'M','C','I','A','V','I',0};
return FALSE;
}
-BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms)
+BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpParms)
{
static const WCHAR captionW[] = {'W','i','n','e',' ','M','C','I','-','A','V','I',' ','p','l','a','y','e','r',0};
HWND hParent = 0;
/* what should be done ? */
if (wma->hWnd) return TRUE;
- if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpOpenParms->hWndParent;
- if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpOpenParms->dwStyle;
+ if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpParms->hWndParent;
+ if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpParms->dwStyle;
+
+ if (wma->hic)
+ SetRect(&rc, 0, 0, wma->outbih->biWidth, wma->outbih->biHeight);
+ else
+ SetRect(&rc, 0, 0, wma->inbih->biWidth, wma->inbih->biHeight);
- rc.left = rc.top = 0;
- rc.right = (wma->hic ? wma->outbih : wma->inbih)->biWidth;
- rc.bottom = (wma->hic ? wma->outbih : wma->inbih)->biHeight;
AdjustWindowRect(&rc, dwStyle, FALSE);
if (!(dwStyle & (WS_CHILD|WS_POPUP))) /* overlapped window ? */
{
hParent, 0, MCIAVI_hInstance,
ULongToPtr(wma->wDevID));
wma->hWndPaint = wma->hWnd;
+
+ TRACE("(%04x, %08X, %p, style %x, parent %p, dimensions %dx%d, hwnd %p)\n", wma->wDevID,
+ dwFlags, lpParms, dwStyle, hParent, rc.right - rc.left, rc.bottom - rc.top, wma->hWnd);
return wma->hWnd != 0;
}
if (dwFlags & MCI_DGV_RECT) {
/* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
* So convert input MCI RECT into a normal RECT */
- rc.left = lpParms->rc.left;
- rc.top = lpParms->rc.top;
- rc.right = lpParms->rc.left + lpParms->rc.right;
- rc.bottom = lpParms->rc.top + lpParms->rc.bottom;
+ SetRect(&rc, lpParms->rc.left, lpParms->rc.top, lpParms->rc.left + lpParms->rc.right,
+ lpParms->rc.top + lpParms->rc.bottom);
} else {
GetClientRect(wma->hWndPaint, &rc);
}
}
if (dwFlags & MCI_DGV_WHERE_SOURCE) {
if (dwFlags & MCI_DGV_WHERE_MAX) {
- rc.left = 0;
- rc.top = 0;
- rc.right = wma->inbih->biWidth;
- rc.bottom = wma->inbih->biHeight;
+ SetRect(&rc, 0, 0, wma->inbih->biWidth, wma->inbih->biHeight);
TRACE("WHERE_SOURCE_MAX %s\n", wine_dbgstr_rect(&rc));
} else {
TRACE("WHERE_SOURCE %s\n", wine_dbgstr_rect(&wma->source));
/* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
* So convert the normal RECT into a MCI RECT before returning */
- lpParms->rc.left = rc.left;
- lpParms->rc.top = rc.top;
- lpParms->rc.right = rc.right - rc.left;
- lpParms->rc.bottom = rc.bottom - rc.top;
+ SetRect(&lpParms->rc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
LeaveCriticalSection(&wma->cs);
return 0;