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
156 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 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