Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameters for SendMessage??

Status
Not open for further replies.

Paladyr

Programmer
Apr 22, 2001
508
US
I'm trying to do this:

Code:
Dim test As Long
lngR = FindWin(vbNullString, "caption at top of internet explorer")
  test = SendMessage(lngR, WM_LBUTTONDOWN, 0, -1)
  DoEvents
  Text = SendMessage(lngR, WM_LBUTTONUP, 0, -1)
  DoEvents
  Sleep (1500)
  test = SendMessage(lngR, WM_LBUTTONDOWN, 0, -1)
  DoEvents
  Text = SendMessage(lngR, WM_LBUTTONUP, 0, -1)
End Sub

Private Function FindWin(WinTitle As String) As Long

Dim lhWnd As Long, sAns As String
Dim sTitle As String

lhWnd = Me.hWnd
sTitle = LCase(WinTitle)

Do

   DoEvents
      If lhWnd = 0 Then Exit Do
        sAns = LCase$(GetCaption(lhWnd))
             

       If InStr(sAns, sTitle) Then

          FindWin = lhWnd
          Exit Do
       Else
         FindWin = 0
       End If

       lhWnd = GetNextWindow(lhWnd, 2)

Loop

End Function

And it isn't sending the mouse clicks to internet explorer. What am I doing wrong? I even tried sending a WM_CLOSE message. Do I need to define these messages????

 
Also I just threw the 0, -1 in at the end, I have no idea what that does. There doesn't seem to be a whole lot of documentation explaining this stuff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top