Solved

Input from/to other program

Posted on 2004-04-27
5
111 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
ID: 10932489
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
ID: 10934068
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
ID: 11297167
Closed, 100 points refunded.
Netminder
Site Admin
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 82
Copy a row 12 64
Formula problem with Excel attachment 6 39
adding "ungroup sheets" to existing vbs code 5 31
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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

839 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