How to keep progs from opening snapped to top of screen

  • Thread starter Thread starter BP
  • Start date Start date
B

BP

I have my taskbar on the top of my screen. Most programs "snap" to the
bottom of the taskbar when they open. But some programs expect it to be at
the bottom and when you open them they snap to the top of the screen which
leaves their task bar and sometimes their menu bar under the Windows
taskbar. Some programs can be moved by right clicking their task button and
selecting "move" but I have a couple that do not have that option.
Anyone know of a fix to get these progs to open snapped to the task bar or
just further down on the screen?
 
Nope. The programs have a logic error. Well known bug in lots of programs. I can write small programs to resize or move a window but I need to know the Titlebar text.
 
Aside from David's suggestion, if you right click the taskbar > Properties,
uncheck to "Keep the Taskbar on top of other windows"
 
Thanks. Just tried that. Now the other progs open and cover the taskbar. Not
quite the solution I'd hoped for. I guess I'll just keep dragging the
taskbar out of the way the few times a week I use the offending progs.
Thanks anyway.
 
Well, at least I can stop chasing my tail.
Are you writing batch files?

"David Candy" <.> wrote in message
Nope. The programs have a logic error. Well known bug in lots of programs. I
can write small programs to resize or move a window but I need to know the
Titlebar text.
 
No. It will be a variation of this (which tiles 4 specific windows (correctly))

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

Public Const SWP_DRAWFRAME = SWP_FRAMECHANGED
Public Const SWP_FRAMECHANGED = &H20 ' The frame changed: send WM_NCCALCSIZE
Public Const SWP_HIDEWINDOW = &H80
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_NOCOPYBITS = &H100
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOOWNERZORDER = &H200 ' Don't do owner Z ordering
Public Const SWP_NOREDRAW = &H8
Public Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOZORDER = &H4
Public Const SWP_SHOWWINDOW = &H40


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, "System Configuration Utility")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left, DeskMetrics.Top, DeskMetrics.Right, DeskMetrics.Bottom, 0)
hwindows = FindWindow(vbNullString, "ABC News - ABC Online - Microsoft Internet Explorer")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left + WinWidth + 1, DeskMetrics.Top, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "Inbox - Outlook Express")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left, DeskMetrics.Top + WinHeight + 1, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "128km Grafton Radar Loop - Microsoft Internet Explorer")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left + WinWidth + 1, DeskMetrics.Top + WinHeight + 1, WinWidth, WinHeight, 0)
End Sub
 
Ahhh... Yahh. *That* looks easier than dragging the taskbar!
Probably over my head. But... out of curiousity,
What type of file is this?
What do you name it?
Where does it get saved to?
(Or is it an edited/replacement of an existing file?)

"David Candy" <.> wrote in message
No. It will be a variation of this (which tiles 4 specific windows
(correctly))

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

Public Const SWP_DRAWFRAME = SWP_FRAMECHANGED
Public Const SWP_FRAMECHANGED = &H20 ' The frame changed: send
WM_NCCALCSIZE
Public Const SWP_HIDEWINDOW = &H80
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_NOCOPYBITS = &H100
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOOWNERZORDER = &H200 ' Don't do owner Z ordering
Public Const SWP_NOREDRAW = &H8
Public Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOZORDER = &H4
Public Const SWP_SHOWWINDOW = &H40


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, "System Configuration Utility")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left, DeskMetrics.Top,
DeskMetrics.Right, DeskMetrics.Bottom, 0)
hwindows = FindWindow(vbNullString, "ABC News - ABC Online - Microsoft
Internet Explorer")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left + WinWidth + 1,
DeskMetrics.Top, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "Inbox - Outlook Express")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left, DeskMetrics.Top +
WinHeight + 1, WinWidth, WinHeight, 0)
hwindows = FindWindow(vbNullString, "128km Grafton Radar Loop - Microsoft
Internet Explorer")
Ret = SetWindowPos(hwindows, 0, DeskMetrics.Left + WinWidth + 1,
DeskMetrics.Top + WinHeight + 1, WinWidth, WinHeight, 0)
End Sub
 
Back
Top