注册 登录
编程论坛 Perl论坛

获取屏幕鼠标位置小程序

zhu224039 发布于 2014-07-20 13:31, 5576 次点击
#! /usr/bin/perl
#use strict;
use Win32::API;
 Win32::API::Struct->typedef( LPPOINT => qw{
        LONG x;
        LONG y;
    });

Win32::API->Import('user32', 'BOOL GetCursorPos(LPPOINT lpPoint)');
my $pt = Win32::API::Struct->new('LPPOINT');
while(1){
$pt->{x}=0;
$pt->{y}=0;
GetCursorPos($pt);
print "$pt->{x},$pt->{y} \n";
sleep(1);
};
1 回复
1