Since I'm such a nice guy, I figure I'll help all you people out if you were having StartVideo problems (with this and Messenger 6). No, it still doesn't work, but it doesn't have to. We will be sending a WM_COMMAND message to the IM window, making it think we pressed "Alt+w".
IM windows are made of two parts: The outer window, and a inner object which holds of the entire IM window's contents, not including the menu. You cannot try and send keypresses to the Video button because, guess what, the button doesn't exist! Its simulated.
Even though the the webcam button and menu (note the underscore under w when you hold down Alt) is in the inner object, and not visibly present in the outer window, pressing Alt+W to send a webcam invite is an outer IM window thing. This means getting the handle to that window is enough.
code:
Set imWindow = IMessengerObject.StartVideo(sContact) 'imWindow.HWND is a long containing the hWnd of the new window
After some careful Spy++ing, I can see that the lParam for WM_COMMAND we need to use is 9D57, or 0x9D57, or &H9D57, depending on the language and notation of choice. All we need to do is send this to the IM window using the SendMessage API call. In VB6, it looks like this:
code:
SendMessage imWindow.hwnd, WM_COMMAND, &H9D57, 0
Its so painfully simple, isn't it? Of course, I'm still pretty pissed that IMessenger2.StartVideo doesn't work. Oh well. I should have known.
Edit: In case you didn't notice, this was suggested above, but I initially overlooked the proper value to send to the window, and belive I should be sending things to the inner window.