Jump to content

Need help in winlist()


Recommended Posts

hey i made this code, but sth. is wrong with it...

#include <GuiConstants.au3>


GuiCreate("Test Tasks", 320, 400,(@DesktopWidth-320)/2, (@DesktopHeight-400)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$List_1 = GuiCtrlCreateList("", 0, 0, 320, 357)
$infos = GuiCtrlCreateButton("Windows", 0, 360, 140, 40)
$exit = GuiCtrlCreateButton("Exit", 180, 360, 140, 40)


$list = ProcessList()
for $i = 1 to $list[0][0] - 1
  GUICtrlSetData($list_1, $list[$i][0])
next


GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $exit
        ExitLoop
    Case $msg = $infos
        infos(guictrlread($list_1))
    EndSelect
WEnd
Exit



;functions

Func infos($name)


$List = WinList()
For $i = 1 To $List[0][0]
If String($List[$i][1]) = $name Then
    $returns = $List[$i][1]
    msgbox(0, "", $returns)
    ExitLoop
EndIf
Next

it doesnt get the windownames of a process when the button windows is clicked....

could anyone say me what i am doing wrong?

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Link to comment
Share on other sites

You can't compare these two items...

#include <GuiConstants.au3>


GuiCreate("Test Tasks", 320, 400,(@DesktopWidth-320)/2, (@DesktopHeight-400)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$List_1 = GuiCtrlCreateList("", 0, 0, 320, 357)
$infos = GuiCtrlCreateButton("Windows", 0, 360, 140, 40)
$exit = GuiCtrlCreateButton("Exit", 180, 360, 140, 40)


$list = ProcessList()
for $i = 1 to $list[0][0] - 1
  GUICtrlSetData($list_1, $list[$i][0])
next


GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $exit
        ExitLoop
    Case $msg = $infos
        infos(guictrlread($list_1))
    EndSelect
WEnd
Exit



;functions

Func infos($name)

msgbox(0, "", $name)
$List = WinList()
For $i = 1 To $List[0][0]
;If String($List[$i][1]) = $name Then
   ;$returns = $List[$i][1]
    msgbox(0, "", $List[$i][1])
   ;ExitLoop
;EndIf
Next
EndFunc
Link to comment
Share on other sites

ok now i have got the next question...

#include <GuiConstants.au3>
Opt("winsearchchildren", 1)
GuiCreate("Taskmanager2 - Erweiterter Modus", 860, 619,(@DesktopWidth-860)/2, (@DesktopHeight-619)/2 )

$list = ProcessList()


$ProzessList = GuiCtrlCreateList("", 0, 20, 860, 292)
$Label_2 = GuiCtrlCreateLabel("Prozesse:", 0, 0, 200, 20)
$Beenden = GuiCtrlCreateButton("Prozess beenden", 720, 310, 140, 30)
$PWindowList = GuiCtrlCreateList("", 0, 340, 450, 279)
$ErwWindowList = GuiCtrlCreateList("", 460, 340, 400, 279)
$Label_6 = GuiCtrlCreateLabel("Fenster des Prozesses", 0, 320, 110, 20)
$Label_7 = GuiCtrlCreateLabel("Erweiterte Eigenschaften:", 460, 320, 130, 20)
$Exit = GuiCtrlCreateButton("Beenden", 360, 310, 90, 30)
$info = GuiCtrlCreateButton("About", 270, 310, 90, 30)
$eigens = GuiCtrlCreateButton("Eigenschaften", 180, 310, 90, 30)

for $i = 1 to $list[0][0] - 1
  GUICtrlSetData($prozesslist, $list[$i][0])
next


GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE or $msg = $exit
        ExitLoop
    Case $msg = $beenden 
        $frage = MsgBox(262180,"Sicher?","Sind sie sich sicher, dass sie " & Guictrlread($prozesslist) & " beenden möchten?")
        if $frage = 6 Then
            $proz = GUICtrlRead($prozesslist)
            ProcessClose($proz)
            GUICtrlSetData($prozesslist, "")
            sleep(50)
            for $i = 1 to $list[0][0] - 1
                GUICtrlSetData($prozesslist, $list[$i][0])
            next
        EndIf
    Case $msg = $prozesslist
        $process = guictrlread($prozesslist)
        GUICtrlSetData($pwindowlist, "")
           $pid = ProcessExists($process)
        If Not $pid Then
            sleep(50)
            msgbox(0, "error", "Der Prozess " & $pid & " existiert nicht!")
        Else
            $winList = WinList()
            For $i = 0 To $winList[$i][0] - 1
                $testPid = WinGetProcess($winList[$i][1])
                If $testPid = $pid and $winList[$i][0] <> "" Then
                    GUICtrlSetData($pwindowlist, $winList[$i][0])
                EndIf
            Next
        EndIf
   Case $msg = $pwindowlist
        $things = WinList(Guictrlread($pwindowlist))
        if @error Then
            sleep(50)
        Else
            For $i = 1 To $things[$i][0]
                GUICtrlSetData($erwwindowlist, $things[$i][0])
            Next
        EndIf
    EndSelect
WEnd
Exit

i want to list all buttons, etc. in the listview: $erwwindowlist

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Link to comment
Share on other sites

if im reme´mbering right, there was a small prog on this forum, which "copied" a Gui-window of an other programm and made a own with the same style!

has any1 the link to that file?

that woul help me much!

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/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...