use strict; use warnings; use Data::Dumper; use Win32::API; Win32::API::Struct->typedef( POINT => qw{ LONG x; LONG y; }); Win32::API::Struct->typedef( PCURSORINFO => qw{ DWORD cbSize; DWORD flags; HCURSOR hCursor; POINT ptScreenPos; }); my $pci = Win32::API::Struct->new('PCURSORINFO'); $pci->{cbSize} = $pci->sizeof(); Win32::API->Import("user32", "BOOL GetCursorInfo(PCURSORINFO pci)"); print Dumper($pci); # before, empty but for cbSize my $result = GetCursorInfo($pci) or die $^E; # DIES HERE, RESULTS BELOW print Dumper($pci); # after, hopefully full of useful information #### The parameter is incorrect at getmouseshape.pl line 27, line 164. #### $VAR1 = bless( { '__typedef__' => 'PCURSORINFO', 'ptScreenPos' => bless( { '__typedef__' => 'POINT', 'typedef' => [ [ 'x', 'l', 'LONG' ], [ 'y', 'l', 'LONG' ] ] }, 'Win32::API::Struct' ), 'cbSize' => 16, 'typedef' => [ [ 'cbSize', 'L', 'DWORD' ], [ 'flags', 'L', 'DWORD' ], [ 'hCursor', 'L', 'HCURSOR' ], [ 'ptScreenPos', '>', 'POINT' ] ] }, 'Win32::API::Struct' );