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
151 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Smart Camera scanning and reading information 3 86
sum67 challenge 35 89
java ^ examples 8 57
haveThree challenge 22 100
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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now