Results 1 to 40 of 49

Thread: [RESOLVED] How to pass an IP to VNC Viewer

Threaded View

  1. #31

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    70

    Re: How to pass an IP to VNC Viewer

    I managed to tweak the code and get it to work fine with the first part of my VNC issue.

    The following code passes the IP, and tells it to press the OK Button:

    Code:
    Private Sub Command1_Click()
    Dim lHnd As Long 'parent window handle
    Dim lhndChild As Long 'child window handle
    Dim lngresult As Long
    Dim btnHnd As Long 'added to hit the OK button as experiment.
    
    lHnd = FindWindow(vbNullString, "VNC Viewer : Connection Details")
    'this will return the 'VNC Viewer : Connection Details " windows Handle
    
    lhndChild = FindWindowEx(lHnd, 0&, "ComboBox", vbNullString)
    'this will return the combo box handle.
    
    lngresult = SendMessage(lhndChild, WM_SETTEXT, 0&, ByVal (txtIP.Text))
    'Sends whatever is in the txtIP textbox that I created on my form
    
    lHnd = FindWindow(vbNullString, "VNC Viewer : Connection Details")
        
        If lHnd <> 0 Then
            btnHnd = FindWindowEx(lHnd, 0, "Button", "OK")
             'makes it hit the OK button
    
            If btnHnd <> 0 Then
                    SendMessage btnHnd, BM_CLICK, 0, 0&
            End If
        End If
    End Sub
    Last edited by jwetzler; Aug 16th, 2007 at 06:59 PM.

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