View Poll Results: Do you know answer for my problem
- Voters
- 1. You may not vote on this poll
-
Jul 20th, 2004, 06:56 PM
#1
Thread Starter
New Member
How to SendMessage to MDI Child Form
Do you know how to find hwnd of control in MDI child form by using API calls and
How sendmessage or postmessage or sendkeys to that control in child window.
I tried it but, I couldn't do it.
[COLOR=red]
-
Jul 20th, 2004, 07:12 PM
#2
Frenzied Member
I see you haven't posted much. So Welcome to VBForums
Try placing this in the API forum though....and if you search there you should find an answer if not i'll post an example.
ice
:::`DISCLAIMER`:::
Do NOT take anything i have posted to be truthful in any way, shape or form.
Thank You!
--------------------------------
"Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe
"Finaly I can look as gay as I want..." - NoteMe
Languages: VB6, BASIC, Java, C#. C++
-
Jul 20th, 2004, 07:42 PM
#3
Fanatic Member
yes, i want to welcome u too.
you should play around the forum test area before officaly posting
and for your question, you should use the FindWindowEX:
VB Code:
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
'and i think you would want SendMessgeByString
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Last edited by ALL; Jul 20th, 2004 at 07:53 PM.
-
Jul 23rd, 2004, 09:36 AM
#4
Thread Starter
New Member
ThanX !
VB Code:
Function FindWindowLike(strPartOfCaption As String, Optional strChildwincap As String) As String
Dim hwnd As Long
Dim hWnd1 As Long
Dim strCurrentWindowText As String
Dim r As Long
hwnd = GetForegroundWindow
Do Until hwnd = 0
strCurrentWindowText = Space$(255)
r = GetWindowText(hwnd, strCurrentWindowText, 255)
strCurrentWindowText = Left$(strCurrentWindowText, r)
'hWnd = GetWindow(hWnd, GW_CHILD)
If InStr(1, LCase(strCurrentWindowText), LCase(strPartOfCaption)) <> 0 Then GoTo Found
hwnd = GetWindow(hwnd, GW_HWNDNEXT)
Loop
Exit Function
Found:
If strChildwincap = "" Then GoTo EN
hWnd1 = hwnd
Do Until hWnd1 = 0
hWnd1 = GetWindow(hWnd1, GW_CHILD)
strCurrentWindowText = Space$(255)
r = GetWindowText(hWnd1, strCurrentWindowText, 255)
strCurrentWindowText = Left$(strCurrentWindowText, r)
If InStr(1, LCase(strCurrentWindowText), LCase(strChildwincap)) <> 0 Then GoTo EN
Loop
EN:
FindWindowLike = hwnd & " Æ " & hWnd1
End Function
Then I Can Find MDI Child Window and I want to Send Key Strokes to the RICH TEXT BOX in that window
How can I Do that thing ?
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
|