benlaw has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'd like to write a Win32 program which can simulate key press, such as <Printscreen>, <insert>, <F1>, <Shift>+<4>, I want to print a screen shot then save as file.

Thanks a lot

p.s. seems I need 'cl' when install Image::Magick module http://search.cpan.org/~jcristy/PerlMagick-6.24/Magick.pm

I search solution b4, it seems i need to install Visual C++, it there any method rather than install Viusal C++? Thanks a lot

  • Comment on Simulate Key stroke, such as <Printscreen>

Replies are listed 'Best First'.
Re: Simulate Key stroke, such as <Printscreen>
by Albannach (Monsignor) on Nov 28, 2005 at 04:28 UTC
    For simulating keypresses, try win32::guitest

    Update: Certainly bart is correct, but strangely enough CPAN will still find Win32::GuiTest. My apologies to anyone troubled by the incorrect capitalization in my response above.

    --
    I'd like to be able to assign to an luser

      Even on Windows, case matters. It's Win32::GuiTest, not "win32::guitest".
Re: Simulate Key stroke, such as <Printscreen>
by GrandFather (Saint) on Nov 28, 2005 at 04:20 UTC

    WRT ImageMagick. Install it useing the Windows download from http://www.imagemagick.org/script/binary-releases.php. Look for the Windows binary releases toward the bottom of the page. During the install let the installer know that you want the Perl API set up for you.


    DWIM is Perl's answer to Gödel
Re: Simulate Key stroke, such as <Printscreen>
by jmcnamara (Monsignor) on Nov 28, 2005 at 08:53 UTC
Re: Simulate Key stroke, such as <Printscreen>
by gube (Parson) on Nov 28, 2005 at 05:17 UTC
Re: Simulate Key stroke, such as <Printscreen>
by zentara (Cardinal) on Nov 28, 2005 at 13:13 UTC
Re: Simulate Key stroke, such as <Printscreen>
by benlaw (Scribe) on Nov 28, 2005 at 14:05 UTC
    That's great , I try to install Win32::Screenshot but encounterred 'cl' missing problem~, that's great i solve the problem thanks all