Jump to content

Need help with script


Recommended Posts

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

#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

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

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.

:rolleyes:

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

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

:rolleyes:

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

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)

(:rolleyes: 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

#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

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

  • Moderators

^^ 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

Just the kind of thread that needs Valik's tender care... if he ever gets out of jail.

:rolleyes:

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

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...