1 /*****************************************************************************
2 * winvlc.c: the Windows VLC player
3 *****************************************************************************
4 * Copyright (C) 1998-2008 the VideoLAN team
6 * Authors: Vincent Seguin <seguin@via.ecp.fr>
7 * Samuel Hocevar <sam@zoy.org>
8 * Gildas Bazin <gbazin@videolan.org>
9 * Derk-Jan Hartman <hartman at videolan dot org>
10 * Lots of other people, see the libvlc AUTHORS file
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
38 static char *FromWide (const wchar_t *wide)
41 len = WideCharToMultiByte (CP_UTF8, 0, wide, -1, NULL, 0, NULL, NULL);
43 char *out = (char *)malloc (len);
45 WideCharToMultiByte (CP_UTF8, 0, wide, -1, out, len, NULL, NULL);
50 int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
59 wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc);
64 for (int i = 0; i < argc; i++)
65 argv[i] = FromWide (wargv[i]);
69 libvlc_exception_t ex, dummy;
70 libvlc_exception_init (&ex);
71 libvlc_exception_init (&dummy);
73 /* Initialize libvlc */
74 libvlc_instance_t *vlc;
75 vlc = libvlc_new (argc - 1, (const char **)argv + 1, &ex);
78 libvlc_add_intf (vlc, NULL, &ex);
79 libvlc_playlist_play (vlc, -1, 0, NULL, &dummy);
84 ret = libvlc_exception_raised (&ex);
85 libvlc_exception_clear (&ex);
86 libvlc_exception_clear (&dummy);
88 for (int i = 0; i < argc; i++)
91 (void)hInstance; (void)hPrevInstance; (void)lpCmdLine; (void)nCmdShow;