SendKeys Failing On Target Workstation

P

Phil Galey

I have an application written in VB.NET, running on Windows 2000 SP 3. It
uses a process object and AppActivate, followed by SendKeys commands, to
control a running QuarkXPress application.

On the development workstation, it works fine; however on the target
workstation, SendKeys fails. Both workstations are Windows 2000 SP3 and
both have the same version of QuarkXPress running. I've found articles that
talk about sending lower-case letters when sending the control key (^) and
also making sure NumLock and CapsLock are off, but those two ideas haven't
helped.

What differences might one look for that would cause the SendKeys
functionality of the application to not work on the user workstation?
Thanks.
 
G

Guest

Why don't you use the 'FindWindow' API function to get the handle of the
application & then use SendKeys to it?

Pass "" for the class & the Window title for the second parameter &
FindWindow will return a non-zero; handle to the window:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Integer

Dim intHandle As Integer = FindWindow("", [Window caption here])

MessageBox.Show(intHandle) 'Should produce non-zero if success
 
P

Phil Galey

The solution I found was to feed part or all of the title bar text of
QuarkXPress to the AppActivate function and let AppActivate find the
QuarkXPress application, rather than feeding it a process ID. Now SendKeys
works on the user workstations as well as on the development workstation.
Thanks.


Crouchie1998 said:
Why don't you use the 'FindWindow' API function to get the handle of the
application & then use SendKeys to it?

Pass "" for the class & the Window title for the second parameter &
FindWindow will return a non-zero; handle to the window:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Integer

Dim intHandle As Integer = FindWindow("", [Window caption here])

MessageBox.Show(intHandle) 'Should produce non-zero if success


Phil Galey said:
I have an application written in VB.NET, running on Windows 2000 SP 3. It
uses a process object and AppActivate, followed by SendKeys commands, to
control a running QuarkXPress application.

On the development workstation, it works fine; however on the target
workstation, SendKeys fails. Both workstations are Windows 2000 SP3 and
both have the same version of QuarkXPress running. I've found articles that
talk about sending lower-case letters when sending the control key (^) and
also making sure NumLock and CapsLock are off, but those two ideas haven't
helped.

What differences might one look for that would cause the SendKeys
functionality of the application to not work on the user workstation?
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top