Results 1 to 6 of 6

Thread: findwindowEX Send Message in Child of a Child of an Application

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    3

    findwindowEX Send Message in Child of a Child of an Application

    findwindowEX Send Message in Child of a Child of an Application

    First:
    - my english is very bad (german)
    - i am a newby of Visual Basic

    My Form with SQL-Integration is sending Data per Button to Notepad sucessfull. Unfortunately, the purpose application has interlocking children.

    But the application don´t become the data. i need help to found a solution / or a Idear. i think i put in screenshots an my code:



    Code:
    Public Class Form1
    
        'Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Dim ListBox1 As ListBox.ObjectCollection
        ' Dim i As Long
        '    TextBox1.Text = ""
        '    With ListBox1.ToString()
        '        For i = 0 To .Count - 1
        '            TextBox1.Text = TextBox1.Text & .Item(i) & vbCrLf
        '        Next i
        '    End With
        'End Sub
    
        'Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Dim i As Long
        'TextBox1.Text = ""
        'For i = 0 To ListBox1.Items.Count - 1
        '   TextBox1.Text = TextBox1.Text & ListBox1.Items.ToString(i) & vbCrLf
        'Next i
        'End Sub
    
        'Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '    TextBox1.Text = ListBox1.Text.ToString
        'End Sub
        Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
        Private Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
        Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
        Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
        Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
    
        Private Const GW_HWNDNEXT = 2
        Private Const GW_CHILD = 5
        Private Const WM_SETTEXT = &HC
        Private Const WM_GETTEXT = &HC
        Private Const WM_KEYDOWN = &H100
        Private Const VK_RETURN = &HD
    
        'Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Any) As Integer
    
        Dim CobraMain As Integer
        Dim MClient As Integer
        Dim adl As Integer
        Dim AfxFrameOrView70 As Long
        Dim AfxWnd70 As Integer
        Dim F00040F22 As Integer
        Dim SysTabControl32 As Integer
        Dim F00580F76 As Integer
        Dim F00040EC0 As Integer
        Dim F00040EBC As Integer
        Dim F00040EBE As Integer
        Dim F00060F00 As Integer
        Dim F00060EE8 As Integer
        Dim AfxMDIFrame70 As Integer
        Dim F00030EAC As Integer
        Dim F00070ED0 As Integer
        Dim F000B0EF2 As Integer
        Dim F00040ECA As Integer
        Dim F00060F0C As Integer
        Dim Projekte As Integer
        Dim RichEdit20A As Integer
    
        'call them
    
    
    
        Private Sub ListBox1_onClick()
    
            'Wert der 1ten Spalte der selektierten Zeile in Textbox1 schreiben 
            TextBox1.Text = ListBox1.Text.ToString
    
            'Wert der 2ten Spalte der selektierten Zeile in Textbox2 schreiben 
            'WIE???? So übernimmte es bislang auch nur den selben wert wie in TextBox1 
            'Irgendwie muss man doch an die 2te Spalte ran kommen? 
    
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'TODO: Diese Codezeile lädt Daten in die Tabelle "_K_ProjekteDataSet.ADDRESSES". Sie können sie bei Bedarf verschieben oder entfernen.
            Me.ADDRESSESTableAdapter.Fill(Me._K_ProjekteDataSet.ADDRESSES)
    
        End Sub
    
        Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)
    
        End Sub
    
        Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
            TextBox1.Text = ListBox1.Text.ToString
        End Sub
    
        Private Sub BindingSource1_CurrentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
    
        End Sub
    
        Private Sub TEXT29_CurrentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TEXT29.CurrentChanged
    
        End Sub
    
        Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
            TextBox2.Text = ListBox2.Text.ToString + 1
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            CobraMain = FindWindow("COBRAMain", vbNullString)
            'MClient = FindWindowEx(CobraMain, 0&, "msctls_statusbar32", vbNullString)
            'CobraMain = FindWindow("COBRAMain", vbNullString)
            MClient = FindWindowEx(CobraMain, 0&, "MDIClient", vbNullString)
            adl = FindWindowEx(MClient, 0&, "AfxFrameOrView70", vbNullString)
            AfxFrameOrView70 = FindWindowEx(adl, 0&, "AfxFrameOrView70", vbNullString)
            AfxWnd70 = FindWindowEx(AfxFrameOrView70, 0&, "AfxWnd70", vbNullString)
            F00040F22 = FindWindowEx(AfxWnd70, 0&, "AfxFrameOrView70", vbNullString)
            SysTabControl32 = FindWindowEx(F00040F22, 0&, "SysTabControl32", vbNullString)
            F00580F76 = FindWindowEx(SysTabControl32, 0&, "AfxFrameOrView70", vbNullString)
            F00040EC0 = FindWindowEx(F00580F76, 0&, "AfxFrameOrView70", vbNullString)
            F00040EBC = FindWindowEx(F00040EC0, 0&, "AfxFrameOrView70", vbNullString)
            F00040EBE = FindWindowEx(F00040EBC, 0&, "AfxFrameOrView70", vbNullString)
            F00060F00 = FindWindowEx(F00040EBE, 0&, "AfxFrameOrView70", vbNullString)
            F00060EE8 = FindWindowEx(F00060F00, 0&, "AfxFrameOrView70", vbNullString)
            AfxMDIFrame70 = FindWindowEx(F00060EE8, 0&, "AfxMDIFrame70", vbNullString)
            F00030EAC = FindWindowEx(AfxMDIFrame70, 0&, "AfxFrameOrView70", vbNullString)
            F00070ED0 = FindWindowEx(F00030EAC, 0&, "AfxFrameOrView70", vbNullString)
            F000B0EF2 = FindWindowEx(F00070ED0, 0&, "AfxFrameOrView70", vbNullString)
            F00040ECA = FindWindowEx(F000B0EF2, 2&, "AfxFrameOrView70", vbNullString)
            F00060F0C = FindWindowEx(F00040ECA, 2&, "AfxFrameOrView70", vbNullString)
            Projekte = FindWindowEx(F00060F0C, 0&, "Button", vbNullString)
            RichEdit20A = FindWindowEx(MClient, 0&, "RichEdit20A", vbNullString)
    
            SendMessageByString(RichEdit20A, WM_SETTEXT, 0, TextBox2.Text)
            
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Close()
        End Sub
    End Class


    kind regards

    Holger
    Attached Images Attached Images  

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