Solved

Contolling one Windows application from another

Posted on 1998-09-17
7
172 Views
Last Modified: 2013-11-20
I have got two Windows applications. I want to startup the second application from the first application and supply data from the first application to the second application window dialogs as and when the second application dialogs come up on the screen. I do have all the information regarding both the applications. But I do not want to use IPC mechanisms, for the second application is general purpose one. It expects the user to provide data in dialog except when it is invoked by the first application.
Is there any way(s)? Currently I know a way using Windows SDK calls findwindow and SendMessage functions.
0
Comment
Question by:svrag
[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
7 Comments
 

Author Comment

by:svrag
ID: 1322198
I do not want any com/ole anwers as my applications are not com/ole applications. As I said I know a way already, and I want to know other, ways if any.
0
 
LVL 3

Expert Comment

by:Norbert
ID: 1322199
Even if you say you don't want COM/OLE answers I must say
COM/OLE is the best choice and because you use MFC I must say MFC supports enough to make the job easy.
BTW FindWindow may fail - as I know - if an other application uses the same window name
0
 

Expert Comment

by:JohnWeidner
ID: 1322200
The second app to start might also try to use GetFocus() to get the handle of the first app.

Other ideas might be to use DDE, or have both apps communicate by writing to a file on the hard drive, or store data in the registry.
0
Industry Leaders: 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!

 
LVL 2

Expert Comment

by:jrmcg
ID: 1322201
Depending on the type of data that you are trying to share, you may be able to share data back and forth with a simple DLL running.  I did something like this before I got into using sockets and it worked well.  But if you are looking for something quick and easy then John's idea is probably best.

J.R.
0
 

Expert Comment

by:umarama
ID: 1322202
I am just thinking aloud.

I used serialization to store an application's initialization information. (Configuration stuff). Now, in your case, if the two applications share some common data you might be using the same class objects. If yes, can serialization help you ?
0
 

Author Comment

by:svrag
ID: 1322203
It is nothing to do with serialization/COM/Ole stuff. It is plain simple, the second application is fully completed and it has got lot of dialogs in it. I want the first application to supply the data in the dialog controls as and when the dialogs appear/created. I can not make any change in the second application. More over I do not want to use the keyboard/user to enter values in the dialog boxes.
0
 
LVL 2

Accepted Solution

by:
wuxz earned 50 total points
ID: 1322204
Use a memory map file, and send custome messages between your
two applications to exchange information such as windows handle
and data.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 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