VDesk icon indicating copy to clipboard operation
VDesk copied to clipboard

Feature Request: Window positioning

Open Sven-Dawitz opened this issue 5 years ago • 7 comments

I love what this program does and how it does it.

Would it be possible to add some window positioning parameters? Especially "full-screen" "snap-left" and "snap-right". I searched and it seems I cannot achieve that via other 3rd party tool or command line options.

If this was added, I could easily restore my default environment on login.

Sven-Dawitz avatar Nov 09 '19 10:11 Sven-Dawitz

I agree with you!!!

Rimbaldo avatar Nov 09 '19 19:11 Rimbaldo

This would be a nice addition. I am currently using cmdow and some math for this.

teoxoy avatar Jan 16 '20 17:01 teoxoy

Hi @Teoxoy, please can you give an example of using vdesk with cmdow? Especially, how can you retrieve the reference of the window after opening it with vdesk?

Thank you in advance!

sgaumin avatar Apr 02 '20 06:04 sgaumin

@sgaumin this is part of my batch script:

set handle=

:getHandle
for /f "tokens=1" %%r in ('"cmdow /t /f | find /i %*"') do set res=%%r
set handle=%res%
exit /b 0

vdesk 3
start /high /b "" "%APPDATA%\Spotify\Spotify.exe"
call :getHandle "Spotify"
cmdow %handle% /res /mov 1720 0 /siz 1720 1400

teoxoy avatar Apr 02 '20 07:04 teoxoy

Thank you @Teoxoy for your quick response!

On my side, I wrote this similar line for each software I want to launch: vdesk on:2 noswitch:false run:"C:\Program Files (x86)\KeePass Password Safe 2\KeePass.exe"

Do you think that it is possible to identify and move a window launched like this?

sgaumin avatar Apr 02 '20 08:04 sgaumin

I'm not sure anymore, but I think for cmdow to work, you need to have vdesk actually switch to the specific desktop.

teoxoy avatar Apr 02 '20 13:04 teoxoy

For information, after some research I was able to position window by using an AutoHotKey script. Here is an example:

SetTitleMatchMode, 2 

SysGet, mainMonitorWorkArea, MonitorWorkArea, 1
SysGet, secondMonitorWorkArea, MonitorWorkArea, 2

mainMonitorMiddleWidth := mainMonitorWorkAreaRight/2
mainMonitorMiddleHeight := mainMonitorWorkAreaBottom/2

WinActivate, GitHub ; Looking for a window which has GitHub contains in its Title
WinWaitActive, GitHub
WinMaximize
WinMove, , , mainMonitorMiddleWidth, mainMonitorMiddleHeight, 0, 0
Sleep 100
SendInput {Lwin down}{Up}{Up}{LWin up}

ExitApp

Hoping it can help!

sgaumin avatar May 13 '20 02:05 sgaumin