Massimo
If there's something you're not telling us about why you're finding this
difficult, you need to clarify. The call itself is dead simple...
Paul T.
"Mhaxx" <super...@despammed.com> wrote in message
news:OWQqsS4C...@TK2MSFTNGP03.phx.gbl...
That's what I do:
RegisterHotKey(hWnd, VK_F6, MOD_KEYUP, VK_F6);
...
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
if (msg.message == WM_HOTKEY)
{
if (msg.wParam == VK_F6)
{
...
}
}
}
}
But I get 6 times VK_F6 after 1 time I pressed that button: why?
Massimo
Just a quick thought - is your message handling function is returning
TRUE to indicate the message is being handled?
best regards,
Rik A
Do you refer to RegisterHotKey or GetMessage?
Massimo
Do you refer to RegisterHotKey or GetMessage?
Massimo
I was referring to your windows callback function - although I can see
from your code example that you may not have one in this case.
What I was getting at is that some message require a return value to
indicate if they have been handled or not - e.g. WM_KEYDOWN:
http://msdn.microsoft.com/en-us/library/aa921842.asp
On closer inspection, though, WM_HOTKEY does not have this
requirement.
regards,
Rik
You read the help on the RegisterHotKey() function? You see that passing
MOD_KEYUP will send you a message on both key down and key up events. If
the key is held down for any length of time, of course, you'll get key
repeat, just like on any other key. I'd bet that a little bit of thinking
about it would tell you why you're seeing the message six times...You also
have Remote Spy that will show you the messages that are sent.
Paul T.
"Mhaxx" <super...@despammed.com> wrote in message
news:%23oGg$SDDKH...@TK2MSFTNGP04.phx.gbl...