xdeletex has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 Keyboard hook in perl
by bart (Canon) on Sep 10, 2004 at 00:02 UTC | |
by xdeletex (Novice) on Sep 10, 2004 at 00:29 UTC | |
by Anonymous Monk on Sep 10, 2004 at 04:15 UTC | |
by Mr. Muskrat (Canon) on Sep 10, 2004 at 04:18 UTC | |
by bart (Canon) on Sep 10, 2004 at 10:00 UTC | |
| |
|
Re: Win32 Keyboard hook in perl
by simonm (Vicar) on Sep 10, 2004 at 00:02 UTC |