Jump to content

2 Problems. Resizing GUI, and Minimize to tray.


Gui
 Share

Recommended Posts

Aye guys, the first problem is simple. I just want to know how to be able to have a re-sizable window THAT DOESN'T mess up all the controls. Well in short, I would like to make it so that when dragged or something, the Obj in my GUI could get bigger? So I thought resizing the whole window.. If there is just a way to be able to re-size one control ( an obj) than, that's my question. For number 2 , I have a giant loop that occurs, and I want it to be able to minimize to tray and still continue the loop.

Thanks.

GUI.

PS: This is the giant loop I mentioned before. During it, if the minimize to tray button is clicked, i'd like it to continue the loop, and still go to the tray. What I have below works ONLY if the loop is stopped..

EDIT: Got the resizing. Now only for the Minimize to tray part :)

Func button1()
    $current = 1
    $readd=GuiCtrlRead($viewnum)
    $proxylist = StringSplit(GUICtrlRead($proxies),@CRLF)
    If $current = UBound($proxylist) - 1 Then
        MsgBox(0,'','All proxies have been used')
        Return
    EndIf
    
    For $i = $current To UBound($proxylist) - 1
        $current = $i
        IniWrite($file,'Current','proxy',$current)
        If $running = 0 Then Return
        $delay = Random(GUICtrlRead($delay1),GuiCtrlRead($delay2))
        $d = round($delay,0)
        FtpSetProxy(2,$proxylist[$i])
        _IENavigate($oIE, GuiCtrlRead($url))
        
            If GUIGETMSG() = $mtray Then
                ContinueLoop
                TraySetIcon("C:\Documents and Settings\Dell Customer\Desktop\DesktopItems\zeroicon.ico")
                GuiSetState(@SW_HIDE)
                TraySetState(1); show
                TrayTip("iView",'Views Done : ' & $i)
                TraySetToolTip ("Youtube Viewer - Click to Restore.") 
                AND Continueloop
            EndIf
        $oForm = _IEFormGetCollection($oIE,0)
        $x = _IEGetObjById($oForm,"watch-views")
        $e = _IEFormElementGetValue($x)
                _GUICtrlStatusBar_SetText($status,'Views Done : '& $i)
                _GUICtrlStatusBar_SetText($status,'Views on Page : '& $x,2)
_IEAction($oIE,"Stop")
        $timer = TimerInit()
            While TimerDiff($timer) <= $d * 1000
                If $running = 0 Then Return
                Sleep(10)
                                _GUICtrlStatusBar_SetText($status,'Delay : '& Round(TimerDiff($timer)/1000,1) & '/' & $d *1000 / 1000,1)
            WEnd
        
            If GUIGetMsg() = $mtray Then
                ContinueLoop
                    TraySetIcon("C:\Documents and Settings\Dell Customer\Desktop\Desktop Items\zeroicon.ico")
                    GuiSetState(@SW_HIDE)
                    TraySetState(1); show
                    TraySetToolTip ("Youtube Viewer - Click to Restore.")
            EndIf
        If $i = $readd Then 
            $i = 0 
            $running = 0
            GUICtrlSetData($start,'Start')
        EndIf
    Next
EndFunc
Edited by Gui
Link to comment
Share on other sites

Here is some updated code originaly done by GAFrost for the systray portion. You will probably have to play with it to get what you want.

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#Include<Constants.au3>

Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)
Opt("TrayIconHide", 0)

TraySetOnEvent($TRAY_EVENT_PRIMARYUP,"SpecialEvent")
TraySetState()


GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

GuiSetState()

While 1
    $msg = GuiGetMsg()

    Select
    Case $msg = $GUI_EVENT_MINIMIZE

    GuiSetState(@SW_HIDE)
    Opt("TrayIconHide", 0)
    Traytip ("My App", "click here to restore", 5)

    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
        ;;;
    EndSelect
WEnd

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Tried that GEO before, thanks anyways :). It only works if the loop is stopped.

Interesting. I used a slightly modified version of it extensivly and don't have that issue. Maybe take a look at the tray*() funcs.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

What tray() func did you use?

You will have to wait untill I'm back at my main system.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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