Sign in to follow this  
Followers 0
Iznogoud

Assign application to start on Monitor 1 or Monitor 2

6 posts in this topic

I have a just a simple question i think for the people here with more coding skill then i have. (not very hard :))

Is it possible if i execute a program i can decide on wich screen its starting?

For an example: I want to start a Remote Desktop connection on my 2nd screen.

Is this possible, i think so because Ultramon is getting it done.

Any idea? i know some prefer some code before you want to help. But i have no clue if this is even possible.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Unless a progarm stores its window position settings in an ini file or the registry keys, you probably need to use something like:

Run(...)

WinWait(...)

WinMove(...)

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

If you need a scripting solution I would do what Cyberslug said and write a "Loader/Shortcut" script that runs the designated application, waits for it, then immediately moves it.

Is Ultramon's shortcut feature not working for what you are trying to do?


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

If you need a scripting solution I would do what Cyberslug said and write a "Loader/Shortcut" script that runs the designated application, waits for it, then immediately moves it.

Is Ultramon's shortcut feature not working for what you are trying to do?

Ultramon is possible, but you need to buy the application. Not a problem for me. But some customers only need a simple thing like start the Remote Desktop Client voor Terminal Server wich must eventually start on monitor 2.

All the extra feature ok nice, i have this program at home and i really like it, but some people. So i thought Ultramon can create those options, so why can't we do the same.

-edit-

I have tried to let it work like the way above. Real simple and quick not with the wait etc.

Opt("WinTitleMatchMode",2)
$size = WinGetClientSize("- Remote Desktop")
WinMove("- Remote Desktop", "", 1280, 0, @DesktopWidth, @DesktopHeight)
WinSetState("- Remote Desktop", "", @SW_MAXIMIZE)

Only the last SW_MAXIMIZE doesn't do his job right. it is maximize, but not full screen. Hard to explain but if you use Remote Desktop in full screen mode you get the small bar on the top of your screen and thats it. If i do i like the code i have written above, it moves to my second screen, BUT i doesnt get in Full screen mode. I still see the Minimize,Maximize and Exit icons and the Info bar of explorer.

But still i hope there is a better way.

Edited by Iznogoud

Share this post


Link to post
Share on other sites

The mstsc Remote Desktop client remembers its last position for me....

But you can force it in to full screen and then move it. This example assumes 1024x768 resolution on both monitors and that the secondary monitor is on the right side.... Adjust $x and $y as needed.

$server = "192.168.0.1"
$x = 1024
$y = 0

Run("mstsc /v:" & $server & " /fullscreen")
WinWait($server & " - Remote Desktop")
WinMove($server & " - Remote Desktop","", $x , $y)

Command line args:

Remote Desktop Connection

MSTSC [<Connection File>] [/v:<server[:port]>] [/console] [/f[ullscreen]]

[/w:<width> /h:<height>] | /Edit"ConnectionFile" | /Migrate | /?

<Connection File> -- specifies the name of an .rdp file for the

connection.

/v:<server[:port]> -- specifies the terminal server to which you want

to connect.

/console -- connects to the console session of a server.

/f -- Starts the client in full-screen mode.

/w:<width> -- specifies the width of the Remote Desktop screen.

/h:<height> -- Specifies the height of the Remote Desktop screen.

/edit -- Opens the specified .rdp file for editing.

/migrate -- migrates legacy connection files that were created with

Client Connection Manager to new .rdp connection files.

/? -- generates this Usage message.


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

The mstsc Remote Desktop client remembers its last position for me....

But you can force it in to full screen and then move it. This example assumes 1024x768 resolution on both monitors and that the secondary monitor is on the right side.... Adjust $x and $y as needed.

$server = "192.168.0.1"
$x = 1024
$y = 0

Run("mstsc /v:" & $server & " /fullscreen")
WinWait($server & " - Remote Desktop")
WinMove($server & " - Remote Desktop","", $x , $y)

Command line args:

I know all the switches, but Remote Desktop doesn't keep hist last window. At least not on the pc of the customer. On my pc wich is installed with Ultramon it does. So i think ultramon is messing up the test situation :(

But your code does the job :) I didnt start the Remote Desktop with forcing the the full screen.

Edited by Iznogoud

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0