Solved

shameless sendmessage (?)

Posted on 1998-11-24
3
256 Views
Last Modified: 2010-05-03
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
Comment
Question by:TheQ111798
3 Comments
 
LVL 1

Expert Comment

by:hddp666
ID: 1446609
Why not use these to open and close the form?

frmChild.Show

Close frmChild
0
 

Author Comment

by:TheQ111798
ID: 1446610
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
 
LVL 1

Accepted Solution

by:
kacklehorn earned 30 total points
ID: 1446611
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question