Hi all!
I want to receive the time and if the mediaplayer is paused using api.
My problem is that the child is called Static but there’s 3 items there and it seems that I just get the first of them.
Any one please?
Heres my code so far:
Code:Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As IntPtr, ByVal hWnd2 As IntPtr, ByVal lpsz1 As String, ByVal lpsz2 As String) As IntPtr
Private Declare Function SendMessageString Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As IntPtr
Private Const WM_GETTEXT As Integer = &HD
Dim parent As IntPtr
Dim child1 As IntPtr
Dim child2 As IntPtr
Dim s As String = Nothing
parent = FindWindow("MediaPlayerClassicW", Nothing) 'get window handle
child1 = FindWindowEx(parent, IntPtr.Zero, "#32770", Nothing)
child2 = FindWindowEx(child1, IntPtr.Zero, "Static", Nothing)
SendMessageString(child2, WM_GETTEXT, 50, s)
MsgBox(s)
