[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

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

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
future2003
Asked:
future2003
  • 2
1 Solution
 
AndyAinscowCommented:
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
 
AndyAinscowCommented:
My comment would be a way to achieve the desired effect
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now