Page 1 of 1

How to copy text from a message box

Posted: Fri Dec 07, 2007 5:42 am
by Mistrel
Just press Ctrl-C. I never knew that!

http://weblogs.asp.net/chuckop/archive/ ... 10153.aspx

Posted: Fri Dec 07, 2007 5:56 am
by netmaestro
Also, if you know the hwnd of the messagebox, as you will if you hooked it, you can do:

Code: Select all

messagetext.s = Space(512)
GetDlgItemText_(hwnd, $FFFF, @messagetext, 512)

Posted: Fri Dec 07, 2007 6:12 am
by Mistrel
Do you read minds or was that just good detective work? I found this trick while hunting for a function to do just that!

Is there a way to get the string length? And how did you get the value of the nIDDlgItem parameter?

Thank you! :D