View Single Post
Old 13th April 2016, 20:34   #9
Senior Member
r2du-soft's Avatar
Join Date: Nov 2013
Location: Iran
Posts: 343
Originally Posted by Anders View Post
You need to specify the parameter types in the call to GetWindowText. First look them up on MSDN and then find the matching type in the System plug-in readme...
i see msdn and see this codes:
HTML Code:
 Private Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Private Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Public Function GetParentFormCaption(ByVal lngHwnd As Long) As String

  Dim strBuff As String * 255

  Dim lngOldHwnd As Long, lngResult As Long


  lngOldHwnd = GetParent(lngHwnd)

  lngResult = GetWindowText(lngOldHwnd, strBuff, Len(strBuff))


  GetParentFormCaption = Trim(strBuff)

End Function

GetWindowText have 3 parameter and i use 3 parameter for that in convert
HTML Code:
GetWindowText(lngOldHwnd, strBuff, Len(strBuff))

but i don't know whay my code callback to me value 0!
HTML Code:
System::Call 'user32::GetWindowText($foreground_hwnd, $txt, StrLen $length2 $txt)i .r3'
r2du-soft is offline   Reply With Quote