Cool thanks for that info. Is there any funky way to find out the id's and correspoding commands for the API?
I've hit another snag, the WinAmp thing is working fine now. But I'm having some issues with the MSN Messenger API (can u guess what I'm trying to do?). Anyhow, theres a snippit of code that looks something like this:
hMsgrWnd = FindWindow("MSNHiddenWindowClass", vbNullString)
hThread = GetWindowThreadProcessId(hMsgrWnd, 0)
Call MSN.OptionsPages(0, MessengerAPI.__MIDL___MIDL_itf_msgrua_0000_0007.MOPT_GENERAL_PAGE)
Do
Call EnumThreadWindows(hThread, AddressOf EnumWindowsProc, 0)
Loop While hOptionsWnd = 0
Do
hTabWnd = FindWindowEx(hOptionsWnd, 0, "#32770", vbNullString)
Loop While hTabWnd = 0
hEditWnd = FindWindowEx(hTabWnd, 0, "edit", vbNullString)
hButtonWnd = FindWindowEx(hOptionsWnd, 0, "button", vbNullString)
Call SendMessageByString(hEditWnd, WM_SETTEXT, 0, Value)
Call SendMessageInteger(hButtonWnd, WM_KEYDOWN, VK_SPACE, 0)
Call SendMessageInteger(hButtonWnd, WM_KEYUP, VK_SPACE, 0)
with
Public Function EnumWindowsProc(ByVal hwnd As Integer, ByVal lParam As Integer) As Boolean
Dim sWndClass As String
Dim lRet As Integer
sWndClass = Space(255)
lRet = GetClassName(hwnd, sWndClass, 255)
sWndClass = Left(sWndClass, lRet)
If sWndClass = "#32770" Then
hOptionsWnd = hwnd
Else
EnumWindowsProc = True
End If
End Function
and the other stuff that I think is like standard win32 commands. (I didn't write any of this) but what ends up happening is it works the first 2 or 3 times I run it, but after that it gets caught in that second Do... While loop forever. Oh the code is basically supposed to open a properties page, change a value, and close it. Sorry for the longness of the code. Also if its not too much trouble could I get a brief explanation of the code? I have a vague idea of whats happening but if someone could really explain it I would really appreciate it. Thanks Again. :)
Oh, also. This is really strange. I've put in like a counter thing so the loop terminates after like 20 times if its not ending (into the loop that is sometimes infinite) anyhow, this is really strange. When I put a MsgBox inside that loop that shows the value it works even after the first few runs. . .sometimes. I have no explination, I can run it like 15 times and nothing will happen than I'll put a message box in and it'll work 75% of the time. I'm not used to such randomness arghhhh. :mad: