Here's the error that is spit out.#!/usr/bin/perl -w use strict; use diagnostics; use Win32::API; my ($hook, $hooker, $idHOOK, $lpfn, $hmod, $dwThreadId); $idHOOK = 'WH_KEYBOARD_LL'; $lpfn = " " x 80; $hmod = 0; $dwThreadId = 0; $hook = new Win32::API('user32', 'SetWindowsHookEx', 'LLLL', 'L'); if(not defined $hook) { die "Can't import API SetWindowsHookEx: $!\n" } $hooker = $hook->Call($idHOOK, $lpfn, $hmod, $dwThreadId); #print $hooker;
I'm not sure of what file th error is talking about i've used both user32 and the win32 module in programs before. Please shed some light on this for me.. thanks. Link to MSDN SetWindowsHookEx http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindowshookex.aspD:\project>keyhook.pl Can't locate object method "API=HASH(0x15d4ebc)" via package "Win32" a +t D:\project\keyhook.pl line 16, <DATA> line 164 (#1) (F) You said to do (or require, or use) a file that couldn't be found. Perl looks for the file in all the locations mentioned in @ +INC, unless the file name included the full path to the file. Perhaps +you need to set the PERL5LIB or PERL5OPT environment variable to say w +here the extra library is, or maybe the script needs to add the library + name to @INC. Or maybe you just misspelled the name of the file. See perlfunc/require and lib. Uncaught exception from user code: Can't locate object method "API=HASH(0x15d4ebc)" via package " +Win32" at D:\project\keyhook.pl line 16, <DATA> line 164.
In reply to Win32 Keyboard hook in perl by xdeletex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |