Displaying four programs simultaneously

  • Thread starter Thread starter Max Spiller
  • Start date Start date
M

Max Spiller

I am finding that I can run four programs, one in each quarter of the
screen, quite successfully and usefully. (A 17" TFT monitor)

I would really like to have the machine boot-up with these four
programs all in position. So I have dragged shortcuts for each of them
into the Start Up program and, sure enough, they all boot up
beautifully.

But, they don't resume their positions on the screen, they are jumbled
and I have to reposition them on each boot.

Does anyone know if it is possible to 'fix' their positions on the
screen?

Grateful for any help,

Max
 
Max,

I believe the programs have to have that written in for them to be able to
remember their last screen position.
 
Oh, thanks Matt - that is, written in the source code I imagine,
nothing I can do about it then I guess?

Max
 
Yes... probably outside of your control to control these programs like
this unless they have some option to "remember" their last screen
position, *and* that last screen position was what you wanted.

You are 98% of the way there. Once all the programs have started,
simply right click on the Windows tool bar and "tile" them either
horizontally or vertically.

There may be a way to automate this last step (but I can't think how).
 
Create a text file called something.vbs. Create a shortcut to it and place the shortcut on the desktop or Start menu (only places windows looks for shortcuts with shortcut keys), right click it, Properties, and set it to a keystroke. This will do all open windows.

Paste this in

Set wshshell = CreateObject("Shell.Application")
wshshell.TileHorizontally

Choose one from below

CascadeWindows Cascadess all of the windows on the desktop.
EjectPC Ejects the computer from its docking station.
FileRun Displays the Run dialog to the user.
FindComputer Displays the Find: Computer dialog box.
FindFiles Displays the Find: All Files dialog box.
Help Displays Microsoft® Windows® Help.
MinimizeAll Minimizes all of the windows on the desktop.
RefreshMenu Refreshes the contents of the Start Menu.
SetTime Displays the Date/Time Properties dialog box.
ShutdownWindows Displays the Shut Down Windows dialog box.
Suspend Suspends the computer.
TileHorizontally Tiles all of the windows on the desktop horizontally.
TileVertically Tiles all of the windows on the desktop vertically.
TrayProperties Displays the Taskbar Properties dialog box.
UndoMinimize ALL Restores all of the windows on the desktop to the
same state they were in before the last MinimizeAll command.

To tile/cascade specific windows ctrl + click them on the taskbar, then right click one and choose cascade or tile.
 
David, really appreciate your help here....could you just hold my hand
a little...?

I have created the vbs file with this content:

Set wshshell = CreateObject("Shell.Application")
wshshell.TileHorizontally

and put a shortcut to it on the desktop.

Now, how do I set this to a keystroke? (Sorry).

So then (have I got this right?), after booting I execute this
keystroke and the programs will Tile Horizontally? (I assume they
won't resume their original positions in each quarter of the
screen...?)

Thanks for all the trouble you are taking here...

Max
 
Type this in help.
specify shortcut keys specific programs

It's a simple matter to set a windows size and position. You can program it in Word or Excel.

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Sub Main
hwindows = FindWindow(vbNullString, "Window Title of Program 1")
ret=SetWindowPos(hwindows, 0, x, y, cx, cy, 0)
hwindows = FindWindow(vbNullString, "Window Title of Program 2")
ret=SetWindowPos(hwindows, 0, x, y, cx, cy, 0)
hwindows = FindWindow(vbNullString, "Window Title of Program 3")
ret=SetWindowPos(hwindows, 0, x, y, cx, cy, 0)
hwindows = FindWindow(vbNullString, "Window Title of Program 4")
ret=SetWindowPos(hwindows, 0, x, y, cx, cy, 0)
End Sub

x, y is the upper left of the window on the desktop. cx, cy is the width/height.

I can compile this for you if you tell me what to fill in. The exact window title, the exact x, y, cx, and cy values for each program.
 
x, y is the upper left of the window on the desktop. cx, cy is the width/height.

I can compile this for you if you tell me what to fill in. The exact window title, the exact x, y, cx, and cy values for each program.

David, I have one program in each quadrant. The window titles are
easy, of course, but how do I find the cx & cy values for each
program? I am learning fast and trying to catch up...

Tks for the shortcut key link by the way...

Max
 
So something like

0, 0, 640, 512
0, 513, 640, 512
641, 0, 640, 512
641, 513, 640, 512

The full and exact window title is critical
 
I just ran some tests and that bloody taskbar .....

So therefore I had to make the program smart (means more work for me) so I can adjust for the taskbar and taskbar position.

Here's the code that does 4 explorer windows (My Comp, My Docs, Recycle Bin, and My Network Places). There's no error checking (it works or it doesn't). Paste into a word macro to test or play with (word will likely have it's own Sub <name>/End Sub already inserted).

Public Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetWindowPos Lib "User32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SPI_GETWORKAREA = 48
Private Declare Function SystemParametersInfo& Lib "User32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As _
Long, lpvParam As Any, ByVal fuWinIni As Long)

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Sub Main()
Dim DeskMetrics As RECT
Ret = SystemParametersInfo(SPI_GETWORKAREA, 0, DeskMetrics, 0)
WinHeight = (DeskMetrics.Bottom - DeskMetrics.Top) / 2
WinWidth = (DeskMetrics.Right - DeskMetrics.Left) / 2

hwindows = FindWindow(vbNullString, "My Computer")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left, DeskMetrics.Top, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "My Documents")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left + WinWidth + 1, DeskMetrics.Top, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "Recycle Bin")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left, DeskMetrics.Top + WinHeight + 1, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "My Network Places")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left + WinWidth + 1, DeskMetrics.Top + WinHeight + 1, WinWidth, WinHeight, 0)
End Sub



Because you have to give it time for the windows to get formed
1/ the program can start then wait for the window.
2/ You can click manually after the windows have had time to form.

--
----------------------------------------------------------
http://www.g2mil.com/Dec2003.htm
So something like

0, 0, 640, 512
0, 513, 640, 512
641, 0, 640, 512
641, 513, 640, 512

The full and exact window title is critical
 
Till I get the windows names I can't actually do anything for real.

--
----------------------------------------------------------
http://www.g2mil.com/Dec2003.htm
I just ran some tests and that bloody taskbar .....

So therefore I had to make the program smart (means more work for me) so I can adjust for the taskbar and taskbar position.

Here's the code that does 4 explorer windows (My Comp, My Docs, Recycle Bin, and My Network Places). There's no error checking (it works or it doesn't). Paste into a word macro to test or play with (word will likely have it's own Sub <name>/End Sub already inserted).

Public Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetWindowPos Lib "User32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SPI_GETWORKAREA = 48
Private Declare Function SystemParametersInfo& Lib "User32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As _
Long, lpvParam As Any, ByVal fuWinIni As Long)

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Sub Main()
Dim DeskMetrics As RECT
Ret = SystemParametersInfo(SPI_GETWORKAREA, 0, DeskMetrics, 0)
WinHeight = (DeskMetrics.Bottom - DeskMetrics.Top) / 2
WinWidth = (DeskMetrics.Right - DeskMetrics.Left) / 2

hwindows = FindWindow(vbNullString, "My Computer")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left, DeskMetrics.Top, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "My Documents")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left + WinWidth + 1, DeskMetrics.Top, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "Recycle Bin")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left, DeskMetrics.Top + WinHeight + 1, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "My Network Places")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left + WinWidth + 1, DeskMetrics.Top + WinHeight + 1, WinWidth, WinHeight, 0)
End Sub



Because you have to give it time for the windows to get formed
1/ the program can start then wait for the window.
2/ You can click manually after the windows have had time to form.

--
----------------------------------------------------------
http://www.g2mil.com/Dec2003.htm
So something like

0, 0, 640, 512
0, 513, 640, 512
641, 0, 640, 512
641, 513, 640, 512

The full and exact window title is critical
 
Till I get the windows names I can't actually do anything for real.

Oh David, this is so much work for you...(sorry for the delay
replying, getting caught up in the festivities....). Please, only if
this interests you...

The four windows I am running (largely as a test but I can easily, I
think, substitute others, are:

Top left: Agent - [Microsoft.public.windowsxp.help_and_support]

Bottom left: Inbox - Outlook Express (this always positions itself
correctly)

Top right: ABC News - ABC Online - Microsoft Internet Explorer

Bottom right: 128km Grafton radar loop - Microsoft Internet Explorer

Max
 
Back
Top