[jawsscripts] Re: maximize window

  • From: Udo Egner-Walter <udo.egner-walter@xxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Wed, 25 Nov 2020 16:18:26 +0100

Hi Bryan 

additionally to Arthur's mail here are two more possibilities: 

First by sending key strokes: 

Void Function AutoStartEvent ()
TypeKey ("Windows+UpArrow")
EndFunction

A big advantage of this short line is that MS Windows checks if a windows can 
be maximized. In other code examples you have to determine this yourself to 
avoid maximizing a window like a dialog window. 

Second example with UIA: 

Void Function AutoStartEvent ()
var
object oUIA = CreateObjectEx ("FreedomSci.UIA", 0, "UIAScriptAPI.x.manifest"),
object oAppElement = oUIA.GetElementFromHandle 
(GetAppMainWindow(GetFocus())).GetWindowPattern ()
; check if we got the app element 
; and if the window can be maximized 
If oAppElement && oAppElement.CanMaximize then
            If oAppElement.SetWindowVisualState (WindowVisualState_Maximized) 
then
            SayString ("maximized")
            else
            SayString ("Can't maximize")
            EndIf
EndIf ; If oAppElement then
EndFunction

This function checks also if the window can be maximized. 

Hope this helps 
Udo 


Am 25.11.2020 um 05:52 schrieb Bryan Schulz (Redacted sender "b.schulz" for 
DMARC) <dmarc-noreply@xxxxxxxxxxxxx>:

Hi,


I didn't find any function for key presses such as right windows or up
arrow.

Would someone have a sample of how to guarantee your window is maximized?

Bryan





__________�

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: