|
-
Mar 24th, 2002, 10:58 AM
#1
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)
-
Mar 24th, 2002, 11:49 PM
#2
Addicted Member
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...
-
Mar 25th, 2002, 03:26 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|