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)"; }