Without seeing what ApiLink is, and where it comes from, it's hard to tell whether your code is correct. Where do you see problems?

I use and recommend Win32::API for interfacing with the Windows API. Avoid the "prototype" variant of the API and use the "parameter list" variant, as the C parser for the "prototype" variant has given me too much grief.

You seem to have taken some VB code and pasted it all in between calls to ApiLink() - I don't understand what this is. The Win32::API documentation does not mention ApiLink() or any way to run VB code.

For screen grabbing, take a look at Win32::GuiTest and Win32::GuiRobot. Interfacing with the Windows API also isn't hard, but the code you show only declares one Windows API function to call, keybd_event. I would try the following to call it:

use Win32::API; my $_keybd_event = Win32::API->new( 'user32.dll', 'keybd_event', 'IIII', 'I', ); sub keybd_event { my ($vk,$scan,$flags,$extra_info) = @_; $_keybd_event->Call($vk,$scan,$flags,$extra_info); };

In reply to Re: Multiple API calls by Corion
in thread Multiple API calls by thenetfreaker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.