Try

msndata.dwData := $547;

and

msndata.cbData := (Length(utf16buffer) * 2) + 2;

and you need to make sure the msg is only sent if the result is not zero.

and finally, check the way your defining that widestring, it maybe be some differences in Delphi.