[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

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&)
0
TheQ111798
Asked:
TheQ111798
1 Solution
 
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
 
kacklehornCommented:
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now