Jump to content

GuiCtrlCreateTreeView


Recommended Posts

#include <GUIConstants.au3>

GUICreate(" - Proces Kille - ",350, 260)

GUICtrlCreateGroup (" All sputěné procesy ", 10, 10, 220, 228)
 GUIStartGroup()
$treeproces = GuiCtrlCreateTreeView(20, 30, 200, 192, $TVS_CHECKBOXES)
 $list = ProcessList()
  For $i = 1 To $list[0][0]
   $radek = GuiCtrlCreateTreeViewItem($list[$i][0], $treeproces)
  Next

Func pokus()                                                  ;?
 $list = ProcessList()                                     ;?
  For $i = 1 To $list[0][0]                              ;?
   $prectenahodnota = GUICtrlRead($radek)    ;?
    MsgBox ( 0, $list[$i][0], $prectenahodnota)   ;?
  Next                                                          ;?
EndFunc                                                      ;?

;*** info spustenych procesu ***

GuiCtrlCreateLabel("  Celkem sputěno procesů :  ", 20, 230, 140, 15)
 GuiCtrlCreateLabel($list[0][0], 160, 230, 20, 15)

;***************************

$killbutton = GuiCtrlCreateButton("Kill", 260, 20, 60, 25)

GUISetState()
While 1
 $msg = GUIGetMsg()
 If $msg = $killbutton Then
  pokus()
 EndIf
  Select
   Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
   EndSelect
WEnd

Link to comment
Share on other sites

I don't speak german, or whichever language that it (it looks german to me). It seems to be a process ender(?), however, I don't see the ProcessClose() command or a DLLCall...I don't intend on running it without someone translating it for me...I don't use too much GUI either, so I don't know exactly what happens in the GUI when the pokus() function is called.

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

Guys, what are you smoking? lol, there seems to be no harm here, false alarm I guess...

EDIT: But why is it in the support forum? I ahevn't run it because I'm at my cousins house and I'm too lazy to... :) No description was given either.

Edited by layer
FootbaG
Link to comment
Share on other sites

It currently does nothing. It creates a checkbox treeview with all the running processes and a "Kill" button. When you click the Kill button, it goes through each item in the treeview and tells you what GuiCtrlRead() returns from it (kind of a pain, lots of message boxes). Innocent though. Looks like the beginning of a process killer.

*Edit: Correction, it actually does GuiCtrlRead on $radek, which is set multiple times, and is actually only the last item in the treeview. This version will now show a message box for each item checked in the treeview.

#include <GUIConstants.au3>

GUICreate(" - Proces Kille - ", 350, 260)

GUICtrlCreateGroup(" All sputené procesy ", 10, 10, 220, 228)
GUIStartGroup()
$treeproces = GUICtrlCreateTreeView(20, 30, 200, 192, $TVS_CHECKBOXES)
$list = ProcessList()
Dim $radeks[$list[0][0] + 1]

For $i = 1 To $list[0][0]
    $radeks[$i] = GUICtrlCreateTreeViewItem($list[$i][0], $treeproces)
Next

Func pokus()
    $list = ProcessList()
    For $i = 1 To $list[0][0]
        $prectenahodnota = GUICtrlRead($radeks[$i])
        If BitAND($prectenahodnota, $GUI_CHECKED) Then
            MsgBox(0, $list[$i][0], $prectenahodnota)
        EndIf
    Next
EndFunc

;*** info spustenych procesu ***

GUICtrlCreateLabel("  Celkem sputeno procesu :  ", 20, 230, 140, 15)
GUICtrlCreateLabel($list[0][0], 160, 230, 20, 15)

;***************************

$killbutton = GUICtrlCreateButton("Kill", 260, 20, 60, 25)

GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $killbutton Then
        pokus()
    EndIf
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd
Edited by Saunders
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...