Jump to content

Two Gui's.


Recommended Posts

#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
Wend
oÝ÷ Øý½ëkçm+ºÚ"µÍÚ[HB   ÌÍÛÙÌHÝZQÙ]ÙÊ
BÙ[XÝØÙH    ÌÍÛÙÌH ÌÍÑÕRWÑUSÐÓÔÑBÚ[Ù]Ý]J   ÌÍÔØÙÜË  ][ÝÉ][ÝËÕ×ÒQJB[Ù[XÝÑ[

A. I have to press the button twice for it to minimize the child gui, then it causes the main gui's minimize/close funcation not to respond.

What I want to be able to do, is when I hit the 'x' (close) on the child window, it closes the child window, but not the main GUI. I also need to be able to have the main GUI funcations still work after I do so.

Any help would be great.

[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]

Link to comment
Share on other sites

********Two Gui's., Main, and Child. Close Child window, but not the main GUI?*****

[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]

Link to comment
Share on other sites

maybe..

#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))
GUISetState()


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

        Case $GUI_EVENT_CLOSE
            If WinActive($Process) Then
                GUISetState(@SW_HIDE, $Process)
            Else
                Exit
            EndIf

    EndSwitch
WEnd

; ------------------- FUNCTIONS -------------------------

Func Refresh()
    GUICtrlSetData($list, "")
    GUICtrlSetData($list, _FormatProcessList())
EndFunc   ;==>Refresh

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   ;==>_FormatProcessList

EDIT: placed functions in proper position

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

<3 Valuater. Works great, thank you for your help.

[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]

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