fatboy123 Posted December 7, 2011 Share Posted December 7, 2011 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 More sharing options...
JohnOne Posted December 7, 2011 Share Posted December 7, 2011 Does that work? WinSetState("IVMS-4000", "", @SW_MAXIMIZE) Sleep(1000) WinSetState("IVMS-4000", "", @SW_MINIMIZE) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
BrewManNH Posted December 7, 2011 Share Posted December 7, 2011 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 GudeHow 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 More sharing options...
fatboy123 Posted December 8, 2011 Author Share Posted December 8, 2011 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 More sharing options...
fatboy123 Posted December 8, 2011 Author Share Posted December 8, 2011 P.S I know I can use task scheduler, however what will happen if computer crashes and restarts at 11 am? If I could code the schedule inside the script, then I could just put the script in the start-up folder and that's it. Thanks again. Link to comment Share on other sites More sharing options...
JohnOne Posted December 8, 2011 Share Posted December 8, 2011 You could take a look at _date_time* functions and use them to conditionally run your function. pseudo while 1 sleep if _date_time* function = whatever then myfunc() wend AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 8, 2011 Share Posted December 8, 2011 Ya, take a look at the time and date macros for scheduling. Also, why not just use the MouseClick() function instead of Run() that dblclick.exe program? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
fatboy123 Posted December 8, 2011 Author Share Posted December 8, 2011 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 More sharing options...
somdcomputerguy Posted December 8, 2011 Share Posted December 8, 2011 ..that program just simulates a double click if he presses the middle button... just use the MouseClick() function..and the _IsPressed() function. Your coding expertise will increase, and you will get a warm fuzzy.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now