I'm using this code to try to hook to winamp so I can catch some messages but it doesn't seem to work (hHook is always equal to 0). I know that both my hWinamp and winampProcess are OK since I compared to the Spy++ and the Task Manager PID. What's wrong in it??
Thank you!
Code:
hWinamp = FindWindow("Winamp v1.x", vbNullString)
Me.Text3.Text = GetWindowThreadProcessId(hWinamp, winampProcess)
Me.Text1.Text = winampProcess
hHook = SetWindowsHookEx(WH_CALLWNDPROC, AddressOf wndProc, App.hInstance, winampProcess)
Me.Text1.Text = Me.Text1.Text & vbCrLf & hHook
Thank you!