• 0

[C#] Case-sensitive SendKey?


Question

I'm working on an application right now that uses SendKey to send keystrokes to an external application.

The upside is that it's very easy-- SendKey.SendWait("Hello World!"); is all it takes.

The downside is that it's case-insensitive. The above line will send "hello world1", as shift isn't held at any point in there.

Is there a quick and easy fix for this? I looked at SendMessage, but couldn't figure out if that would do what I need, and I don't know how to declare a HWIN to specify which window I want it send to.

Link to comment
https://www.neowin.net/forum/topic/337742-c-case-sensitive-sendkey/
Share on other sites

5 answers to this question

Recommended Posts

  • 0

I haven't tried sending it a single character; I don't really see how that would help, but what exactly are you suggesting, I might be missing it?

MSDN's info has everything I've been using (I used it to find the function in the first place), but it doesn't provide anything on how to get it to distinguish between upper and lowercase characters.

MSDN expects you to type SendWait("+Hello +World+1") to get Hello World!, whereas I want it to take a string that a coming from elsewhere and push it out, so formatting it with the '+'s isn't going to work for me. Is there a way to disect a string char by char and look for capitals/punctuation?

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.