i am controling winamp from a vb.net application and i have problems using SendMessage: everything seems to work except I don't get results either for WM_USER nor WM_COMMAND stuff.
It seems strange to me that the hwnd is always between something like 364673202778132480 and 372391402778132480 ...
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
'function ...
Dim hwndWinamp As Long = FindWindow("waam1.2.1", vbNullString)
'having called winamp with the parameter /CLASS="waam1.2.1"
'otherwise FindWindow("winamp v1.x", vbNullString) ?
SendMessage(hwndWinamp, 273, 40029, 0) 'should pop up some window
SendMessage(hwndWinamp, 1024, 128, 122) 'should set volume to 50%
'...
'nothing works!
'
'end function
'
'btw. WM_USER=1024=h400, WM_COMMAND=273=h111
It seems strange to me that the hwnd is always between something like 364673202778132480 and 372391402778132480 ...
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
'function ...
Dim hwndWinamp As Long = FindWindow("waam1.2.1", vbNullString)
'having called winamp with the parameter /CLASS="waam1.2.1"
'otherwise FindWindow("winamp v1.x", vbNullString) ?
SendMessage(hwndWinamp, 273, 40029, 0) 'should pop up some window
SendMessage(hwndWinamp, 1024, 128, 122) 'should set volume to 50%
'...
'nothing works!
'
'end function
'
'btw. WM_USER=1024=h400, WM_COMMAND=273=h111