Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
merloofy
10 discussion posts
Hello everyone :)
I would need some help. I'm trying to obtain after startup DisplayFusion, to make
function to open two tabs of google chrome in one monitor, but in diffrent location on display. I was trying to make something like that:

Code

using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
// Set the websites for monitor 1 here
string[] websitesMonitor1 = {
"https://google.com",
};
// Launch and move the browser windows
LaunchAndMoveBrowser(0, websitesMonitor1);
}
private static void LaunchAndMoveBrowser(uint monitorID, string[] websites)
{
// Build the command-line arguments
string args = string.Join(" ", websites, 0, websites.Length);
args += " --new-window";
// Launch the browser
uint appID= BFS.Application.Start(@"C:\Program Files\Google\Chrome\Application\chrome.exe", args);
BFS.General.ThreadWait(2000);
IntPtr wh=BFS.Application.GetMainWindowByAppID(appID);
// Move the window
//BFS.Window.MoveToMonitorMaximized(monitorID, BFS.Window.GetFocusedWindow());
BFS.Window.MoveToMonitor(monitorID, wh);
BFS.Window.SetSizeAndLocation(wh, -1431, 707, 1431, 1291);
}
}

and it works, but I haven't got idea, how it should be make with second tab. When I made second fuction and second trigger, DisplayFusion disorganizing all ealier triggers and scatter all programs in bad position. In my opinion my way to win this fight is to contain both fuction of open the tabs in one code, with exact place of opening, but I haven't got idea how to make it :)
Can you please help me :) ?
Feb 5, 2022 (modified Feb 5, 2022)  • #1
User Image
merloofy
10 discussion posts
up
Feb 9, 2022  • #2
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Are you wanting to open two separate Chrome windows side by side? Or two tabs in the same Chrome window?
Feb 9, 2022  • #3
User Image
merloofy
10 discussion posts
I want to open two sperate windows of chrome in two diffrent location on one monitor.
Open like this:
• Attachment: Capture.JPG [380,092 bytes]
Capture.JPG
Capture.JPG
Feb 9, 2022 (modified Feb 9, 2022)  • #4
Keith Lammers (BFS)'s profile on WallpaperFusion.com
What's the monitor ID (e.g. 2) of that monitor?
Feb 10, 2022  • #5
User Image
merloofy
10 discussion posts
Number 1 :)
Feb 10, 2022  • #6
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Sorry, one more question. Is Chrome set as your default browser?
Feb 15, 2022  • #7
User Image
merloofy
10 discussion posts
Yes exactly :)
Feb 15, 2022  • #8
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, I've attached a script for you that should do what you're looking for :)
• Attachment: Open Chrome Top and Bottom on Monitor 1.dfscript [1,118 bytes]
Feb 15, 2022  • #9
User Image
merloofy
10 discussion posts
Thank you so much, it works :)

I have a question, do you think it will difficult to open 3rd tab on monitorID 2?
Feb 16, 2022  • #10
Keith Lammers (BFS)'s profile on WallpaperFusion.com
No that would be pretty easy to add. You want it to open maximized on monitor 2?
Feb 17, 2022  • #11
User Image
merloofy
10 discussion posts
Yees, exactly :)
Feb 17, 2022  • #12
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ok, here you go!
• Attachment: Open Chrome Top and Bottom on Monitor 1.dfscript [1,379 bytes]
Feb 24, 2022  • #13
User Image
merloofy
10 discussion posts
Thank you so much :) !
Feb 28, 2022  • #14
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)