6 extern HINSTANCE hInst
;
8 LRESULT CALLBACK
WndProc(HWND hwnd
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
19 return DefWindowProc(hwnd
, msg
, wParam
, lParam
);
24 int __stdcall
show_vlc(void *data
)
26 libvlc_instance_t
* inst
;
27 libvlc_media_player_t
*mp
;
33 /* Load the VLC engine */
34 inst
= libvlc_new (0, NULL
);
36 /* Create a new item */
37 m
= libvlc_media_new_path (inst
, "C:\\Temp\\[001_1-01] Broken Bow (Part 1).mpg");
39 /* Create a media player playing environement */
40 mp
= libvlc_media_player_new_from_media (m
);
42 /* No need to keep the media now */
43 libvlc_media_release (m
);
46 //Step 1: Registering the Window Class
47 wc
.cbSize
= sizeof(WNDCLASSEX
);
49 wc
.lpfnWndProc
= WndProc
;
53 wc
.hIcon
= LoadIcon(NULL
, IDI_APPLICATION
);
54 wc
.hCursor
= LoadCursor(NULL
, IDC_ARROW
);
55 wc
.hbrBackground
= (HBRUSH
)(COLOR_WINDOW
+1);
56 wc
.lpszMenuName
= NULL
;
57 wc
.lpszClassName
= L
"myclassstuff";
58 wc
.hIconSm
= LoadIcon(NULL
, IDI_APPLICATION
);
60 if(!RegisterClassEx(&wc
))
62 MessageBox(NULL
, L
"Window Registration Failed!", L
"Error!", MB_ICONEXCLAMATION
| MB_OK
);
66 w
= CreateWindow(L
"myclassstuff", L
"VLC Window", WS_OVERLAPPEDWINDOW
, 50, 50, 400, 400, NULL
, NULL
, hInst
, NULL
);
70 DWORD d
= GetLastError();
71 printf ("===================== %08x ==============\n", d
);
75 // libvlc_media_player_set_hwnd (mp, w);
77 // ShowWindow(w, SW_SHOW);
81 /* This is a non working code that show how to hooks into a window,
82 * if we have a window around */
83 libvlc_media_player_set_xdrawable (mp
, xdrawable
);
86 libvlc_media_player_set_nsobject (mp
, view
);
89 /* play the media_player */
90 rc
= libvlc_media_player_play (mp
);
92 Sleep (60000); /* Let it play a bit */
95 libvlc_media_player_stop (mp
);
97 /* Free the media_player */
98 libvlc_media_player_release (mp
);
100 libvlc_release (inst
);