1. 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.

@NitroNic, x-cubed and other winamp knowers

Discussion in 'Software Development' started by Matthias, Sep 10, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. Matthias

    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
     
  2. NitroNic

    NitroNic

    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.
     
  3. Matthias

    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?
     
  4. NitroNic

    NitroNic

    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.
     
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 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/272427

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice