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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 92
viewing source code from eclipse 13 108
Window placement 17 83
zeroFront challenge 7 99
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 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