Tech Support > Microsoft Windows > Development Resources > RegisterHotKey failing with any attempt
RegisterHotKey failing with any attempt
Posted by Vis Mike on June 26th, 2003


RegisterHotKey( hwnd, 1, MOD_WIN, VK_F2 );

I've verified hwnd, tried GlobalAddAtom, tried different keys and modifiers,
but no matter what I try it fails.
FormatMessage( ... GetLastError() ... ) tells me: "The handle is invalid".

It's a valid handle, I don't know what to do. Do you have to use
RegisterHotKey in WM_CREATE or some special requirement?

BTW, is FormatMessage the usual call to get usable error information? That
is the most convoluted function I've ever seen. Is there a
GetLastErrorStr()??

Thanks much,
Mike






Similar Posts