How would you simulate the pressing of the Alt key to a program?

Code:
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Public Const VK_MENU = &H12
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101

SendMessageLong lhWnd, WM_KEYDOWN, VK_MENU, 0
SendMessageLong lhWnd, WM_KEYUP, VK_MENU, 0
That's the code i have right now, but it doesn't seem to select the menu