Click here to Skip to main content
15,888,279 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application which sends keypresses to another application window using this code:
C#
ADR_Library.DataAccess.Win32Imports.SetForegroundWindow(handle);
System.Windows.Forms.SendKeys.SendWait(item.Key);
System.Windows.Forms.SendKeys.Flush();
System.Threading.Thread.Sleep(1000);


This was working fine but in the last week it has stopped working. An older release of the programme has stopped working too. I know that the code finds the correct 'handle' for the other window, but the data does not appear in the destination window. Why? This works on some other PCs, but not mine anymore.

This sounds to me like some sort of Windows permissions issue, as if a Windows Update has perhaps changed something.

What I have tried:

Running my application under the Admin account does not solve the problem.
Posted
Updated 22-Jan-18 1:50am

1 solution

Okay, the problem seems to have been caused by the first characters in the test string causing the window to lose focus ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900