Solved

How to terminate all windows when a command button is pressed and auto load a file (in HMM SDI) when start running a program?

Posted on 2003-12-09
5
155 Views
Last Modified: 2013-11-20
Hihi, I need to terminate all windows ( included SDI window and several dialog windows) when a command button is pressed.What is the function need to add?

Another problem is that how to auto load a file (load OpenCV.txt in HMM SDI window) when start running a program? Please give some hints?

Thanks. Hope can reply asap.

future2003
0
Comment
Question by:future2003
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 80 total points
ID: 9910281
If they are children of your app (and you want your app to close) then just close your app, else send each a WM_CLOSE message
PostMessage(hWnd, WM_CLOSE, 0, 0L);

To do something when your app starts use the OnInitInstance function of your app.

(load OpenCV.txt in HMM SDI window)
You can use the CreateProcess function (or possibly ShellExecute) to start HMM running and use the path of OpenCV.txt as a command line parameter so that it will be opened by HMM.
If it gives problems create a desktop shortcut to HMM and see what it accepts as command line params for opening a file and use these in the CreateProcess call
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 11850715
My comment would be a way to achieve the desired effect
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WinWaitActive parameters 12 31
maxBlock challenge 30 146
withoutTen challenge 14 137
c++  placing data into a form and an editbox 5 25
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

726 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