You don't get a WM_KEYUP message for the 1. With the Alt key, the entered characters are used in a different way.
Instead of a WM_KEYUP, you receive the WM_SYSKEYUP. The WM_KEYUP you receive should have the nVirtKey code of VK_MENU.
This is are the messages captured by Spy++ when I press ALT+1 in Notepad.
WM_SYSKEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:0 fAltDown:1 fRepeat:0 fUp:0
WM_SYSKEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:0 fAltDown:1 fRepeat:1 fUp:0
WM_SYSKEYDOWN nVirtKey:'1' cRepeat:1 ScanCode:02 fExtended:0 fAltDown:1 fRepeat:0 fUp:0
WM_SYSCHAR chCharCode:'49' (49) cRepeat:1 ScanCode:02 fExtended:0 fAltDown:1 fRepeat:0 fUp:0
WM_SYSKEYUP nVirtKey:'1' cRepeat:1 ScanCode:02 fExtended:0 fAltDown:1 fRepeat:1 fUp:1
WM_KEYUP nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
WM_SYSKEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:0 fAltDown:1 fRepeat:0 fUp:0