summaryrefslogtreecommitdiffstats
path: root/libvo/w32_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-03-16 18:57:23 +0100
committerwm4 <wm4@mplayer2.org>2012-03-16 19:14:44 +0100
commit6de8120822c2dd9c50ef23b4977421651396f1ae (patch)
tree11a977608cfc9f50cffbce4a879dd8e9b33b029c /libvo/w32_common.c
parent0eb21226cbfdd200f2aea5d3a9db2cdbff4773a5 (diff)
parenta8168102668337f3c11619bea7e744fc245adff1 (diff)
downloadmpv-6de8120822c2dd9c50ef23b4977421651396f1ae.tar.bz2
mpv-6de8120822c2dd9c50ef23b4977421651396f1ae.tar.xz
Merge remote-tracking branch 'origin/master' into my_master
Conflicts: command.c mp_core.h mplayer.c screenshot.c
Diffstat (limited to 'libvo/w32_common.c')
-rw-r--r--libvo/w32_common.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c
index a8a59d02c9..475327ce5c 100644
--- a/libvo/w32_common.c
+++ b/libvo/w32_common.c
@@ -41,6 +41,8 @@
#define MONITOR_DEFAULTTOPRIMARY 1
#endif
+#define WIN_ID_TO_HWND(x) ((HWND)(uint32_t)(x))
+
static const char classname[] = "MPlayer - The Movie Player";
int vo_vm = 0;
@@ -116,7 +118,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
break;
case WM_WINDOWPOSCHANGING:
if (vo_keepaspect && !vo_fs && WinID < 0) {
- WINDOWPOS *wpos = lParam;
+ WINDOWPOS *wpos = (WINDOWPOS*)lParam;
int xborder, yborder;
r.left = r.top = 0;
r.right = wpos->cx;
@@ -232,10 +234,10 @@ int vo_w32_check_events(void) {
vo_dx = p.x; vo_dy = p.y;
event_flags |= VO_EVENT_MOVE;
}
- res = GetClientRect(WinID, &r);
+ res = GetClientRect(WIN_ID_TO_HWND(WinID), &r);
if (res && (r.right != vo_dwidth || r.bottom != vo_dheight))
MoveWindow(vo_window, 0, 0, r.right, r.bottom, FALSE);
- if (!IsWindow(WinID))
+ if (!IsWindow(WIN_ID_TO_HWND(WinID)))
// Window has probably been closed, e.g. due to program crash
mplayer_put_key(KEY_CLOSE_WIN);
}
@@ -514,11 +516,11 @@ int vo_w32_init(void) {
if (WinID >= 0)
{
RECT r;
- GetClientRect(WinID, &r);
+ GetClientRect(WIN_ID_TO_HWND(WinID), &r);
vo_dwidth = r.right; vo_dheight = r.bottom;
vo_window = CreateWindowEx(WS_EX_NOPARENTNOTIFY, classname, classname,
- WS_CHILD | WS_VISIBLE,
- 0, 0, vo_dwidth, vo_dheight, WinID, 0, hInstance, 0);
+ WS_CHILD | WS_VISIBLE, 0, 0, vo_dwidth, vo_dheight,
+ WIN_ID_TO_HWND(WinID), 0, hInstance, 0);
EnableWindow(vo_window, 0);
} else
vo_window = CreateWindowEx(0, classname, classname,