Author Topic: Open window at X/Y on screen, or open and move as fast as possible  (Read 2444 times)

Malic

  • Full Member
  • ***
  • Posts: 102
I have a series of commands that open specific windows in Windows Explorer (dropbox, pictures, documents, music, etc.)

Because I am doing things in a streaming environment, I do not want things opening up on the screen that gets set to Twitch.  Because of the way Windows 10 works at least, if I have a window on a center screen, all other Win Explorer windows will open on it.

I have tried to open a window and move it, however issue I am having is, there is no way to target a Windows Explorer window, and because of loading, there is no set time between calling for the window to open, and it being able to be manipulated.

If a feature was added, the two ways I could see it be implemented, if possible, to force a window to open in a specific place.  If that is not possible, to open the window as normal, but move it to a specified location ( and maybe even set size at same time ) as soon as it is able to be hooked into and moved.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Open window at X/Y on screen, or open and move as fast as possible
« Reply #1 on: March 12, 2020, 08:34:24 PM »
Heya, bud.

You'll want to try opening the window using a, 'Run an application' action.  In there, specify the folder name (like, 'C:\temp' (no quotes)).  Then, choose the, 'Wait until launched application is started before continuing' is selected, as well as checking its optional, 'set command to target launched application'.  This causes the command to pause while the process (folder) loads - it then makes the opened process (folder) the active window.

From there, you'll add a, 'Perform a Window Function' action (selecting the active window) to the command that moves the moves the window to a specified coordinate.  You can then add an additional, 'Perform a Window Function' action that resizes the window to a specified size.  Your actions will look like this:

Run application 'c:\temp' - wait until it starts -set as target
Move window '[Active Window]' to (100,100)
Resize window '[Active Window]' to Width: 100, Height: 100


It's all in the help doc if you need more info ;)

Malic

  • Full Member
  • ***
  • Posts: 102
Re: Open window at X/Y on screen, or open and move as fast as possible
« Reply #2 on: March 12, 2020, 08:51:14 PM »
Ok, that seems to be where I am having difficulty, I have another program that I use for Elite, that looks for joysitck inputs, and makes sure Elite is in focus (mostly so I do not crash into a star)

This seems to be stealing focus away if I am opening those screens when the game is still running, and need to stop all inputs so it does not do that.

Malic

  • Full Member
  • ***
  • Posts: 102
Re: Open window at X/Y on screen, or open and move as fast as possible
« Reply #3 on: March 12, 2020, 08:55:55 PM »
Seem to be having another issue, I have set those flags

https://i.imgur.com/Yvt5PCQ.png



It is still going too fast and is moving the last window I have selected, not the window that I am opening

Is giving an " Error with launched file: [No process is associated with this object.] "

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Open window at X/Y on screen, or open and move as fast as possible
« Reply #4 on: March 12, 2020, 09:40:25 PM »
I'm able to reproduce this based on the example I gave, but intermittently.  This seems vaguely familiar - dealing with folders.  It's like there is no window handle available when explorer lets go.  I must note that I have, 'launch windows in their own process' selected - not sure if that makes a difference).

Try this out (this works for me consistently):

Run application 'c:\temp'  ('do not wait for launched application' is selected).
Display window 'C:\temp' as [Normal] (pause up to 1 second for availability (ymmv))  <--- Perform a window function action
Move window 'c:\temp' to (100,100)  <--- Perform a window function action


Note:  The second action is waiting for a window handle to become available.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Open window at X/Y on screen, or open and move as fast as possible
« Reply #5 on: March 14, 2020, 07:02:39 PM »
Perhaps worth looking into:

"FancyZones", which is a component of Microsoft's "PowerToys" utilities pack, allows you to set up sections of your displays you can snap windows to.

The "Move newly created windows to the last known zone" option should open windows in the section you last put them in.