rodrigocfd / windigo

Windows API and GUI in idiomatic Go.
https://pkg.go.dev/github.com/rodrigocfd/windigo
MIT License
417 stars 23 forks source link

LVM_SETITEMSTATE failed when pressing Ctrl-A to co.LVS_SINGLESEL flagged ListView #22

Closed Hoto-Cocoa closed 1 year ago

Hoto-Cocoa commented 1 year ago

I created ListView using following code:

ui.NewListView(parent, ui.ListViewOpts().
        Position(location).
        Size(size).
        CtrlStyles(co.LVS_REPORT|co.LVS_NOSORTHEADER|co.LVS_SHOWSELALWAYS|co.LVS_SINGLESEL).
        CtrlExStyles(co.LVS_EX_FULLROWSELECT|co.LVS_EX_GRIDLINES))

And If I pressing Ctrl-A, the program crashes with message: LVM_SETITEMSTATE failed.

I can confirm It crashes without any items to select.

rodrigocfd commented 1 year ago

LVM_SETITEMSTATE fails to select all items if the list view has LVS_SINGLESEL style. This is an undocumented behavior, apparently.

Hoto-Cocoa commented 1 year ago

Thanks for fix!