Results 1 to 3 of 3

Thread: Sending key to window without focus

  1. #1
    chenko
    Guest

    Sending key to window without focus

    I want to send a key to my winamp window without giving it focus, I can get the hWnd of the window, and send a key, but it does nothing ?

    this is the code....

    Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long


    Dim retVal
    retVal = SendMessage(GetWinampHWnd(), WM_CHAR, Asc("b"), 0)


    GetWinampHWnd() - returns the hWnd of winamp

    retVal returns 0 but winamp doesnt go to the next track (keypress B)


  2. #2
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    Most likely if the function returns a 0 then there was an error, the return value of SendMessage is the return value of the Message you sent, if that makes any sense...
    To protect time is to protect everything...

  3. #3
    chenko
    Guest
    0 means the window has processed the message (thus no errors sending)

    yes, it makes sense, thou there isnt a return value I am looking for.
    I finally got it "working" but on everyone elses machine cept mine

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width