Skip to content

Instantly share code, notes, and snippets.

@trueroad
Last active March 17, 2020 11:53
Show Gist options
  • Save trueroad/beca65328fd5c165e32c25457729a0a7 to your computer and use it in GitHub Desktop.
Save trueroad/beca65328fd5c165e32c25457729a0a7 to your computer and use it in GitHub Desktop.
Perl Win32 -W API sample
use strict;
use utf8;
use Encode;
use Win32::API;
my $messagebox = Win32::API::More->new (
"user32.dll",
"int MessageBoxW (HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType)"
) or die ("failed new");
my $r = $messagebox->Call (
0, # NULL
encode ("UTF-16LE", "☃テキスト☃"),
encode ("UTF-16LE", "🍣キャプション🍣"),
0 # MB_OK
);
print "$r\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment