sendmessage help
-
can any body tell how to click a button using sedmessage method? i did not know the last three parameters execpt HWND plz explain last three parameters ? r00d0034@yahoo.com
-
can any body tell how to click a button using sedmessage method? i did not know the last three parameters execpt HWND plz explain last three parameters ? r00d0034@yahoo.com
To reiterate a reply I made here: The SendMessage function sends a message to the window procedure of a window. It doesn't return until the window fully processes the message. You should never send messages to windows of other applications because it is possible that the application may be hung and SendMessage will never return. This is the prototype of SendMessage.
LRESULT SendMessage(
HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);The hwnd parameter, as you know, is the handle to a window to which to send a message. The Msg parameter identifies what type of message to send, and the wParam and lParam parameters specify additional information about the message. The system and applications communicate to windows via messages. Besides SendMessage, there is the PostMessage function, which sends a message to a window and returns immediately, making it ideal for communicating with windows in other applications. To answer the second question, to programmatically simulate a button click, make the following call:
SendMessage(hwndBtn,BM_CLICK,0,0);
Peter O.