Jump to content

WinSetState ... and can not minimize any longer !!!


Recommended Posts

Hello to all everyone,

I'm very new, first post, no knowledge of AutoIt whatsoever and would really appreciate some help, I have a CCTV software which I need to have maximized at all times, all I'm trying to do is to check if the program is running or not and if it is then maximize it, I'm reading a lot and trying to copy and paste different codes from here and there.

First step, I have my program minimized (does not show on the taskbar, it just shows it's little icon near the clock in the system tray) I can double click it and minimize it no problems.

I finely found this line which works perfectly, when I run it, it will maximize the application just fine, however, now I can not minimize it any longer, it just can be closed, can anyone please tell me what I'm doing wrong? I tried all the possible flags and although most work at restoring the window, but all disable minimizing.

WinSetState("IVMS-4000", "", @SW_MAXIMIZE)

I thank you all in advance.

Mohd.

Link to comment
Share on other sites

Are you running that command in a loop in the background? If you are, that is the reason why it keeps maximizing, because you're telling it to.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Thank you so much for your answer, no it did not work however I found a workaround which does the job.

If you could just spare a minute to go over my code and see if there is anything wrong with it, it is working beautifully at the moment.

The purpose of the script is to launch 2 apps and click a button to make it full-screen, here is the code:

If ProcessExists("netappsoft.exe") Then
ProcessClose("netappsoft.exe")
EndIf

If ProcessExists("dblclick.exe") Then
ProcessClose("dblclick.exe")
EndIf
Sleep(1000)

RefreshTray()
Func RefreshTray()
    $speed = 5
    $original = MouseGetPos()
    MouseMove (10,10)
    MouseMove (10,@DesktopHeight - 10, $speed)
    MouseMove (@DesktopWidth - 10,@DesktopHeight - 10, $speed)
    MouseMove (@DesktopWidth - 10,10, $speed)
    MouseMove (10,10, $speed)
    MouseMove ($original[0],$original[1])
EndFunc

Run("C:\Program Files\iVMS-4000(v2.0)\NetAppSoft.exe", "")
Run("D:\My Files\Downloads\Double click simulator\dblclick.exe", "")
Sleep (5000)

MouseClick("left",1077,895,1)

Is there a way so that I can include lines in the code to run only if it is Sunday, Monday or Tuesday Between 9 am to 1 pm and 4 pm to 10 pm?

Again I really appreciate your answers, I don't need a lot of your times, just to point me in the right direction with some function names to study.

Mohd.

Link to comment
Share on other sites

Got the whole thing sorted out, thank you to all for your unparallelled support.

P.S the dblclick.exe is just a program for my old dad who has trouble double clicking the mouse so that program just simulates a double click if he presses the middle button.

Thanks again.

Mohd.

Link to comment
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
 Share

  • Recently Browsing   0 members

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