sub t2w {
my ($text) = @_;
return encode("UTF-16LE", $text . "\x00");
}
our $SetWindowTextW_fn = undef;
sub text {
my ($control, $text) = @_;
if (not $SetWindowTextW_fn) {
$SetWindowTextW_fn = Win32::API->new("user32", "SetWindowTextW",
"NP", "N");
die unless $SetWindowTextW_fn;
}
$SetWindowTextW_fn->Call($control->{-handle}, t2w($text));
}