Hello could someone help me get a window text, I currentlu have this script but I cant get the window text
quote:
var sTitle;
function OnEvent_MyMediaChange (new_media) {
playerHwnd = Interop.Call('User32','FindWindowW','Winamp v1.x',0);
Interop.Call('User32','GetWindowTextW', playerHwnd, sTitle);
Debug.Trace('Media Info is :'+ new_media + playerHwnd + stitle);
}
It is getting playerHwnd correctly but I dont know whats wrong with sTitle.
I have a similiar function in VB6 that is currently working its:
quote:
Public Function getWinampSong() As String
Dim lblWinamp As Object
'This function will get the song current ' ly playing on Winamp
If hWndWinAMP = 0 Then
'~~/\~~ return error code...
Exit Function
End If
Dim lRet As Integer
Dim sTitle As String * 256
If hWndWinAMP > 0 Then
lRet = GetWindowText(hWndWinAMP, sTitle, 256)
getWinampSong = Left(sTitle, InStr(1, sTitle, vbNullChar) - 10)
Else
getWinampSong = "Winamp Not Found"
End If
End Function
Hope someone can help me.
Thanks.