Jump to content

Listview row not selectable


lrstndm
 Share

Recommended Posts

Hi,

Try this :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListViewConstants.au3>
#include <StructureConstants.au3>
 
#region GUI
Local $hGUI = GUICreate("MyGUI")
 
Global $iLw1 = GUICtrlCreateListView("Col1", 10, 10)
 
For $i = 1 To 10
    GUICtrlCreateListViewItem($i, $iLw1)
Next
 
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState(@SW_SHOW, $hGUI)
#endregion
 
While GUIGetMsg() <> $GUI_EVENT_CLOSE
    Sleep(10)
WEnd
 
GUIDelete($hGUI)
 
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
 
    Local $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    Local $iCode = DllStructGetData($tNMHDR, "Code")
 
    Switch $iIDFrom
        Case $iLw1
            Switch $iCode
                Case $LVN_ITEMCHANGING
                    Return -1
            EndSwitch
    EndSwitch
 
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Br, FireFox.

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