Paul
The GetWindowPattern is not available for all windows.
You usually need a real window or the AppMainWindow.
Try adding that to the Window Handle:
hWnd = GetAppMainWindow(GetFocus())
Bob
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Paul Hunt
Sent: 09 December 2017 18:07
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Maximizing a window
Hello Bob. I'm also trying this script out. It doesn't seem to be working. I'm
not sure if I'm declaring and setting the OWND variable correctly.
Please check this out and let me know what you think.
Thanks so much.
Paul
Script MaximizeWindow ()
var object uia,
object oWnd,
handle HWnd
uia = CreateObjectEx ("FreedomSci.UIA", false, "UIAScriptAPI.x.manifest") hWnd
= GetFocus () oWnd = uia.getElementFromHandle(Hwnd)
oWnd.GetWindowPattern().SetWindowVisualState(WindowVisualState_Maximized)
EndScript
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Bob
Sent: Tuesday, December 5, 2017 3:34 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Maximizing a window
Steve
Maybe overkill but the UIA interface for maximising a window is pretty reliable:
UIA = CreateObject( etc etc see FSUIA documentation) hWnd = GetYourWindowHandle
oWnd = UIA.GetElementFromHandle(hWnd)
oWnd.GetWindowPattern().SetWindowVisualState(WindowVisualStateConstant)
You will have to look up the maximised window state constant in UIA.jsh because
I cant remember it off the top of my head.
Hope this helps.
Bob
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Steve Spamer
Sent: 03 December 2017 21:53
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Maximizing a window
Thanks anyway Jim. I've been tackling this today and I'm hoping I've got
success. Jaws seems to encounter an invalid window handle sometimes, so
dealing with that, along with the maximize window line I found on an old forum
post and what Csaba sent, is so far working...fingers crossed it works tomorrow
:). steve.
-----Original Message-----
From: Snowman
Sent: Sunday, December 3, 2017 8:59 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Maximizing a window
Steve,
I have seen taht too, and it might be a QT issue.
Just pressing the control key usually brings focus to the app. But, very
often, after alt tabbing to it, jaws can not pick up the focus.
I don't know of a nice solution.
So, I'm just speaking an error message if focus cant be acquired.
+--------------------------------------------------------------------------+
Listen to The Snowman on MushroomFM.com, Saturday evenings, 8PM Eastern time.
60's and 70's tunes, and gently conservative talk.
----- Original Message -----
From: "Steve Spamer" <stevespamer68@xxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Sunday, December 03, 2017 5:08 AM
Subject: [jawsscripts] Re: Maximizing a window
Jim, don't know if you've experienced SF12 being flakey on initial focus, but
in Samplitude, the auto start event doesn't always get full focus. They have a
key, control P to bring focus to the VIP, but just wondered if you had any tips
of getting the auto start event to be more robust? When pressing insert Q,
sometimes it reports as ", scripts are loaded etc", instead of the full script
name "Samplitude scripts V4.0 are loaded etc".
It's as if Jaws struggles to get that initial focus without having to press
this key. THX Steve.
-----Original Message-----
From: Snowman
Sent: Saturday, December 2, 2017 11:21 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Maximizing a window
That is why it is best to use the names instead of the numbers. But, to use
the names, you must include the proper .jsh file, and I don't know that name at
the moment.
But, using those names makes this read a little better, and there are some
other maintainability reasons to use those as well.
Steve, just compare these numbers with whatever these names you use are defined
to.
But, if these numbers are correct, or the names to which they are attached,
this should work.
+--------------------------------------------------------------------------+
Listen to The Snowman on MushroomFM.com, Saturday evenings, 8PM Eastern time.
60's and 70's tunes, and gently conservative talk.
----- Original Message -----
From: "Jeremy Richards" <jeremy.richards7@xxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Saturday, December 02, 2017 5:00 PM
Subject: [jawsscripts] Re: Maximizing a window
Hi,
What do these numbers represent: 274 and 61000.
(GetFocus()), 274, 61488, 0)
Thanks
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Csaba Godo
Sent: Saturday, December 2, 2017 2:51 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Maximizing a window
Hi Steve,
there is my working code to minimize/maximize windows in JAWS Script:
Script WindowMinimize ()
; Minimizes the window to the Taskbar
SendMessage(GetAppMainWindow(GetFocus()), 274, 61472, 0) EndScript ;
WindowMinimize
Script WindowMaximize ()
; Maximizes the window to the full screen.
SendMessage(GetAppMainWindow(GetFocus()), 274, 61488, 0) EndScript ;
WindowMaximize
HTH
Csaba
2017. 12. 02. 14:47 keltezéssel, Steve Spamer írta:
Hi folks. I currently have:__________
PostMessage (hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0) to maximize a
window, but it definitely isn’t working. Could anyone let me know
what I need to include in order to get a window maximized when opening
it? THX Steve.
Follow me on Twitter: @stevesax123
Visit the samplitude Access website. Jaws scripts for pro recording
with Samplitude in Windows: www.samplitudeaccess.org.uk __________
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts