API SendMessage Help
Posted on 2002-06-04
I'm trying to learn about sendmessage. I see this in all my books and all over the web but nowhere is it explained..
HWND hWnd, // handle to destination window
UINT Msg, // message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
From mIRC's help file
SendMessage(mHwnd, WM_MCOMMAND, cMethod, 0L)
mHwnd - the handle of the main mIRC window, or the handle of a Channel, Query, etc. window.
WM_MCOMMAND - which should be defined as WM_USER + 200
cMethod - the way in which you want mIRC to process the message, where:
1 = As if typed in editbox
2 = As if typed in editbox, send as plain text
4 = Use flood protection if turned on, can be or'd with 1 or 2
Returns - 1 if success, 0 if fail
1. I have no problem with the handle, My target app (mIRC) is ready to receive a message and I have it's handle.
2. WM_MCOMMAND = UINT Msg....
I want to send a string here, I assume it must be a pointer but "which should be defined as WM_USER+200"
is killing me. What does that mean?
3. No help needed
4. "0L", do you suppose this is just expecting a 0 as if it were not used?
Also, does my app have to be a COM Object to use Sendmessage?
Example source would help but my primary need is an explanation of the second parameter.
Thanks in advance.