Well, it just bypass the calls to dispatch and translate message so it's like the key was never pressed for the application (WndProc don't get called).
I admit it's a bit ugly but it could easily be fixed by adding the code in a simple function.
bool IsF10KeydownMsg(MSG msg)
return (msg.message == WM_SYSKEYDOWN && msg.wParam == VK_F10);
Or whatever suit your need.
Maybe there is another way, but i don't know it. This work just fine imo.