Problem with SendKeys

MikeA 1 Reputation point
2021-11-25T00:55:37.65+00:00

Here's an interesting problem I've come across trying to use SendKeys with either VB or VBA/Excel.
On start-up, SendKeys works fine. However, after watching a video it just 'freezes' the screen completely and I have to use CTRL-ALT-DEL then Cancel to 'unfreeze' it. The SendKeys keystrokes then show up on the application correctly (in this case, Excel).
I've tried Procmon and Regshot but there is nothing obvious to narrow down what the problem is. My first thought was the display driver screwing things up, but now I think it's something to do with how Windows 10 handles the system languages.
My only language in Settings and Control Panel/Language is 'en-GB'
After said video watching, when I press CTRL-ALT-DEL or WIN-L I get 'en-US' appear on the login screen aswell as 'en-GB'. Yet there is no 'en-US' option in settings to remove it from the system.
Even stranger, I used Macrium Reflect to clone the Windows 10 partition to another PC and SendKeys works fine on that!
Anyone have any ideas what is going on?

{count} votes

1 answer

Sort by: Most helpful
  1. MikeA 1 Reputation point
    2021-11-25T16:10:06.23+00:00

    OK, so after playing around some more with Windows 10, I THINK I have solved the problem.

    If I play my videos with another player, like Media Player for example, the issue does not arise. I was using ffplay as my default player and this seems to screw up the input languages on the login screen (bizarre!)

    So I've switched my default media player now and so far so good!

    I put this on here in case someone else has encountered this issue. I know SendKeys is far from ideal, but I have a bespoke piece of software that relies on it to work properly, and I'd hate to throw away tens of thousands of dollars by switching to another software!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.