@NitroNic, x-cubed and other winamp knowers

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Matthias

Thread Starter
Joined
Sep 10, 2004
Messages
2
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
 
Joined
Oct 19, 2003
Messages
103
Ack, sorry I didn't see this, I don't visit these forums that often. IF there were more hours in the day I would.

Anyway, read this thread, if you haven't already:

http://forums.techguy.org/t259643

Basically, x-cubed figured out that in the sendmessage call, the thing was sending a pointer (address), instead of the value of the constant. (Why it's possible to pass a constant by ref? I don't know!) Anyway, I put a byval in front of my constant... worked fine.

I'm not a dot netter, though, so I'm not sure what difference that could/would/should make.

And for future reference... if you want my attention, send a PM, I'm set to receive email notification, so it will be less than a day before I realize someone's trying to talk to me.

And good luck with your project.
 

Matthias

Thread Starter
Joined
Sep 10, 2004
Messages
2
pm doesn't work, maybe my firewall
i know the thread you are referring to, i have already tried this, but the vb.net compiler doesn't accept "ByVal" or "ByRef" in function calls. do you think that the problem in my case is the same? what about the strange numbers i get as window handles?
 
Joined
Oct 19, 2003
Messages
103
Not sure about the strange handle numbers... mine are more like six digits long.

Does vb.net have some other operator for byval/byref? Maybe some symbol?

And where are your api call declarations? I put mine in a separate module file, I called it Module1.bas but you can call yours whatever you want. We need for someone else to chime in here, someone who uses vb.net.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top