vaibhavs Posted June 25, 2007 Share Posted June 25, 2007 Hi, I have created a simple Task Manager using PHP script in the backend. I wish to make this script start MINIMIZED and Maximize (to the predefined size) every 30 min. Once maximized, the user will minimize it manually (back to tray). This script needs to keeps running endlessly. Looking for help on this function. Thank you. Vai expandcollapse popup#include <GUIConstants.au3> #include <GuiListView.au3> $hMyGUI = GUICreate('To Do Manager', 310, 430, @DesktopWidth-317, @DesktopHeight-525, -1, 0x00000018) GUISetBkColor (0x00EFEFEF) GuiCtrlCreateLabel("Work List", 10, 10, 200, 25) GUICtrlSetFont(-1, 12, 600, -1, "Verdana") $oIE0 = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj ( $oIE0, 10, 10 , 300 , 330 ) $oIE0.navigate("http://www.google.com") $button_add = GUICtrlCreateButton("Add", 10, 360, 50, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") $button_Edt = GUICtrlCreateButton("Edit", 85, 360, 50, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") $edtwhat = GUICtrlCreateInput ("", 140, 360, 40, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") $button_del = GUICtrlCreateButton("Del", 205, 360, 50, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") $delwhat = GUICtrlCreateInput ("", 260, 360, 40, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") GuiCtrlCreateLabel("Created by AutoIT.com", 15, 400, 300, 30) GUICtrlSetFont(-1, 10, 800, -1, "Verdana") GuiCtrlSetColor(-1, 0x0000FF) GUISetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $msg = $button_add addTask() Case $msg = $button_del $del = GUICtrlRead($delwhat) delTask($del) Case $msg = $button_edt $edt = GUICtrlRead($edtwhat) edtTask($edt) EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 25, 2007 Share Posted June 25, 2007 Hi, make a simple If the else If @Min = 30 Then ... maximize or If TimerDiff = ... So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 25, 2007 Share Posted June 25, 2007 I wish to make this script start MINIMIZED and Maximize (to the predefined size) every 30 min.Once maximized, the user will minimize it manually (back to tray).This script needs to keeps running endlessly.Add the appropriate optional parameters to your GuiSetState(). They are in the help file. For the 30min timer, you can either use TimerInit()/TimerDiff() in your main loop, or set up AdLibEnable() to handle it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 25, 2007 Share Posted June 25, 2007 If @Min = 30 Then ... maximize Would only hit once every hour (at the bottom of the hour). You meant: If @Min = 30 Or @Min = 00 Then Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
vaibhavs Posted June 25, 2007 Author Share Posted June 25, 2007 Hi, Thx for the inputs. Here is my revised script. But I am still unable to get with the following 2 features: (a) I need the script to maximize every 30 minutes (In the below code, I have kept it to every 10th seconds for testing) ( When maximizing, I need the webiste (google.com in the below example) to also be refreshed. Please help with the correction codes. Thank you. Vai expandcollapse popup#include <GUIConstants.au3> #include <GuiListView.au3> Global $bMinToTray Opt('TrayAutoPause',0) Opt('TrayMenuMode', 1) $hMax = TrayCreateItem('Open ToDo Manager') TraySetState() $hMyGUI = GUICreate('To Do Manager', 310, 430, @DesktopWidth-317, @DesktopHeight-525, -1, 0x00000018) GUISetBkColor (0x00EFEFEF) GuiCtrlCreateLabel("Work List", 10, 10, 200, 25) GUICtrlSetFont(-1, 12, 600, -1, "Verdana") $oIE0 = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj ( $oIE0, 10, 10 , 300 , 330 ) $oIE0.navigate("http://www.google.com") $button_add = GUICtrlCreateButton("Add", 10, 360, 50, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") $button_Edt = GUICtrlCreateButton("Edit", 85, 360, 50, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") $edtwhat = GUICtrlCreateInput ("", 140, 360, 40, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") $button_del = GUICtrlCreateButton("Del", 205, 360, 50, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") $delwhat = GUICtrlCreateInput ("", 260, 360, 40, 25) GUICtrlSetFont(-1, 9, 600, -1, "Verdana") GuiCtrlCreateLabel("Created by AutoIT.com", 15, 400, 300, 30) GUICtrlSetFont(-1, 10, 800, -1, "Verdana") GuiCtrlSetColor(-1, 0x0000FF) GUISetState() if(@sec = 10) Then WinSetState($hMyGUI, '', @SW_RESTORE) EndIf While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $msg = $button_add addTask() Case $msg = $button_del $del = GUICtrlRead($delwhat) delTask($del) Case $msg = $button_edt $edt = GUICtrlRead($edtwhat) edtTask($edt) EndSelect Switch $bMinToTray Case False Switch GUIGetMsg() Case -3 Exit Case -4 $bMinToTray = Not $bMinToTray WinSetState($hMyGUI, '', @SW_HIDE) Opt('TrayIconHide', 0) EndSwitch Case True Switch TrayGetMsg() Case $hMax $bMinToTray = Not $bMinToTray Opt('TrayIconHide', 1) WinSetState($hMyGUI, '', @SW_RESTORE) WinSetState($hMyGUI, '', @SW_SHOW) EndSwitch EndSwitch WEnd Exit Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 25, 2007 Share Posted June 25, 2007 HI, try: Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 25, 2007 Moderators Share Posted June 25, 2007 ^^ looks familiar... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
herewasplato Posted June 25, 2007 Share Posted June 25, 2007 ^^ looks familiar...maybe you should have taken the code in this post:http://www.autoitscript.com/forum/index.ph...st&p=310179and run it thru this tread:http://www.autoitscript.com/forum/index.php?showtopic=48095first :-) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 25, 2007 Share Posted June 25, 2007 and run it thru this tread:http://www.autoitscript.com/forum/index.php?showtopic=48095first :-)Just the kind of thread that needs Valik's tender care... if he ever gets out of jail. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
vaibhavs Posted June 26, 2007 Author Share Posted June 26, 2007 Thx a ton! It work very well. regards, Vai 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