# Use this to monitor the shape of mouse cursor use strict; use warnings; 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} = 20; #$pci->sizeof(); # ? sizeof doesn't work for nest +ed struct ? Win32::API->Import("user32", "BOOL GetCursorInfo(PCURSORINFO pci)"); while (1) { my $result = GetCursorInfo($pci) or die $^E; print "Current mouse shape is $pci->{hCursor}\n"; $pci->{cbSize} = 20; sleep 1; }
With thanks to dfaure for helping find that bug with Win32::API::Struct.
In reply to Re: Need to determine state of mousepointer
by EdwardG
in thread Need to determine state of mousepointer
by kevin_ketchum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |