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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendMessage from EnumChildWindowProc is not responding.

Status
Not open for further replies.

mbu

Technical User
Apr 10, 2004
13
US
Hello O'Great Ones,
I have problem with SendMessage() from inside the EnumChildWindowsProc.

*From my Form1 Code I called (I have hParent handle already)

Call EnumChildWindows(hParent, AddressOf EnumChildProc, &H0)

And in my EnumChildProc (in the module) I have
lResult = SendMessage(hChild, WM_SETTEXT, ByVal 0&, ByVal SentText)
MsgBox hChild
MsgBox lResult


But that lResult always return 0 (zero) though the hChild is a valid handle that I want.
Where am I doing it wrong? H-e-l-p.
 

You need a handle to the ChildWindow and not the childprocess if I remember correctly.

Good Luck

 
The SendMessage() command line is place after the hChild (the handle of child window which happens to be a textbox)is determined.

Something is very strange. This is the first time I am programing in API and I can't see why a callback function cannot respond a SendMessage().
 
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long


In the module where the "EnumChildProc" is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top