Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get the text/data from a PowerBuilder datawindow

Status
Not open for further replies.

JamesDSM50328

Technical User
Mar 25, 2005
33
US
Trying to get the text from a PowerBuilder datawindow. I have identified the window which the data resides but am running into difficulties getting the text of the data out.

tried the Sendmessage WM_GETTEXT
Code:
dim lresultDW as long 'handle for the datawindow
Dim sOutput as string
Dim lngLen&
Dim szBuffer$
lresultdw = FindWindowEx(hwndParent, &O0, "pbdw120", vbNullString)
lnglen = SendMessage(lresultdw, MsgDef.WM_GETTEXTLENGTH, 0&, 0&
szBuffer=space$(lnglen)+1
sOutput=szbuffer

tried the GetWindowText
Code:
Function GetTextofWindow(hwnd As Long) As String
Dim textlen As Long
Dim titlebar As String
Dim slength As Long

textlen = GetWindowTextLength(hwnd)
titlebar = Space(textlen + 1)
slength = GetWindowText(hwnd, titlebar, textlen + 1)

titlebar = Left(titlebar, slength)
GetTextofWindow = titlebar
End Function

they all end up returning 0

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top