Jump to content

Resizing a window to 'fill any display size' without using 'full-screen' mode? (Windows)


This topic is 2826 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Does anyone have a script for resizing a window so it (fills any size display) on Windows 7 and 8?

 

I am aware of the maximize script option but I am trying to avoid using it so I can open multiple windows without them getting all messed up.

Link to comment
Share on other sites

if i remember correctly resize to Get ( WindowContentHeight ) - 1 and Get ( WindowContentWidth ) - 1

 

if you make this part of the on last window close script when the file is open locally it will be "sticky" and the new settings will become the default.

Link to comment
Share on other sites

So it seems like I need to grab the WindowDesktop dimensions and then figure out the dimensions of the other Windows interface elements (scroll bars, dock, etc.). Then subtract these from the Desktop dimensions to determine the exact Window size? And then do this for all of the necessary versions of Windows. My goodness!!!

 

I am not too familiar with the Windows OS but can't the user change the dimensions of the interface elements by changing the theme of the Windows OS?

Link to comment
Share on other sites

I use this script to open layouts in windows (called OpenLayout):

Set Variable [ $Parameter; Value:Get ( ScriptParameter ) ]
Set Variable [ $LayoutName ; Value:If ( PatternCount ( $Parameter; ";" ) ;
                                        Left ( $Parameter; Position ( $Parameter; ";"; 1; 1 ) -1 );
                                        $Parameter ) ]
If [ IsEmpty ( $LayoutName ) ]
     Show Custom Dialog [ Title: "No Layout Name Specified"; 
          Message: "Calling Script Error: no layout name specified."; 
          Default Button: “OK”, Commit: “Yes” ]
     Exit Script [  ]
End If
If [ WindowExists ( $LayoutName ) ]
     Select Window [ Name: $LayoutName; Current file ]
     Exit Script [  ]
End If
Set Variable [ $Dialog; Value:If ( PatternCount ( $Parameter; ";Dialog" ); 1; 0 ) ]
Set Variable [ $DocWindow; Value:If ( PatternCount ( $Parameter; ";DocWindow" ); 1; 0 ) ]
If [ $Dialog or $DocWindow ]
     Set Variable [ $WindowHeight; Value:Let ( [
         PosH = Position ( $Parameter;  ";h="; 1; 1 ) + 3;
         PosHEnd = Position ( $Parameter;  ";"; PosH; 1 );
         Chars =  If ( PosHEnd = 0; Length ( $Parameter ) + 1; PosHEnd ) - PosH ] ;
                       Middle ( $Parameter; PosH; Chars )
         ) ]
     Set Variable [ $WindowWidth; Value:Let ( [
         PosH = Position ( $Parameter;  ";w="; 1; 1 ) + 3;
         PosHEnd = Position ( $Parameter;  ";"; PosH; 1 );
         Chars =  If ( PosHEnd = 0; Length ( $Parameter ) + 1; PosHEnd ) - PosH ] ;
                       Middle ( $Parameter; PosH; Chars )
         ) ]
Set Variable [ $WindowTop; Value:( Get ( WindowDesktopHeight )-$WindowHeight - 8 )/2 ]
Set Variable [ $WindowLeft ; Value:( Get ( WindowDesktopWidth )-10-$WindowWidth )/2 ]
If [ $Dialog ]
   New Window [ Name: $LayoutName; 
                Height: $WindowHeight; 
                Width: $WindowWidth; 
                Top: $WindowTop; 
                Left: $WindowLeft; 
                Style: Dialog ; 
                Close: “No”; Minimize: “No”; 
                Maximize: “No”; 
                Zoom Control Area: “No”; 
                Resize: “No” ]
End If
If [ $DocWindow ]
     New Window [ Name: $LayoutName; 
                  Height: $WindowHeight; 
                  Width: $WindowWidth; 
                  Top: $WindowTop; 
                  Left: $WindowLeft; 
                  Style: Floating Document ; 
                  Close: “Yes” ; 
                  Minimize: “No”; 
                  Maximize: “No”; 
                  Zoom Control Area: “No”;
                  Resize: “No” ]
End If
Else
   Set Variable [ $WindowWidth; Value:Get (WindowDesktopWidth)-10 ]
   Set Variable [ $WindowHeight; Value:Get(WindowDesktopHeight)-8 ]
   New Window [ Name: $LayoutName; 
                Height: $WindowHeight; 
                Width: $WindowWidth; 
                Top: 1; 
                Left: 5; 
                Style: Document ; 
                Close: “Yes” ; 
                Minimize: “Yes” ; 
                Maximize: “Yes” ; 
                Zoom Control Area: “Yes” ; 
                Resize: “Yes” ]
End If
Go to Layout [ $LayoutName ]
Show/Hide Toolbars [ Lock; Hide ]
Show/Hide Text Ruler [ Hide ]
If [ Get ( LayoutName ) ≠ $LayoutName ]
   Close Window [ Current Window ]
End If

I invoke the script with at least the name of the layout I want to open, and optionally specify "DocWindow", or "Dialog". I can also specify the height and width if I want "h=500;w=1000".

If I specify every option the syntax looks as follows: "LayoutName;Dialog;h=500;w=1000".

I could have used a List () instead to specify the various parameters.

Link to comment
Share on other sites

This topic is 2826 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.