Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - CTP 2 Making the GWPS size and position persist

Reply
 
Old 06-18-2008   #1 (permalink)
Robert Aldwinckle


 
 

CTP 2 Making the GWPS size and position persist

I have an oversized Taskbar which always overlays the bottom
of the CTP 2 GWPS window. I found I can resize the input
frame and make it persist but I would prefer to fix the problem
by resizing and repositioning the window and making those
changes persist.

Has anybody done this or know how to do it?

I suppose one workaround would be to maintain a startup
script which resized or repositioned the window when it is
opened. I would have to research that possibility too. ; )

Thanks for any ideas.


TIA

Robert Aldwinckle
---



My System SpecsSystem Spec
Old 06-19-2008   #2 (permalink)
Jon


 
 

Re: CTP 2 Making the GWPS size and position persist

"Robert Aldwinckle" <robald@xxxxxx> wrote in message
news:C3579E62-DB5C-4FA7-86AB-F82163756FD7@xxxxxx
Quote:

>I have an oversized Taskbar which always overlays the bottom
> of the CTP 2 GWPS window. I found I can resize the input
> frame and make it persist but I would prefer to fix the problem
> by resizing and repositioning the window and making those
> changes persist.
>
> Has anybody done this or know how to do it?
>
> I suppose one workaround would be to maintain a startup
> script which resized or repositioned the window when it is
> opened. I would have to research that possibility too. ; )
>
> Thanks for any ideas.



I would suspect (hope) that they'll implement such an option at some stage,
but with regard to your workaround suggestion you could do something like
this, which calls the Windows api function SetWindowPos ....


#Size and position window
#-----------------------------
$PositionWindow = Add-Type –memberDefinition @'

<DllImport("user32.dll")> _
Public Shared Function SetWindowPos( _
ByVal hWnd As IntPtr, _
ByVal hWndInsertAfter As IntPtr, _
ByVal x As Integer, ByVal y As Integer, _
ByVal cx As Integer, _
ByVal cy As Integer, ByVal flags As Integer) As Boolean
End Function

'@ -name “Win32SetWindowPos” -namespace Win32Functions –passThru -Language
VisualBasic

$SWP_SHOWWINDOW = 0x40
$HWND_TOP = 0
$PositionLeft,$PositionTop,$Width,$Height = 0,0,500,300
$PositionWindow[-1]::SetWindowPos((Get-Process –id $pid).MainWindowHandle,
$HWND_TOP,$PositionLeft,$PositionTop,$Width,$Height,$SWP_SHOWWINDOW) |
Out-Null


#-----------------------------



You could add it to your GWPS profile (create if needs be) located at
$profile ie

$env:userprofile\Documents\WindowsPowerShell\Microsoft.GPowerShell_profile.ps1


--
Jon



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Windows Explorer Size and Position Vista General
Window Size and Position Vista General
window position, size and views Vista General
How to keep windows size and position? Vista performance & maintenance
Desktop icons keep neither their size nor position Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46