I am sending messages to other windows using the PostMessage API. For example, I open calc and send it the Ctrl+V message (which is the hotkey for paste). That works OK. The problem comes when I want to send and Alt+something command. I don't know the constants for alt, and they are not in the KeyCodeConstants enum. Please help.

Here is what I have now:
VB Code:
  1. Private Sub Command2_Click()
  2.     Dim winhwnd As Long
  3.     winhwnd = FindWindow(vbNullString, "calculator")
  4.  
  5.     PostMessage winhwnd, WM_KEYDOWN, vbKeyControl, 0
  6.    
  7.     PostMessage winhwnd, WM_KEYDOWN, vbKeyV, 0
  8.     PostMessage winhwnd, WM_KEYUP, vbKeyV, 0
  9.    
  10.     PostMessage winhwnd, WM_KEYUP, vbKeyControl, 0
  11.  
  12. End Sub