Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
lithoman
3 discussion posts
I'm trying to set up a multiple window layout, and am not able to move/resize VS Code. It opens in last closed position and won't move or resize:

Code

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        var appId = BFS.Application.Start("C:\\Users\\chemming\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe","");
        // BFS.General.ThreadWait(3000); // maybe needs to settle?
        var windowId = BFS.Application.GetMainWindowByAppID(appId);
        // BFS.General.ThreadWait(3000); // maybe needs to settle?
        BFS.Window.SetSizeAndLocation(windowId, 0,30,2600, 900);
    }
}


Also Cmd console windows won't change width, but am I correct in understanding this is still a known issue?
Sep 11, 2022  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
I tested out VS code on my end and it seemed to work fine. If you use one of our move/resize functions directly on that window, rather then through a script, does it work?

You are correct about the command prompt window yep! I've added your vote to it, so we'll be sure to let you know if we have any news on it going forward.

Thanks!
Sep 12, 2022  • #2
User Image
lithoman
3 discussion posts
Interesting Yes, a trigger to move/resize window on VS Code launch does work.
After further testing, I believe it's may be due to a Visual Studio launcher. This seems to work consistently, but the appId from Start() is often different from the appId from GetAppIDByFile():

Code

public static void Run(IntPtr windowHandle)
{
var filename = "C:\\Users\\chemming\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe";
var appId = BFS.Application.Start(filename);
var appId2 = BFS.Application.GetAppIDByFile(filename);
var windowId = BFS.Application.GetMainWindowByAppID(appId2);
BFS.General.LogText("CDH-VS: "+appId.ToString()+" "+appId2.ToString());
BFS.Window.SetSizeAndLocation(windowId, 0, 0, 1200, 1200);
}
Sep 13, 2022 (modified Sep 13, 2022)  • #3
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
I tested that code out without the launcher and it worked fine. Are you using this extenstion for the launcher? https://marketplace.visualstudio.com/items?itemName=spmeesseman.vscode-vslauncher
Sep 15, 2022  • #4
User Image
lithoman
3 discussion posts
No, just using Code.exe directly
Sep 15, 2022  • #5
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)