-1
Does anyone know any alternative way to use Sendkeys in Windows 10? I have a program that works perfectly on Windows 7 but doesn’t work on 10 because apparently Microsoft has disabled using Sendkeys on it.
The program is running in front of any other and has several buttons. Each button, when clicked, executes the following code:
SendKeys.Send("%{TAB}")
SendKeys.Send("ŷ")
The first line is to give alt+tab and change the focus to the last program used and the second is to send, in the window now in focus, a certain string (in this case, "Ŷ". The other buttons do the same, differing only in the sent string.
Does anyone know any other way that this can be done in Windows 10? Thank you!
net-core or net-framework?
– Guilherme Nascimento
Is net-framework
– Nicholas
with msbuild or vs-studio or dotnet (command line)? You’re using UAC in the app?
– Guilherme Nascimento
I’m using vs-studio. Probably has UAC, I tested it on a newly formatted PC.
– Nicholas
What does UAC have to do with formatted PC or not? UAC is something else.... UAC has to do with administrative permission.
– Guilherme Nascimento
I said it is formatted so you know it is with the default settings. You know of any alternative?
– Nicholas
UAC has nothing to do with system settings, has to do with the mode the application requires to launch.
– Guilherme Nascimento
So I don’t know. How do I check this?
– Nicholas
Check? What do you mean, the app isn’t yours? Don’t you know what you wrote in it yourself? If you created it then you wrote the UAC part, if you don’t know what it is and you haven’t written anything relative and the program doesn’t require Adm then you haven’t done anything related to it. The sensible answer would be "I don’t know what this is," which would probably sum up that you didn’t program this part, so I’d help you with this.
– Guilherme Nascimento
I wrote it years ago and it’s been a long time since I’ve done any programming. I don’t remember setting anything up for that.
– Nicholas
It’s not a question of "set up" it’s a matter of looking and checking the details, if you didn’t know what UAC was easier to say, after all your questions are devoid of minimal details and I’m trying to help you help yourself, because I’m not able to guess what you’ve done,.
– Guilherme Nascimento
Cool, bro. I don’t know what that is.
– Nicholas
Great, so you didn’t configure it. In your project folder you have a file with the extension
.manifest
?– Guilherme Nascimento
Yes, it has a .vshost.exe.manifest.
– Nicholas
Maybe it has generated alone, does not have any with the same name of your project? Or app.manifest?
– Guilherme Nascimento
With the exact same name, no. But the project is like Windowsapplication1.exe and has a Windowsapplication1.vshost.exe.manifest. There’s no app manifest..
– Nicholas
Okay, I’m not sure if this is it, or if it’s from an old version, do the following, in the build of your generated app right click and select start as administrator and see if Sendkeys works ... I believe that it can be this pq in the MSDN has nothing to say about win10 compatibility with Sendkeys, then I don’t know if the information you obtained on the subject is true.
– Guilherme Nascimento
In fact, I did some tests here and I saw that Ndkeys is still working, because he kept giving alt tab, just did not send the other key. Then I put a Sleep(200) between the alt tab and the string upload and it’s working perfectly. It seems that the change time between windows is longer, so there was no time for the two commands to be sent in time.
– Nicholas
It’s very likely even if there was some change in the rendering of Win10 windows.
– Guilherme Nascimento
Thank you very much for the provision!
– Nicholas