Small Basic Forum
Use second screen by small basic - Printable Version

+- Small Basic Forum (https://litdev.uk/mybb)
+-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1)
+--- Forum: Extensions (https://litdev.uk/mybb/forumdisplay.php?fid=3)
+--- Thread: Use second screen by small basic (/showthread.php?tid=611)



Use second screen by small basic - martmen - 09-04-2026

Hello LitDev,

I am using a dual-monitor setup on my computer. My Small Basic program starts on the primary screen. I use
LDWindows.Create() to open an additional window, but I want to move this second window to the secondary screen.
Is it possible to achieve this with your current extension, or could you provide a new LDWindows command that enables this functionality?

Thank you very much,
Martin





RE: Use second screen by small basic - litdev - 09-05-2026

Hi, I will look into this Smile


RE: Use second screen by small basic - litdev - 09-05-2026

Hi,

Success I hope - please download latest beta version, perhaps with extension manager - version 1.2.30.11

I nearly forgot the steps to update everything for a new beta release, its been so long - I hope I remembered them all Wink

I added 2 new methods in LDUtilities - GetScreens and MoveGraphicsWindow

My test code

Code:
'Create 2 GW
GraphicsWindow.Show()
GraphicsWindow.Title = "Main"
id = LDWindows.Create()
GraphicsWindow.Title = id

'Get screens available
screens = LDUtilities.GetScreens()
numScreen = Array.GetItemCount(screens)

'Output screen details
For i = 1 To numScreen
  indices = Array.GetAllIndices(screens[i])
  For j = 1 To Array.GetItemCount(indices)
    TextWindow.WriteLine(indices[j] + " = " + screens[i][indices[j]])
  EndFor
  TextWindow.WriteLine("")
EndFor

'Move the 2nd (current) GW between screens
For i = 1 To numScreen
  LDUtilities.MoveGraphicsWindow(screens[i]["Name"], 500, 0, "False")
  Program.Delay(5000)
EndFor

'Then full screen
For i = 1 To numScreen
  LDUtilities.MoveGraphicsWindow(screens[i]["Name"], 500, 0, "True")
  Program.Delay(5000)
EndFor