469,306 Members | 2,459 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

WM_GETTEXT

Hi all,

I'm trying to capture the text from a popup window (i.e. a MsgBox). The code
:

Const WM_GETTEXT = &HD
Const WM_GETTEXTLENGTH = &HE

Dim lHandle As Long
Dim length As Long
Dim result As Long
Dim strtmp As String

lHandle = FindWindow(vbNullString, "Some Popup")

If lHandle <> 0 Then

length = SendMessage(lHandle, WM_GETTEXTLENGTH, ByVal 0, ByVal 0) + 1

strtmp = Space(length - 1)
result = SendMessage(lHandle, WM_GETTEXT, ByVal length, ByVal strtmp)

End If

gives me the title of the popup window ('Some Popup') but not the msg on the
popup. How kan I get the message?
Jul 17 '05 #1
0 7073

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by BadOmen | last post: by
2 posts views Thread by Martin Müller | last post: by
reply views Thread by Thomas | last post: by
1 post views Thread by Kevin Dombroski | last post: by
4 posts views Thread by Seb Schöps | last post: by
6 posts views Thread by slg | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.