Jump to content

problem with _GUICtrlListView_DeleteItemsSelected($hWnd)


Recommended Posts

i can't remove a computer(entry that i made)

#include <GuiConstantsEx.au3>
#include <GuiListView.au3>




    Local $exStyles = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES), $hListView
    
    GUICreate("Remote 4", 800, 600)
    $tInfo= GUICtrlCreateInput ( "", 20,  5, 300, 20)
    $search = GUICtrlCreateButton ("Search",  400, 5, 100)
    $AddPC = GUICtrlCreateButton ("Add Computer",  400, 40, 100)
    $removePC = GUICtrlCreateButton ("Remove Computer",  400, 70, 100)
    $ReverseALL = GUICtrlCreateButton ("Reverse All",  400, 100, 100)
    
    $hListView = GUICtrlCreateListView("", 2, 40, 394, 268)
    _GUICtrlListView_SetExtendedListViewStyle($hListView, $exStyles)
    GUISetState()

    _GUICtrlListView_AddColumn($hListView, "Computer Name", 100)
    _GUICtrlListView_AddColumn($hListView, "Status", 100)


GUISetState (@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    if $msg = $AddPC Then
        $pcname=InputBox("Computer Name","Enter here a computer name","UP")
        _GUICtrlListView_InsertItem ($hListView, $pcname)
    EndIf
    if $msg = $removePC Then
    _GUICtrlListView_DeleteItemsSelected($hListView)
    EndIf
    if $msg = $ReverseALL Then
            _GUICtrlListView_SetItemChecked($hListView, -1)
        EndIf

    if $msg = $search Then
    $iI = _GUICtrlListView_FindItem ($hListView, -1, $tInfo)
       _GUICtrlListView_EnsureVisible($hListView, $iI)
 EndIf
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
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...