eric256 has asked for the wisdom of the Perl Monks concerning the following question:
Hey, I'm trying to use Win32::API to call the RegisterHotKey function. However that links a hotkey with a window, and once i've linked it to my Win32::GUI::Window I have no idea how to the trap the resulting WM_HOTKEY message that should eb sent.
use Win32::GUI; use Win32::API; my $mw_win32 = new Win32::GUI::DialogBox( -width => 0, -height => 0, -name => 'MainWindow'); my $proto = 'BOOL RegisterHotKey(HWND hWnd, int id, UINT fsModifiers, +UINT vk)'; Win32::API->Import('user32', $proto) or die "import RegisterHotKey: $! + ($^W)"; # Call: my $ret = RegisterHotKey ($mw_win32->{-handle}, 1, 11||12 , 41); if (not $ret) { die "RegisterHotKey: $! ($^E)"; }
So any help would be appreciated. also if i've wandered down the completely wrong path please let me know! I'm using Win32::GUI + Tk to handle a systray icon and I'm hoping to add some hotkeys!...Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Windows Hotkey
by ldln (Pilgrim) on Jul 10, 2006 at 22:52 UTC | |
|
Re: Windows Hotkey
by eric256 (Parson) on Jul 11, 2006 at 15:44 UTC | |
by Ace128 (Hermit) on Jul 12, 2006 at 05:17 UTC | |
by eric256 (Parson) on Jul 12, 2006 at 13:18 UTC | |
by Ace128 (Hermit) on Jul 12, 2006 at 18:19 UTC |