Page 1 of 1

Use ControlClick/Send in Windows 10 Apps

Posted: 23 Feb 2018, 12:49
by Bross9132
Calculator for example, this code sends a number:

Code: Select all

ControlSend, Windows.UI.Core.CoreWindow1, 8, Calculator
BUT
Special keys do not work:

Code: Select all

ControlSend, Windows.UI.Core.CoreWindow1, {Enter}, Calculator
I want to use controlclick/send so that I can send it to a hidden window, anyone know a way?

Re: Use ControlClick/Send in Windows 10 Apps

Posted: 23 Feb 2018, 19:32
by gregster
You can send = instead of enter, and * for x, `/ for divide:

Code: Select all

ControlSend, Windows.UI.Core.CoreWindow1, =,Calculator
ControlSend, Windows.UI.Core.CoreWindow1, *, Calculator
ControlSend, Windows.UI.Core.CoreWindow1, `/, Calculator
But I doubt that you can find keys for all functions of the calculator. But you probably could use Controlclick to click the right spots, if the window is not minimized. Try to move the calculator window to coordinates outside of the actual screen coordinates, so it can stay maximized without been visible/occupying actual screen space (and then move it back to see the result).

Re: Use ControlClick/Send in Windows 10 Apps

Posted: 24 Feb 2018, 01:28
by Nwb
Here's a list of calculator shortcuts I found to add to gregster's reply, for windows calculator: https://www.techlug.com/2013/03/shortcu ... lator.html
Use the same idea. ControlClick is a good alternative too.

Re: Use ControlClick/Send in Windows 10 Apps

Posted: 24 Feb 2018, 03:10
by gregster
Nice find! I just tested @ for square root and it works with Controlsend. I am not sure why keys like {Enter} or {Esc} don't work, though.

Re: Use ControlClick/Send in Windows 10 Apps

Posted: 24 Feb 2018, 15:01
by Bross9132
Thank you for the replies. However, I was asking a more universal question that applies to all win 10 apps. Specifically, my goal is to take a picture using the camera app while it is hidden in the background. Later on I will use this to take a picture every time I login to my computer. Enter, space, any special key does not work. I have even tried scan codes and VKs...

Re: Use ControlClick/Send in Windows 10 Apps

Posted: 24 Feb 2018, 15:11
by gregster
Well, these apps don't seem to be made for this kind of automation (it still might be possible). But Win 10 apps seem to create a lot of problems; and there might not be a general approach. I only recently updated from Win 7, so I have not much experience with these.

You are planning to take a picture of what exactly? There might be other tools or apps (or scripts) that can do the same thing via command line, which should be more reliable anyway...

Re: Use ControlClick/Send in Windows 10 Apps

Posted: 24 Feb 2018, 15:42
by Bross9132
Take a picture of me when I login. I am compiling a whole library for the purpose of securing a user's computer. Some examples containing the watch directory, netsession check to show who is in your C drive (applies to domain), and hopefully this camera one..