Jump to content
Sign in to follow this  
Sardith

Two GUI's

Recommended Posts

Sardith

#include <GUIConstants.au3>

$hGui = GUICreate("Test", 360, 115, -1, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))


$list=GUICtrlCreateList ("", 100,32, 200, 300)
GUICtrlSetLimit(-1,200) ; to limit horizontal scrolling
GUICtrlSetData(-1, _FormatProcessList())
$Button_1 = GUICtrlCreateButton ("Refresh",  10, 30, 100)


GUISetState ()

$Process = GUICreate("Process List", 360, 115, -1, 600, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))

Func Refresh()
    GUICtrlSetData($List, "")
    GUICtrlSetData($List, _FormatProcessList())
EndFunc

Func _FormatProcessList()
    Local $list = ProcessList()
    Local $retstr = 0
    For $i = 1 To $list[0][0]
        $retstr = $retstr & $list[$i][0]
        If $i < $list[0][0] Then $retstr = $retstr & "|"
    Next
    Return $retstr
EndFunc 
GUISetState ()


While 1
    $msg = GUIGetMsg()
Switch $Msg
    Case $Button_1
        Refresh()
         
        Case $GUI_EVENT_CLOSE
            ExitLoop

        
   EndSwitch
WendoÝ÷ ÙhZ´m±ç¦¶hÌ!z{azÇ¢wFP7êèqë,ßÜwö+)­ë,yÒ#ºËpj{b¶Ú!×­ì"Ú0Ó~®²Æ§vz-{­¶©®+je¡jØ·ö÷­¯'jëh×6
While 1
    $msg2 = GuiGetMsg()
    Select
        Case $msg2 = $GUI_EVENT_CLOSE
            WinSetState($Process, "", @SW_HIDE)
    EndSelect
WEnd

It works, if you press the 'x' twice. But it causes the $hGui to not funcation. Any help would be great.

Thanks,

Jeff


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites
/dev/null

While 1
    $msg2 = GuiGetMsg()
    Select
        Case $msg2 = $GUI_EVENT_CLOSE
            WinSetState($Process, "", @SW_HIDE)
    EndSelect
WEnd
oÝ÷ Øp¢¹,ü¨ºÞ²Ëa{qßÛpǺحq«¬zËa{Múk¢¶èµû§q«b¢p'Ê¥§
.ÖÞ·µ8ZK    y÷ÿªê-{¥*.ë-µéejëhÜ!ÈpwhÃø.§z¶­yÛax"ÎHG¯z{Ryè^âçè¬eëL²áz·¢±©è¦Ø¨©ij¶¦j׫jëh×6   GUIGetMsg(1)

If this case it will return an array. $array[1] = The window handle the event is from.


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites
Sardith

Thanks Dev/null i'll look into it


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites
Sardith

#include <GUIConstants.au3>

;dims
Dim $array[1]

$hGui = GUICreate("Test", 360, 115, -1, -1, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))


$list=GUICtrlCreateList ("", 100,32, 200, 300)
GUICtrlSetLimit(-1,200) ; to limit horizontal scrolling
GUICtrlSetData(-1, _FormatProcessList())
$Button_1 = GUICtrlCreateButton ("Refresh",  10, 30, 100)


GUISetState ()

$Process = GUICreate("Process List", 360, 115, -1, 600, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))

Func Refresh()
    GUICtrlSetData($List, "")
    GUICtrlSetData($List, _FormatProcessList())
EndFunc

Func _FormatProcessList()
    Local $list = ProcessList()
    Local $retstr = 0
    For $i = 1 To $list[0][0]
        $retstr = $retstr & $list[$i][0]
        If $i < $list[0][0] Then $retstr = $retstr & "|"
    Next
    Return $retstr
EndFunc 
GUISetState ()


While 1
    $msg = GUIGetMsg(1)
Switch $Msg
    Case $Button_1
        Refresh()
         
     Case $array[1] 
         If $Process = $array[1] Then
        WinSetState($Process, "", @SW_HIDE)
        EndIf
        
   EndSwitch
Wend

Thats what I tryed, no luck. Just can't seem to get this.


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites
Uten

You need to take a look at GuiSwitch and GuiDelete. Use GuiSetState($hwnd, [@SW_HIDE|@SW_SHOW]) to hide or show rather than Exit. GuiGetMsg() is always for the latest GuiCreate(...)

Share this post


Link to post
Share on other sites
Uten

This $msg = GUIGetMsg(1) returns an array. And must be used as such in the switch statement.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.