473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

SendKeys.Send only runs first time

Hello,

i built a small system-tray application that listens to a hotkey builds
a string and inserts the string to the active application using
SendKeys.Send()

The Problem is - this works only once. The hotkey is still o.k. (i also
copy the string to the clipboard, here I always get the correct string
that contains a timestamp) but sendkeys sends strange characters the
second time:

{}[}}[²
or
{}[}}[}

Depending on the active application sometimes the second time no string
at all is sent.

Can you please help me with this?

Thanks Alfred

Nov 17 '05 #1
5 2374
I havent used sendkey for years, and i have always had problems, if you want
to put some text in somewhere you may be able to use the clipboard and send
the Windows Message the triggers a Paste.

Steve
<al***************@gmx.de> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hello,

i built a small system-tray application that listens to a hotkey builds
a string and inserts the string to the active application using
SendKeys.Send()

The Problem is - this works only once. The hotkey is still o.k. (i also
copy the string to the clipboard, here I always get the correct string
that contains a timestamp) but sendkeys sends strange characters the
second time:

{}[}}[²
or
{}[}}[}

Depending on the active application sometimes the second time no string
at all is sent.

Can you please help me with this?

Thanks Alfred
Nov 17 '05 #2
Try using SendWait() instead of Send() in order to make sure the first group
of keys was processed by the receiver before sending another group.

Brendan
"al***************@gmx.de" wrote:
Hello,

i built a small system-tray application that listens to a hotkey builds
a string and inserts the string to the active application using
SendKeys.Send()

The Problem is - this works only once. The hotkey is still o.k. (i also
copy the string to the clipboard, here I always get the correct string
that contains a timestamp) but sendkeys sends strange characters the
second time:

{}[}}[²
or
{}[}}[}

Depending on the active application sometimes the second time no string
at all is sent.

Can you please help me with this?

Thanks Alfred

Nov 17 '05 #3
Thanks for your answer,

the problem is, the users don't wan't to loose there current clipboard.
That's why I thought about sendkeys

Bye Alfred

Nov 17 '05 #4
Hi Brendan,

thanks for your answer, but this didn't help

Bye Alfred

Nov 17 '05 #5
You can save and resotre the clip board.

Steve
<al***************@gmx.de> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Thanks for your answer,

the problem is, the users don't wan't to loose there current clipboard.
That's why I thought about sendkeys

Bye Alfred

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RBohannon | last post by:
I need to create a report in MS Word populated with data from A2K. I have been asked to create the report in Word so that parts of it can be edited as necessary later. The data in the report are...
2
by: ABinBoston | last post by:
I have a macro that uses the SendKeys function to send F9 - to auto save a record. The Application runs perfectly on many PCs, but on one I get the following error. SendKeys Action Requires...
2
by: Gary | last post by:
I am trying to use the "System.Windows.Forms.SendKeys" class for triggering the Ctrl+P key. Syntax: System.Windows.Forms.SendKeys.Send("^(P)"); This is not working ..what could be the...
1
by: GrantS | last post by:
I need to use a sendkeys key combination to automate the "accept files" that a remote user wants to send to me via Windows messenger. I am using automation to work with Windows Messenger client in...
2
by: MLH | last post by:
I have the following code with a SendKeys statement in it. 100 If Me.Dirty Then MsgBox "Form is Dirty!" 120 Dim MyQ As String, MyTitle As String, Response As Boolean 140 MyQ =...
0
by: neonspark | last post by:
I'm buidling some simple macro functionality for my app so the users can record a sequence of keyboard inputs and replay them reliably via some menu. Originally, I used: protected override bool...
7
by: =?Utf-8?B?Vmlua2k=?= | last post by:
public void sendKeysTest() { Process myProcess = Process.Start(@"C:\winnt\system32\cmd.exe"); SetForegroundWindow(myProcess.Handle); if (myProcess.Responding) SendKeys.SendWait("{ENTER}");...
1
by: Boki | last post by:
Hi All, I am trying to create a auto login program. Below is the part of code, my issue is - the target form ( handle / window ) usually didn't perform the key I sent from my C# program...
4
by: Silgd1 | last post by:
Hi All.... I am using python 2.4. I have a python script on an xp machine. This machine is on a network, and is dedicated to running python scripts. I use remote desktop to access the machine...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.