Keylonta

Restore Down

11 posts in this topic

#1 ·  Posted (edited)

Hi!

Is there a script for restoring a window down (Restore down)?

It's to use with a program called Intelliremote which uses AutoItX v3 scripts.

Edited by Keylonta

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@Keylonta  The help file is your friend. Look at WinSetState, specifically the Restore option.

I've also moved this to the appropriate forum, as the question has nothing to do with AutoItX. Please be mindful of where you post in the future :)

 

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Thanks for your reply.

The Intelliremote user guide says "By default Intelliremote supports the 90+ AutoItX commands found in the AutoItX help file." But the help file is a AutoItX3 help file. What is the appropriate forum to post in?

 

When I tested the following 3 commands it says there is a problem with the command WINSETSATE: 'SW.RESTORE" is not a valid integer value.

WinSetState ("Untitled - Notepad", "", "SW_RESTORE")

WinSetState ("Untitled - Notepad", "", "{SW_RESTORE}")

WinSetState ("Untitled - Notepad", "", SW_RESTORE)

I have to put the " " around SW_RESTORE otherwise it doesn't turn blue. Any idea why it's not working?

 

Here are some examples of how other commands have to be to work with Intelliremote.

WinSetTitle ("Untitled - Notepad", "", "New Title")

Send ("{LEFT}",0)

MouseClick ("left" INTDEFAULT, INTDEFAULT, 1, 0)

MouseMove (1919, 0, 0)

 

This is what the help file says:

1.JPG

Share this post


Link to post
Share on other sites
WinSetState ("Untitled - Notepad", "", "@SW_HIDE")
WinSetState ("Untitled - Notepad", "", "@SW_SHOW")

 

Share this post


Link to post
Share on other sites

It says @SW_RESTORE is not a valid integer value.

Share this post


Link to post
Share on other sites

I think this example is  incorrect.
This is not tested, as I remember I never use AutoItX, but try this:

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")

oAutoIt.WinSetState "Untitled -", "", "SW_HIDE"
oAutoIt.Sleep 3000
oAutoIt.WinSetState "Untitled -", "", "SW_SHOW"

btw.
Why you are using AutoItX and at the same time you are posting example for standard version ?

4 hours ago, Keylonta said:

WinSetState ("Untitled - Notepad", "", "SW_RESTORE")

WinSetState ("Untitled - Notepad", "", "{SW_RESTORE}")

WinSetState ("Untitled - Notepad", "", SW_RESTORE)

 

4 hours ago, Keylonta said:

WinSetTitle ("Untitled - Notepad", "", "New Title")

Send ("{LEFT}",0)

MouseClick ("left" INTDEFAULT, INTDEFAULT, 1, 0)

MouseMove (1919, 0, 0)

 


Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

It appears Intelliremote  can use AutoItX or compiled AutoIt scripts. See https://www.autoitscript.com/forum/topic/66945-execute-au3-scripts-via-autoitx/#comment-508043
Also see https://www.autoitscript.com/forum/topic/55863-intelliremote-and-autoitx/#comment-423719
and, https://www.autoitscript.com/forum/topic/54219-delphi-wrapper-advanced/#comment-498528

Because @SW_HIDE and @SW_SHOW  are AutoIt3 language macros that result in 0 and 5, and if WinSetState has been tailored to work in Intelliremote, then try this script in Intelliremote.

Run("notepad.exe", "")
WinWaitActive("Untitled - Notepad", "", 0)
WinSetState("Untitled - Notepad", "", 0) ;  @SW_HIDE
Sleep(3000)
WinSetState("Untitled - Notepad", "", 5) ; @SW_SHOW

 

Share this post


Link to post
Share on other sites

Thanks for the feedback everyone.

I don’t know anything about AutoIt, just starting out because of Intelliremote.

What is the difference between AutoItX and AutoIt?

On 11/4/2017 at 6:33 PM, mLipok said:

btw.
Why you are using AutoItX and at the same time you are posting example for standard version ?

I couldn’t get the AutoItX WinSetState scripts in the help file to work, so I tried modifying them to look like the script examples given in the Intelliremote user guide. Where can I find the help file for the standard version? That should have the correct WinSetState scripts that work with Intelliremote.

On 11/4/2017 at 11:55 PM, Malkey said:

Because @SW_HIDE and @SW_SHOW  are AutoIt3 language macros that result in 0 and 5, and if WinSetState has been tailored to work in Intelliremote, then try this script in Intelliremote.

I figured it out. Restore down looks like this:

WinSetState ("Untitled - Notepad", "", 1)

0 = Closes program

1 = Restores down

2 = Minimizes

3 = Maximizes

I figured it out. Restore down looks like this:

WinSetState ("Untitled - Notepad", "", 1)

0 = Closes program

1 = Restores down

2 = Minimizes

3 = Maximizes

I figured it out. Restore down looks like this:

WinSetState ("Untitled - Notepad", "", 1)

0 = Closes program

1 = Restores down

2 = Minimizes

3 = Maximizes

I figured it out. Restore down looks like this:fkkkkhhhhhhhhhhhgggg

 

 

WinSetState ("Untitled - Notepad", "", 1)

0 = Closes program

1 = Restores down

2 = Minimizes

3 = Maximize

Share this post


Link to post
Share on other sites

This is copied from the introduction of the AutoIt 'X' help file:-
"AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI. ....

AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your favourite scripting and programming languages, e.g. VB, VBScript, Delphi, C, C++, Kixtart, and most other languages that support the use of DLLs."

The AutoIt help file is found in the AutoIt install directory with the .chm file extension.  Or, while using SciTE, pressing F1 key on the text of a .au3 file will activate the AutoIt help file.

The following example is a workable .au3 file. Using the text editor SciTE, this .au3 file can be run within SciTE, or, compiled to run as an independent executable file.
(Note the returned values of the AutoIt macros in the message box :-
@SW_RESTORE returns 9,
@SW_MINIMIZE returns 6, and,
@SW_MAXIMIZE returns 3.)

MsgBox(0, "Some Macros", _
        "@SW_RESTORE returns   " & @SW_RESTORE & @CRLF & _  ; Returns 9
        "@SW_MINIMIZEE returns " & @SW_MINIMIZE & @CRLF & _ ; Returns 6
        "@SW_MAXIMIZE returns  " & @SW_MAXIMIZE & @CRLF)    ; Returns 3

 

Share this post


Link to post
Share on other sites

#10 ·  Posted

On 11/9/2017 at 11:02 PM, Malkey said:

The following example is a workable .au3 file. Using the text editor SciTE, this .au3 file can be run within SciTE, or, compiled to run as an independent executable file.

They don't work with Intelliremote.

What version help file has the following script?

WinSetState ("Untitled - Notepad", "", 1)

That's the one I need.

 

Share this post


Link to post
Share on other sites

#11 ·  Posted

The help file is in the "AutoIt Full Installation".   Download from here .
The "AutoIt Script Editor" (SciTE) I mentioned in my other post is also downloadable at the above link.

The current AutoIt help file is also online, where  the WinSetState() function can be viewed.

In your post #3, the image of the AutoItX WinSetState function help page has an example.  I got that example to work by saving that example as a .vbs file and running it as a VB script.

When you install the "AutoIt Full Installation" the AutoItX help file is found in the AutoItX subdirectory.
The AutoIt3 help file is found in the main AutoIt3 installation directory, and as mention in my post #9.  The example in post #9 is an  AutoIt3 (.au3) script, which can be run from SciTE, or, compile and run as a .exe file.

Share this post


Link to post
Share on other sites

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