There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers dvd error excel external hard drive firefox format freezes freezing hard drive hardware hijackthis internet internet explorer ipod itunes laptop malware mouse network networking outlook 2007 power printer problem ram router screen slow sound trojan upgrade usb virus vista vista 32-bit windows windows xp winxp wireless
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
@NitroNic, x-cubed and other winamp knowers


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
Matthias's Avatar
Junior Member with 2 posts.
 
Join Date: Sep 2004
Experience: Intermediate
10-Sep-2004, 02:03 PM #1
@NitroNic, x-cubed and other winamp knowers
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
NitroNic's Avatar
Senior Member with 103 posts.
 
Join Date: Oct 2003
25-Sep-2004, 01:09 AM #2
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's Avatar
Junior Member with 2 posts.
 
Join Date: Sep 2004
Experience: Intermediate
26-Sep-2004, 09:51 AM #3
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?
NitroNic's Avatar
Senior Member with 103 posts.
 
Join Date: Oct 2003
26-Sep-2004, 07:28 PM #4
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.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:06 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.