Solved

Send keys Problem

Posted on 1998-11-18
5
149 Views
Last Modified: 2010-05-03
I am trying to send commands to another program. When sending to a normal form, everything works fine..When sending to the mdi form everything works fine....But when sending to a child in a mdi form nothing happens. How can I send Key commands to a mdi child form.
0
Comment
Question by:edmac
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:can9999
ID: 1445524
1. Use "FindWindowE" API
   -> You can find child window.
   -> If you succeed finding window, it return value not 0.


2. Use "SetWindowPos" API
   -> You can set child window topmost.

3. And then send keys to child window.

* Caution : API Text Viewer  ( in VB )
   -> Don't trust 100% !
   -> Some argument is wrong.
   -> ex) "Byval A as String" is wrong, "Byval A as Long" is right.
   -> If you can't get data though you followed right step,
       try changing declare like above.
 



0
 

Author Comment

by:edmac
ID: 1445525
I don't understand the instructions given. Please be more explicit
0
 
LVL 1

Expert Comment

by:can9999
ID: 1445526
Where ?  




0
 

Author Comment

by:edmac
ID: 1445527
where do I find the FindWindowsE  ?
0
 
LVL 3

Accepted Solution

by:
myqlG earned 200 total points
ID: 1445528
You should NEVER use sendkeys.. it does bad things and is slow
I use keybd_event
its in the API viewer and some support info can be found at
http://techinfo.sybase.com/css/techinfo.nsf/DocId/ID=47760
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

803 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