This works only for ASCII strings, not unicode:
int bsplayer_openFile(HWND bsp_hand, HWND bsremote_hwnd, bool fullscreen, wchar_t* filename)
{
char* fff = (char*) calloc(1000, 1);
size_t sizeRequired = WideCharToMultiByte( 950, 0, filename, -1, fff, 1000, NULL, NULL);
COPYDATASTRUCT cds;
cds.dwData = BSP_OpenFile;
cds.lpData = (void *) fff;
cds.cbData = (DWORD) sizeRequired +2;
int result = SendMessage(bsp_hand, WM_COPYDATA, (WPARAM) bsremote_hwnd, (LPARAM)&cds);
..
}
|