That looks like it should do something, both when you press ALT+f1, and when you release it.
Are you sure that the window you're using has the keyboard focus? In some programs, it can be tricky to know which has focus, in cases where your main window is a frame window, and the window you are interacting with is its client window. In this case, the client window will get the messages.
I'm attaching some of my own code, this DOES work. I hope it helps.
// other nonrelevant stuff removed for clarity
if (wParam == 'F') s.showFPS = !s.showFPS;
// Handle any non-alt combo key commands
PlaySound("audio\\hailduke.aud", 0, SND_ASYNC | SND_NODEFAULT| SND_FILENAME);
absolutelyUpdate = true;
spaceIsDown = true;
//handle key release commands
spaceIsDown = false;
absolutelyUpdate = false;