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;
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.