Commit 8744dc30 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

MSN: (hopefully) correct non-ASCII characters (fixes #3952)

VLC code page is UTF-8, not ANSI.
parent fef50057
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <vlc_meta.h> #include <vlc_meta.h>
#include <vlc_playlist.h> #include <vlc_playlist.h>
#include <vlc_strings.h> #include <vlc_strings.h>
#include <vlc_charset.h>
/***************************************************************************** /*****************************************************************************
* intf_sys_t: description and status of log interface * intf_sys_t: description and status of log interface
...@@ -181,20 +182,18 @@ static int SendToMSN( const char *psz_msg ) ...@@ -181,20 +182,18 @@ static int SendToMSN( const char *psz_msg )
COPYDATASTRUCT msndata; COPYDATASTRUCT msndata;
HWND msnui = NULL; HWND msnui = NULL;
wchar_t buffer[MSN_MAX_LENGTH]; wchar_t *wmsg = ToWide( psz_msg );
if( unlikely(wmsg == NULL) )
//mbstowcs( buffer, psz_msg, MSN_MAX_LENGTH ); return VLC_ENOMEM;
int nLen = MultiByteToWideChar(CP_ACP, 0, psz_msg, -1, NULL, 0);
MultiByteToWideChar(CP_ACP, 0, psz_msg, -1, &buffer, nLen);
msndata.dwData = 0x547; msndata.dwData = 0x547;
msndata.lpData = &buffer; msndata.lpData = wmsg;
msndata.cbData = (lstrlenW(buffer)*2)+2; msndata.cbData = (wcslen(wmsg) + 1) * 2;
while( ( msnui = FindWindowEx( NULL, msnui, "MsnMsgrUIManager", NULL ) ) ) while( ( msnui = FindWindowEx( NULL, msnui, "MsnMsgrUIManager", NULL ) ) )
{ {
SendMessage(msnui, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&msndata); SendMessage(msnui, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&msndata);
} }
free( wmsg );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment