can someone plz tell me why i get a type mismatch error in this piece of my code..
VB Code:
  1. Private Sub Command1_Click()
  2. 'Get the room's handle
  3. tWnd = FindWindow(Text2, vbNullString)
  4. 'Get the room textboxe handle
  5. bWnd = FindWindowEx(tWnd, ByVal 0&, "Edit", vbNullString)
  6. SendMessage bWnd, WM_SETTEXT, ByVal "<pbr>P<pbr>a<pbr>l<pbr>t<pbr>a<pbr>l<pbr>k:" & Text1, 0
  7. keybd_event VK_RETURN, 0, 0, 0   ' press enter
  8. keybd_event VK_RETURN, 0, KEYEVENTF_KEYUP, 0   ' release enter
  9. End Sub
it highlights the last "0" in the SendMessege and also highlights "Private Sub Command1_Click"