Questions tagged [sendkeys]

A .NET class that sends one or more keystrokes to the active window as if they were typed at the keyboard.

A .NET class that sends one or more keystrokes to the active window as if they were typed at the keyboard.

MSDN Documentation for System.Windows.Forms.SendKeys

1218 questions
8
votes
4 answers

Send Windows Key in batch script

I've recently been using the SendKeys function using Batch script. I've understood how to input certain keys into a window, such as the tab key: %SendKeys% "{TAB}" Or the backspace key: %SendKeys% "{BACKSPACE}" But I have been trying to input the…
Zinger
  • 413
  • 2
  • 5
  • 16
8
votes
2 answers

Sendkey twice based on success?

I was using sendkey to access Power Query and connect to SharePoint Folder. Everything was smooth until the Power Query Data Preview Dialog appears. How do I allow sendkey to continue after the dialog appears? I'm using button to start macro and…
aaa
  • 857
  • 4
  • 25
  • 46
8
votes
2 answers

SendKeys Ctrl + C to external applications (text into Clipboard)

I have an app that sits as a trayicon in the system tray. I have registered a Hotkey that when pressed will capture the current text selection in any application, even in Web Browsers. My aproach is to send the key combination {Ctlr + C} to copy the…
Oscar Hermosilla
  • 480
  • 5
  • 21
8
votes
1 answer

How do I programmatically press Enter?

I have a C# console program which starts calculator and simulates key presses. How do I programmatically press Enter? [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] public static extern IntPtr FindWindow(string lpClassName, …
user3231442
  • 600
  • 1
  • 9
  • 25
8
votes
1 answer

Automated 'PrtScn' keystroke acts like 'Alt+PrtScrn'

We need a screenshot of our app for a unit test. CaptureScreen() and CopyFromScreen() somehow ignore the app and return pictures of an empty desktop. So we wrote this to fake a PrtScn keystroke: public static Bitmap GetAltScreenshot() { …
4444
  • 3,541
  • 10
  • 32
  • 43
7
votes
1 answer

C# // SendKeys.SendWait works only when process'es window is minimzed

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; using System.ComponentModel; using System.Data; using System.Runtime.InteropServices; using System.Diagnostics; using…
Patryk
  • 3,042
  • 11
  • 41
  • 83
7
votes
2 answers

Unable to send underscore with Sendkeys in C#?

I've been bored, so I tried to make a program that writes a Look of Disapproval smiley(the ಠ_ಠ face) when pressing ctrl+shift+L. Now everything works, except for the underscore that is in the smiley, which won't get written at all. This was what I…
JeremyG
  • 71
  • 2
7
votes
2 answers

Programmatically disable caps lock

I'm using SendKeys in an automation program for work. I've been plodding along, and am now trying to iron out all the bugs that I've created :-) One of which, is that when I used SendKeys.Send("Test"), if the CapsLock is on, it will produce "tEST"…
HeWhoWas
  • 601
  • 1
  • 10
  • 22
7
votes
3 answers

Win32 equivalent of .net SendKeys

I am designing a system that reads a gesture from Kinect and make some actions. I am trying to include the system to be able to send HotKey to an application. My system is writing in c++ but the UI is in C++.net. I have been able to use SendKeys…
Oni
  • 798
  • 2
  • 8
  • 17
7
votes
2 answers

SendKeys doesn't always work

I am using .SendKeys() in Excel VBA to send key strokes to an external window that I am making active using shell .AppActive method. The problem is that SendKeys is simply not behaving consistently and is sometimes sending the keys and sometimes…
rex
  • 3,133
  • 6
  • 35
  • 62
7
votes
4 answers

Websdriver - sendKeys command is not typing on Password type field

I am trying to learn selenium webdriver automation but I am finding that the sendKeys command is not typing on Password type fields. I can see that some other people are also experiencing the same problem by googling it, but I haven't seen any…
Anoop Philip
  • 971
  • 2
  • 11
  • 19
7
votes
2 answers

Send keystroke to application in c# (sendkeys, postmessage, sendmessage all not working)

I am trying to do one of the following 1. open desired program and press a key programmatically 2. find open window of program and press a key programmatically (either is fine) I have tried numerous implementations of SendKeys.SendWait(),…
SPillai
  • 177
  • 3
  • 7
  • 20
7
votes
1 answer

VBA interaction with internet explorer

The macro I am building takes names from an Excel spreadsheet, opens Internet Explorer, and searches the online directory. After searching the directory, it pulls up a Java form with the manager's name in it. I am able to manually tab to the manager…
orangehairbandit
  • 323
  • 3
  • 5
  • 16
6
votes
1 answer

Sending Keyboard inputs to Spotify whilst not in focus

I have an AHK script (below) which sends various commands to the Spotify desktop app globally while in the background to perform various actions, however I play an MMO which has an always running anti-cheat which shuts the game down when it detects…
Superduder
  • 61
  • 2
6
votes
1 answer

Injecting commands by sending keystrokes to a command windows?

I have a command prompt window that runs a web based piece of software. I want to make a program in C# that injects commands into the running command prompt window. Any pointers? Thanks, Paul.
Paul
  • 61
  • 2
1 2
3
81 82