Jump to content

Recommended Posts

Posted

Strange problem, if I open a program with say Run("c:\dir1\dir2\program.exe"), and then use WinSetState("WindowTitle" , @SW_MINIMIZE), the window will not minimize. But, if I open notepad with Run("notepad.exe"), and then use WinSetState("untitled" , @SW_MINIMIZE), Notepad will immediately minimize. ???

I'm using 32-bit Windows 7. Any ideas?

  • Moderators
Posted

carlc,

I doubt using WinSetState("untitled" , @SW_MINIMIZE) will "immediately minimize" Notepad as the syntax is wrong. :oops:

ByCode122 showed you the correct version of the call - you need the "text" parameter even if you only set it to a blank string (""). :bye:

M23

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

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted (edited)

Sorry, typo on my part. I didn't have my code to look at when I posted (and I just started using AutoIT). I did have the syntax correct in my script, and as I said, notepad would minimize for me using the code, but if I called a program by having to put in the path, it won't minimize. ???

Edited by carlc
  • Moderators
Posted

carlc,

Some apps do not automate easily, if at all. What is this app you are trying to minimize? :oops:

M23

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

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

The program that I am trying to minimize is OpenOffice Impress. I've also tried minimizing MS Word, MS PowerPoint, and MS Excel, none of which will minimize for me.

  • Moderators
Posted

carlc,

This works for me with MS Word: :oops:

Run("C:Program FilesMicrosoft OfficeOfficeWINWORD.EXE")

WinWaitActive("Document1 - Microsoft Word")

WinSetState("Document1 - Microsoft Word", "", @SW_MINIMIZE)

Did you use the WinWaitActive line to give the window a chance to open first? :bye:

M23

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

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

I often make the same mistake Melba - should really have a check to ensure the window exists the set state function - a subtle prob for noobies that gets them pulling their hair out! :oops:

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...