${^WIDE_SYSTEM_CALLS}= 1; use strict; use Win32::GUI; use Win32::API; my $s= "This is a TM symbol =>x"; my $setTextF= new Win32::API:: ('user32.dll', 'SetWindowTextW', ['N','P'], 'N') or die; my $getTextF= new Win32::API:: ('user32.dll', 'GetWindowTextW', ['N','P','N'], 'N') or die; my $window = Win32::GUI::Window->new ( -width => 400, # Set the width -height => 200, # Set the height -text => "Hello World Title", # Set the title -name => "window1", # Set the name (used for event handlers) ); my $font = Win32::GUI::Font->new ( -size => 20, # Set the size (in points) -name => "Comic Sans MS", # Name of the font ); my $lable = $window->AddLabel( -text => $s, # Set the text in the label -font => $font, # Set the font -foreground => [0, 0, 255], # Set the color of the text -name => 'text1' ); my $handle= $window->{text1}{-handle}; print $handle; $window->Show (); change_text(); sub window1_Terminate { return -1; # Return -1 to end the event loop } sub change_text { use bytes; my $s= 'x'x256; $getTextF->Call ($handle, $s, 128); substr ($s,46,2, "\x22\x21"); #substr ($s,40,2, "\x22\x21"); $setTextF->Call ($handle, $s); $s =~ tr/\0 /.-/; print "$s\n"; $getTextF->Call ($handle, $s, 128); $s =~ tr/\0 /.-/; print $s; }