use strict; use warnings; use Win32::API; Win32::API::Struct->typedef('POINT', qw( LONG x; LONG y; )); my $Point = Win32::API::Struct->new('POINT'); print "sizeof('POINT') = " . $Point->sizeof() . "\n"; Win32::API::Struct->typedef('CURSORINFO', qw( DWORD cbSize; DWORD flags; HANDLE hCursor; POINT ptScreenPos; )); my $CursorInfo = Win32::API::Struct->new('CURSORINFO'); print "sizeof('CURSORINFO') = " . $CursorInfo->sizeof() . "\n"; Win32::API::Struct->typedef('MYSTRUCT', qw( DWORD cbSize; DWORD flags; HANDLE hCursor; )); my $Struct = Win32::API::Struct->new('MYSTRUCT'); print "sizeof('MYSTRUCT') = " . $Struct->sizeof() . "\n"; __DATA__ sizeof('POINT') = 8 sizeof('CURSORINFO') = 16 sizeof('MYSTRUCT') = 12