C code
Code:
void clear_msn_title()
{
	HWND msnui = NULL;
	string_utf16_from_utf8 utf16buffer("\\0Music\\00\\0{0} - {1}\\0\\0\\0\\0\\0");
	msndata.dwData = 0x547;
	msndata.lpData = (void*)utf16buffer.get_ptr();
	msndata.cbData = (utf16buffer.length()*2)+2;

	while (msnui = FindWindowEx(NULL, msnui, "MsnMsgrUIManager", NULL))
	{
		SendMessage(msnui, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&msndata);
	}
}
this is what i have did, but does not work =(
Code:
var
  msndata: CopyDataStruct;
  msnwindow: HWND;
  utf16buffer: WideString;
begin
  utf16buffer := '\\0Music\\00\\0{0} - {1}\\0\\0\\0\\0\\0';
  msndata.dwData := StrToInt('0x547');
  msndata.cbData := Length(utf16buffer) * 2 + 2;
  msndata.lpData := Pointer(utf16buffer);
  msnwindow := 0;

  repeat
    msnwindow := FindWindowEx(0, msnwindow, 'MsnMsgrUIManager', nil);
    SendMessage(msnwindow, WM_CLOSE, WM_CLOSE,Integer(@msndata));
  until msnwindow = 0;
end;
:cry: What im doing wrong?