Autohotkey isn't recognizing the active window? - open-source

WinGetPos,X,Y,W,H,A
space::MsgBox,%H%,%W%,%X%,%Y%
When this runs I get X and y to be 0 and I get the hidth and width to be the resolution to my screen I imagine something is happening where my desktop is being selected before this is run but I'm pretty confused as to where that is.

Are you perhaps launching this script by double-clicking an icon on the desktop, or from a full-screen window?
The WinGetPos command will run as soon as the script is launched. Only the message box will run when you press space, but will always return those same initial values no matter what window you are in at the time.
Change it to this and you should get the expected results:
space::
WinGetPos,X,Y,W,H,A
MsgBox,%H%,%W%,%X%,%Y%
return

Related

Sikuli opening windows start menu without reason

Im trying to create a script that works on two differents windows simultaneously, but everytime the script clicks, it opens the windows start menu without reason which hides part of my screen and cause FindFailed errors.
What can I do to prevent that ? What causes this issue ?
Clicks with SikuliX are not "simultaneously" but always sequentially one after the other.
So tell a bit more about your setup.
A relevant snippet of your script code might help as well.
Have you tried "run in slow motion", where you can better watch, where the mouse moves and clicks?

How can I redesign octave

I downloaded octave and accidentally pressed some buttons which changed the design of the software to be more specific it doesn't look like how my professor at university was working with it . Could you please help me to fix it in order to look like how it did in the beginning?
I upload a picture of how it looks like now
OK, it appears you are only looking at the Editor window, which is normally docked with other windows like the command window, documentation, etc. It also appears to be maximized, hiding everything else.
In the upper right you see two icons, one that looms like an x, and one that looks like two overlapping squares (two windows). If you click the x, that should close the editor and you should be able to see the rest of your desktop including the rest of the octave GUI. If you cannot see octave anywhere, of you are in Windows try using ALT-Tab or clicking on Octave in the task bar to make the window visible.
In the main octave window there should be a "Reset Default Window Layout" menu item under the Window menu. That should restore everything to the default layout without having to go to the trouble of a full reinstall.
The following YouTube video doesn't exactly match your problem, but it does show how to change and restore the GUI layout:
https://youtu.be/0USOvYHLqSU

Drag and drop a window upwards in sikuli

Background:
I am trying to automate a desktop application using sikuli with Java.
When we click on a Browse button in the application, it will open a new window to select destination folder to download some files.
We need to click OK button once the folder is selected.
Problem:
Whenever we click on Browse button, an enlarged window is opened by default in the lab execution machine where the script is running.
Due to this, the OK button is not visible on screen.
We have to move the Browse window upwards in order to make it visible.
I tried using Region.dragDrop() method to move the window upwards.
However, it is not find the destination match which is behind the Browse window.
Please guide me in coming up with a working approach to this problem.
This is an indirect solution to your problem. Since drag/drop and other "visual" actions are usually more flaky and harder to automate, I suggest you use keyboard shortcuts as much as possible. In your case, if the blocking window is opened last, I assume it becomes the active window which means you can minimize it using Win+down combination (assuming you are in Windows).

Cursor not showing in Device Mode (Google Chrome)

So I'm trying to develop a webapplication and I'm trying to check it out on mobile.
I'm currently using Cordova and JQuery Mobile together with ripple.js to view my application in my browser.
The first issue (as far as I know) is that ripple.js will work best in Google Chrome, so this is my only test platform.
The second issue is that when I toggle Device Mode on, it doesn't show me the black dot (cursor) when I enter the rendered version.
I'll explain my situation or a scenario:
As an example I'll go to http://google.com
I press F12 to enter developer mode
I click the Toggle Device Mode button
I will see my cursor, until I enter the generated mobile canvas. While I would normally see a black transparant dot, I now see nothing.
I can however click and drag like I would normally do, but I can't see what I'm doing.
The things I already tried:
Reset all the flags back to default
Reset all developer tool settings to default
(edit) Installed a previous version of Chrome AND Chromium
So question is, how do I get my cursor back?
Extra: I'm using version 49.0.2623.87 m, but that's not related since my co-worker, has the same version and he sees the cursor.
(edit) currently I'm using the mouse option where I press Ctrl to see the circle which indicates where my cursor is, but this really has to be a temp solution.
(edit) I fixed it by doing a combination of things. So I'm not sure which exact thing fixed it. I removed a few programs that I installed after it still worked. I uninstalled about 4 of them. Also I did an update of my graphics card and then did a reboot. So it could be either the graphics card update, the software uninstall and/or the reboot.
I had the same issue. (note this question might be a duplicate of this one)
Following the advice on the Chrome forum here I changed the Quantization Range in my Intel HD Graphics Control Panel from "Default Range" to "Full Range". The touch pointer (grey circle) appeared immediately.
If that doesn't help you may have to change refresh rate too. Changing from 59p Hz to 60p Hz or some other refresh rate might help.
This should also help.
Open the mouse control panel.
Select the Pointer Options tab in the Mouse Properties window.
Then enable Display pointer trails option.
In case you don't like or are getting annoyed, like me, due to the trailer. Move the slider to the Short position and the trailer becomes near to non-existent or invisible.
I fixed it myself, yet I'm not exactly sure how I did it. I edited my original post and added the solution in the last paragraph.
Had the same on my Asus laptop with Chrome 66
Resolution that worked for me
Graphics Control Panel > Display > General Settings > Scaling > Change to Scale full screen.
OFF your Asus Eye Care Switcher.
I am posting this as answer because above mentioned answer didn't work for me but I had this issue when I had a monitor attached to my laptop, for development work. I played around with my display settings and discovered that IF the scale on my second monitor did not match the scale on my laptop, the mobile development mode cursor would disappear. (windows 10)
If this is an issue for anyone just go into Display settings -> Display -> Scale and Layout --> make sure that both your laptop/desktop matches the display scale of your second monitor.
Hope this will help.

Don't show run tab after launch in Android Studio

I'm developing apps in Android Studio. But everytime I hit Run button, the Run tab pops up automatically from bottom with messages like Installing com.packagename etc..., Success, Launching
I've already disabled automatic displayin of Android DDMS tab (because I use DDMS from toolbar which opens new window) by editing configurations. But I can't disable this stupid automatic Run tab showing.
Is there any way to do this ?
There is no standard way of achieving this but I found an interesting workaround mentioned below and using the same.
When your run tab is opened, Instead of hiding it using right-top corner button, Drag it till it hides.
Like in picture shown below
Now Run your project run window wont appear, When you want it back click on run button in horizontal bar.
Working perfectly for me .
In case anyone still struggling with this annoying thing, there is a way to disable this annoying popup.
Note: this will remove the run tab altogether.
So basically go to your Run/Debug configuration and Uncheck Activate tool window at the bottom.
This gets rid of the Run tab.