Autoit MouseClick - click does not work on Connection Bar in RDP window - mouse

I am trying to minimize RDP window by using Autoit mouse functions
First MouseMove to correct location -> hint "Minimize" appear
but then MouseClick (or mousedown, sleep, mouseup) seems do click "through" connection bar , as I see icon on desktop under the connection bar got focused.
I thought before, any mouse action "by hand" can be imitated , but I am stuck here...

To fix this problem, you need to do one of the following:
Run the program on the remote computer - then you can use the "standard" AutoIt functions
Run the program on the local computer, and analyze the remote image with ImageSearch UDF or OpenCV UDF and click in the selected point of screen.

Related

Exiting out of a running Python script when script window is hidden

I have a Python script written using Visual Studio Code that periodically moves the mouse icon to keep the computer active and stop it from falling asleep. This computer is used for displaying other info, so when the program is running the script window is minimized and another window is selected and opened and then the computer is left alone. When I want to use the computer again the Ctrl+C keyboard interrupt to terminate the script does not work unless the script window is reopened. This proved to be annoying as the script takes control of the mouse away from the user. I have a 'time.sleep' command that pauses the mouse movement to allow for user control again for a bit, but I would like to be ab le to just exit the script without having to wait for this pause to be able to open up the script window.
I am fairly new to Python, so I am unsure of other commands or keyboard inputs that might allow this to be possible.
The code I have does utilize the pyautogui module and has the default failsafe of moving the mouse icon to the corner of the screen enabled. However, this still requires me to wait for the pause in the script when I have control of the mouse again.
This is for a Windows environment.
If you are using pyautogui, just quickly move your mouse to the top left corner of the screen and your program will stop

Autohotkey over Hikvision software

I am trying to click on the iVMS-4200 window with a script made with Autohotkey.
The script works as I have tested it on the browser and it doesn't give me any problems. The thing is that on the mentioned software, the clicks don't work.
This is the script in ahk:
MouseMove 500, 300 ; Move mouse to my coor
Send {Click Right} ; First right click
Any idea how to make it work?
If someone is also facing this problem with Autohotkey, just try to run the script as administrator.

Access the MDI toolbar menu with AutoHotKey ControlSend

Automating a process that is being run on a RDP session, I have to use ControlSend, and not Send command in AutoHotKey.
The WindowSpy doesn't find any control on the MDI toolbar, and there are no shortkey to the menu item I want to access (Filter..). How may I open the toolbar and select the item?
I've tried
ControlSend, ahk_parent, {alt}, ahk_class FNWND3170 ;Open project folder in treeview
But with no success.
I've considered using AutoIT, but I don't think that would help as the AutoIt spy doesn't pick up the control either.
Sorry, but think of the RDP window (or even full screen) as an ever-evolving bitmap image. Your PC and autohotkey have no idea what is behind the picture. Can you run the ahk script in the remote pc itself? Keep in mind, the RDP client handles your mouseclicks and keyboard (and even voice) entirely by re-directing inputs, etc. So best bet is to do a mouse click in the appropriate spot by running a script from outside the window:
CoordMode, TargetType [, RelativeTo]
Click, 44, 55 ; Clicks the left mouse button once at coordinates 44, 55 (based on CoordMode).
Use the CoordMode "RelativeTo" flag to set to "Relative" so coordinates are relative to the active window. You may have to click twice, once to activate the RDP window and then to click at the mouse position.
See https://www.autohotkey.com/docs/commands/Click.htm and https://www.autohotkey.com/docs/commands/CoordMode.htm for info.
Hth,

Automatic clicking on java program buttons

So I need to automate some button clickings on a java program. I tried ahks/autoit's controlclick but it doesn't really work (normal clicks do work, but I require no mouse movement).
I tried to get some information from window detective / window spy, etc. but not much is displayed apart from the window name and ahk_class
Java Ferret shows quite a lot more information though: https://gyazo.com/3539415488ce3e03c90f3532327419f2
How can I trigger one of these "push button" actions? (say "Descendent 19 role")
If you can get the X and Y coordinates of the control along with the window name, you could use a mouse click event.
Other than that, you can try using an image search to find the control's X and Y and perform a mouse click.

In notepad++ change tab size instantly

I'm using notepad++ (v6.5.3) and I constantly have to change the size of the tab for viewing some results. Not that it's taking me a lot of time to do it manually everytime, but it would be great if I could optimize that.
Is there a way to do so? Would a macro be the solution, or are they just for typing stuff?
Thanks a lot!
Ok, there's an easy way how you can achieve this - I have tested it right now:
Install AutoHotKey (or start portable version which runs without installation)
In Windows 7 and above, ensure you launched AutoHotKey as Administrator (otherwise you get inconsistencies in its behavior) - if not sure, exit it and restart it as administrator
Right click Autohotkey tray icon and select Edit This Script
Import the macro below this list at the end of the AutoHotKey script file and save the file
Right click Autohotkey tray icon and select Reload This Script.
–– This was end of general steps, now let's go with your macro: ––
In N++, display Preferences window and press its Close button1 at the bottom (NOT at the top-right corner)
Now you can use shortcuts Win+F2 and Win+F3 to switch different tab sizes instantly
SendMode Input
DetectHiddenWindows, On
SetTitleMatchMode, RegEx
;--------------------------------- Hotkeys for Notepad++ only
#IfWinActive ahk_class Notepad\+\+
#F2::Send {F10}{Right 6}{Down}{Enter}{Tab 2}{Space}16{Enter}{Tab 3}{Space}
#F3::Send {F10}{Right 6}{Down}{Enter}{Tab 2}{Space}4{Enter}{Tab 3}{Space}
#IfWinActive
1) Important: N++ user experience provided in dialog boxes is absolutely terrible. There are no anchors where you can fix focus when using keyboard. Thus you always need to perform step 4 manually when leaving Preferences dialog box otherwise the macros would send keys into incorect window page OR at correct page but incorrect control. Preferences dialog window remembers selected page and control. Macros I created for you therefore assume that correct page is already listed and button Close was recently focused.
Good news is Notepad++ windows with this weird behavior are rare exception from general user experience. In other places in N++ (or in other apps) where user interface components (menus, dialogs etc.) always start from the same point you do not need any special precautions like the one in step 4.
Adjust the macros as you like:
you can create more of them
you can adjust the numbers "16" and "4" typed into tab size input box
you can change shortcut keys to something else
you can replace sending keys with sending mouse clicks at desired screen/window positions
you can achieve many other useful shortcuts in N++ and in all other apps – check AHK deeper!