Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Uriah
28 discussion posts
Is it possible to create a function that can open multiple applications from a single keystroke combination without getting into the custom scripting? I'd be cool if I could create something that allows me to launch all of my work applications and re-size and position the windows onto my two monitors how I like them...
Jan 18, 2016  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
The only way to do this at the moment would be with a custom script, but it's pretty basic. Would you like a sample script?
Jan 18, 2016  • #2
User Image
Uriah
28 discussion posts
Yes, please! I'm a senior server-side programmer by trade, but have no experience in C# or VB. However, if I'm given a working example of what I need, I'd figure it out right quick. It'd be great to have an example of not only opening multiple applications but also in sizing and positioning the windows once opened (if possible). I'm on a dual monitor setup, just FYI (in case that matters). Thanks!

P.S. It'd be great if this functionality was baked into DF. :)
Jan 20, 2016 (modified Jan 20, 2016)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, will do! Do you need to position the windows to specific X,Y co-ordinates, or just maximized on specific monitors?
Jan 21, 2016  • #4
User Image
Alfonso4
2 discussion posts
I´d need that script too.

the idea is to open 6 IE and locate them in the same screen at an specific coordinates.

Is it possible to have an script for that or an example one which I could change to my needs?

Thank you
Jul 20, 2016  • #5
User Image
NetMage
283 discussion posts
Here is a custom function to Start Websites in Multiple Locations. I also submitted it for sharing.

Code

using System;
using System.Drawing;
using System.Collections.Generic;

// Description: This function starts all of Binary Fortress' web pages in different positions with the default web browser.
// Based on the Start Multiple Websites on Different Monitors function Created By: Thomas Malloch (BFS)

class Rectangles : List<Rectangle> { // helper for List<Rectangle> initialization
    public void Add(int x, int y, int w, int h) {
        Add(new Rectangle(x, y, w, h));
    }
}

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Window Location target when run by a Window Location rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction {
public static void Run(IntPtr windowHandle) {
//make an array of websites you would like to have opened
string[] websites = {
"http://www.binaryfortress.com/",
"http://www.displayfusion.com/",
"http://www.checkcentral.cc/",
"http://www.clipboardfusion.com/",
"http://www.fileseek.ca/",
"http://www.itunesfusion.com/",
"http://www.logfusion.ca/",
"http://www.wallpaperfusion.com/"
};
// make an array of window positions for the websites
Rectangle[] positions = new Rectangles {
            { 50, 50, 500, 500 },
            { 550, 50, 500, 500 },
            { 50, 550, 500, 500 },
            { 550, 550, 500, 500 },
            { 550, 1050, 500, 500 },
            { 50, 1050, 500, 500 },
            { 1050, 550, 500, 500 },
            { 1050, 50, 500, 500 }
}.ToArray();

for (int w = 0; w < websites.Length; ++w) {
var window = BFS.Web.OpenUrlNewWindow(websites[w]);

//if we failed to get the handle, continue to next loop iteration
if(window == IntPtr.Zero)
continue;

//move the window to the specified location
var p = positions[w];
            BFS.Window.SetSizeAndLocation(window, p.X, p.Y, p.Width, p.Height); // shouldn't this take a Rectangle???
}
}
}
Jul 20, 2016 (modified Jul 20, 2016)  • #6
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)