http://qs1969.pair.com?node_id=181728


in reply to Win32::API

Guilderstern wrote:

There are two drawbacks to Win32::API that I've noticed so far. One could be easily remedied, while the other is probably not something I should hold my breath for...

hold your breath instead :-)
I'm working on a new release of Win32::API which will make your life a lot easier by supporting not only named types (eg. WORD, DWORD et al.) but structures too.

soon (I hope) you'll be able to say:

use Win32::API 0.40; Win32::API::Struct->typedef 'POINT', qw( LONG x LONG y ); Win32::API->Import( 'user32', 'BOOL GetCursorPos(LPPOINT lpPoint)' ); my $point = Win32::API::Struct->new('POINT'); my $retval = GetCursorPos($point); print "Cursor is at $point->{x}, $point->{y}\n";
...and callbacks will be there. I'm still cleaning things up, but I bet you'll be surprised :-)

oh, and BTW:

One example I'm thinking of is placing icons in the system tray. To be able to respond to mouse clicks, the function call that places the icon there must specify a callback that gets executed on a mouse click. AFAIK, there is no way to do this yet in Perl, and it may be impossible at the present.

well, there's Win32::GUI for this.

cheers,
Aldo

__END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;