shameless sendmessage (?)

I have looked for examples in vb dealing with closing an app. window I have set as a child in a midi. I am doing this with sendmessage but the examples I have seen don't work

ex. :
RetVal = SendMessage(ChildhWnd, WM_CLOSE, WM_CLOSE, 0&)
RetVal = SendMessage(ChildhWnd, WM_SYSCOMMAND, SC_CLOSE, 0&)
TheQ111798Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kacklehornConnect With a Mentor Commented:
If you want to use APIs it is
retval = SendMessage(<Childformname>.hwnd,WM_CLOSE,0&,0&)

Make sure you have the constant WM_CLOSE defined in a module or something or just pass it a &h10:
retval = Sendmessage (<Childformname>.hwnd,&h10,0&,0&)
0
 
hddp666Commented:
Why not use these to open and close the form?

frmChild.Show

Close frmChild
0
 
TheQ111798Author Commented:
The child is actually an application I am running in the midiform (not a form in my projectZ), so I only have a handle on it.
0
All Courses

From novice to tech pro — start learning today.