How to emulate MONITOR DETECT button press from Windows 10 display settings in Bash/PowerShell script - windows

I need to do display detection in windows script(powerShell is better for this I think?).
Which command will run the same thing which is running when I'm pressing button selected on the image below?

Look into WASP.. you designate a window to look for and which button to press.
https://wasp.codeplex.com

Related

How to move windows10 window control button to the right?

After last update of Vscode the window control button are hiding the Vscode menu. See top left (in white border) in the image below.
I am running Windows10 Pro.
Is there a way to move those buttons to the top-right corner?
Following the suggested link by #Mark, the issue is of Vscode integration into Windows 10.
I spent some time looking how to perform the change.
So:
Open (hidden) File menu using ATL-F
Select Preferences-> setting
Serach for window.experimental.windowControlsOverlay.enabled
Option should not be checked
See the screenshot below: (note: vscode will request & should restart)

How to move browser tabs to different monitors using a script?

I have a 3 monitor setup which is connected to a PC. It displays a Google Chrome tab on each of the screens with some dashboard. It will auto log off every night from the website (I cannot control that). So I need to manually login to it, open the tabs, then move it to each of the monitors every night. I am trying to automate this task. I am trying to use Sikuli slides to do it. Right now I am able to login, open tabs, and click on buttons. But I am not able to drag the tabs to other monitors. It doesn't matter which tab is displayed in which monitor. The PC is running Windows 7. How can I get it done ? Any scripting language or tool which is available in windows is fine. Thanks in advance.
Edit: Added an image which describes my need
You're opening the same thing on the same computer on the same screens, so it will be in the same place every time.
AutoHotKey (AHK) can do click-and-drag from a start coordinate to an end coordinate:
https://autohotkey.com/docs/commands/MouseClickDrag.htm
Run AutoHotKey, right click on the icon in the taskbar notification area (systray) and click 'Window Spy', and it will bring up AHK's helper tool. Now you can click on the Chrome tabs and look in AHK to see the coordinates of the mouse pointer, so you can plug those into the command. And drag/drop the browser and look at the mouse coordinates there, too.
(And if you weren't using Windows 7, but instead 8 or 8.1 or 10, you could use Aero Snap with Win+RightArrow, Win+RightArrow and Win+UpArrow to move the active window to the edge of the center screen, then to the right screen, then to fullscreen it).
(Or you could use Alt-Space, M, Arrow Keys to script moving the focused window around).
This is what I did to fix it:
Used MouseRecorder to record the mouse movements and keystrokes including my username and password. Using this, I logged in, opened tabs, clicked on buttons and moved them to different monitors.
Problem with this is that it is not possible to load a saved macro and run using the commandline (or I could not figure out). So I used Mouse Controller to record the mouse movement to open MouseRecorder and click on run. [It cannot record key strokes]. Mouse controller has option to run from commandline with ability to accept the filename as argument.
I wrote a batch file to open and run MouseRecorder and scheduled to run every night using task scheduler.

How to determine title and additional infos from an open window for use with Autohotkey?

To access and control a window, dialog or popup with Autohotkey the title of that specific window is needed. For some windows the title can be read directly if its visible, but some windows hide it. The window class and the exe (ahk_class and ahk_exe) aren't visible at all. How to gather this information reliable?
Use the Window Spy tool, which is installed together with AHK, it can be started various ways:
Right click the tray icon of a running AHK script and select Window Spy
Start the AU3_Spy.exe in the AHK installation folder
Use the Windows search to search for Window Spy
You will get a window called Active Window Info with various infos about your current active (topmost) window. The first box is the one you need.
Example
The box gives title, class and .exe to detect the target window of which every line can be used to identify the window. Now you should activate the window you want to address and copy the information.
Hint: You can (un-)freeze the display with Win + A

NSIS: How to disable keyboard and mouse keys without restarting the computer?

I want to disable / block the mouse click and keyboard typing for 6 seconds after launching a .exe file while displaying a advsplash.
Currently I manage to run a .exe file, activate the splash, block the keyboard and run a second .exe, but then, I need to restart the computer to unlock the mouse/keyboard.
Any idea on how to disable it without restarting the machine ?
This sounds like something you should never do.
If you want to do UI automation Windows already has support for that, using SendInput or keybd_event is not a good idea. Some apps steal foreground focus, this is just a fact and if that happens at the wrong time you end up sending input to the wrong window.

Binding Applescript to a mouse button

I wrote some Apple script to take advantage of the extra buttons of my mouse (say invoke 'Back' from my web browser) and it runs fine inside AppleScript editor. Now I'd like to bind it to my mouse's 'Button 4'. Saving the script as 'script' or 'bundle' would only cause the button-click to open the editor instead of executing it. Saving it as 'Application' will do the work but it involves opening the application, doing its job, and exiting the application, so each time there's a flash. Any way to get rid of this flash? One way is to run the script in the background but I don't know how.
I use Butler for this kind of thing. You can assign a keystroke to your mouse button, then tell Butler to run your script on that keystroke.
I can't help but wonder if there's not built in support for that already with your mouse's software, though. I can't remember the last mouse I had that the 'Back' option wasn't built-in.
My suggestion would be to use a program that can run a script with keyboard shortcuts. Here's a free one. Then instead of running the script from a mouse button, you just assign the mouse button to perform the keyboard shortcut.

Resources