I am trying to learn SendMessage command. Suppose I want to retrieve any selected text in notepad. for example, please look at this screen shot-
In the above image you can see that i have selected a text- "New Notepad Title" written in notepad window, now i ran these codes-
Code: Select all
f1::
SendMessage, 0x301, , , Edit1, Untitled - Notepad
MsgBox % Errorlevel
return
In the above msgbox you can see a number 34 is shown, while it should show the text- "New Notepad Title".
As I am using 0x301 in the above codes, which is, according to documentation, is the hex value of copy (WM_COPY = 0x301), so it should copy the selected text and should show that text in msgbox. I don't understand why it is showing 34 in msgbox?
I know the text can be retrieved very easily by using ControlGetText command in the present scenario, but I want to use SendMessage command only for learning purpose.
Please help me..
Thanks a lot...