The following will remove the sound without affecting system shortcut behavior:
case WM_SYSCOMMAND:
if (wParam == SC_KEYMENU) return 0; //Prevents a system sound from playing when alt key combinations are pressed
else return DefWindowProc(hWnd, message, wParam, lParam);