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.
In reply to Windows Hotkey by eric256
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |