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

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

Related

Hide console when running shortcut pinned to taskbar

I'm trying to create a shortcut (.lnk) file that will launch scrcpy without showing the console window, but I need to be able to pin it to the taskbar and have the window and shortcut merge. Scrcpy is bundled with a vbs script that launches scrcpy through wscript, hiding the console, but when I made a shortcut opening that through wscript that made a duplicate window (icon?). I also found a somewhat promising question here about Pinning advertised shortcuts on the taskbar, which led me to an MS Docs page about AppUserModelIds, the only problem being I don't really understand how they work, or how to make a shortcut with them.

UIautomation on windows: How to get element name of window element (zoom audio icon)

I want to detect the user name and mute icon using windows uiautomation on zoom meeting window
Inspect Tool on windows does not show any thing related to this icon and user name...
How can I find that icon type(window, button, tool tip) or better complete user name and icon...
Is there any other tool to find these things?

How can I specify on which monitor the console window is opened?

I've currently connected two monitors via a dock to my notebook.
When I'm running my console application, the console window always pops up on the first monitor. How can I change that it's automatically opened on another monitor, e.g. on monitor 3? Maybe there is a property I need to modify?
It's very annoying to always drag the console window onto the monitor on which my IDE is opened.
Console applications (unlike GUI applications) don't create their own window; that's done by Windows, and in the case when you're running in an already created console, then you kinda inherit, e.g., cmd's window.
What you can do, though, is to find your window and move it to a different monitor.
Another option is to change the window manager settings for that application in the properties of the console window under Layout. Especially the check box »Let system position window«. To do so, first move the window where you'd like it to appear, then open the properties, go to the Layout tab, and just click »OK«.

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.

xul dialog box wont have maximize and minimize buttons after updating firefox to version 32.0

used dialog tag in xul for a dialog box for an xul application.Earlier before firefox update the tool had maximize and minimize buttons but after update the buttons are no longer there in the tool.
MDN Docs: Window.openDialog, Window.open, <window>, <dialog>, <dialogheader>, Dialogs and Prompts
Without all of: The Firefox version from which you were upgrading, the version you upgraded to, the code you are using to open the window, and the XUL used to describe the window it is difficult to provide you with an answer which actually covers what you want to know.
MDN has the following to say on dialog windows: "Dialog windows are windows which have no minimize system command icon and no maximize/restore down system command icon on the titlebar nor in correspondent menu item in the command system menu. They are said to be dialog because their normal, usual purpose is to only notify info and to be dismissed, closed. On Mac systems, dialog windows have a different window border and they may get turned into a sheet."
That makes is clear that dialog windows do not normally have the controls you are asking about.
However, you can pass minimizable in the features parameter of the window.open() or window.openDialog() functions to turn on minimize control.
In general, if you want a dialog to have minimize and maximize buttons, you have to open it as a normal window with window.open(). You can limit the other toolbars that it has at the top by supplying appropriate parameters in the window.open() call. You can also make it modal, like some dialogs. You then create your own OK and Cancel buttons with appropriate code to accept the information in the dialog or cancel. Basically, if you want a maximized window for a dialog it should usually be doing quite a bit. In such case, you probably want more control over how your window looks than is available from a dialog window. Dialogs are, generally, subset of what windows can do with the ability to have a few buttons easily provided.

Resources