Solved

Input from/to other program

Posted on 2004-04-27
5
107 Views
Last Modified: 2010-05-02
Hi Experts,

I need to create some interaction between two programs:
Program-A that is started by the user
Program-B that is started by an event of program-A

Every character that is typed in a textbox in Program-B has to be send to Program-A.
If the user clicks on the form of Program-A program-B has to be hide or unload.
Till now it was easy and good working, now I have to build some more programs,

So there will be several Programs-A that will use program-B
How to figureout to what Program-A the information has to be send,
and what program-A should hide Program-B




0
Comment
Question by:theo kouwenhoven
5 Comments
 
LVL 11

Expert Comment

by:bingie
Comment Utility
Check out this tutorial for info on sending to other applications.

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=42126&lngWId=1
0
 
LVL 16

Author Comment

by:theo kouwenhoven
Comment Utility
Hi Bingie,

Thanks for the quick response, The example solves my problem almost!!!

the sample from the link is using Notepad and that is the problem, I don't know what application has started my
program, so I need the name of the previous active application or give the name of that aplication with a parameter to
the program while starting it but How ???

Private Sub Command1_Click()

Dim lNotepadHwnd As Long
Dim lNotepadEdit As Long
Dim sCaption As String
   
    lNotepadHwnd = FindWindow("Notepad", vbNullString)
    lNotepadEdit = FindWindowEx(lNotepadHwnd, 0&, "Edit", vbNullString)

    sCaption = InputBox("What do you want to say?")
   
    SendMessageSTRING lNotepadEdit, WM_SETTEXT, 256, sCaption

End Sub
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
Comment Utility
Closed, 100 points refunded.
Netminder
Site Admin
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

10 Experts available now in Live!

Get 1:1 Help Now