Jump to content

ListView: Ctrl+C, DisabledScroll, Drag disable


Habland0
 Share

Recommended Posts

1. Is it possible to allow a selected ListView item to be copied to the clipboard when the user presses CTRL+C?

2. Does an equivalent of $LBS_DISABLENOSCROLL exist for ListView controls? (Shows a disabled vertical scroll bar for the list box when the box does not contain enough items to scroll.)

3. Items in the ListView can be dragged and there seems to be no flag to disable that behavior. I have managed to disable dragging by looking for the WM_NOTIFY $LVN_BEGINDRAG code and then issuing a MouseClick(Left), which immediately stops the drag, but this is obviously a dirty solution.

Thanks!

Link to comment
Share on other sites

2. Does an equivalent of $LBS_DISABLENOSCROLL exist for ListView controls? (Shows a disabled vertical scroll bar for the list box when the box does not contain enough items to scroll.)

I have found a solution for this. By calling the ShowScrollBar function in user32.dll. It must be called after each ListViewItem creation, else the window's default settings (i.e. no scrollbar) are restored. It causes some minor flickering though.

DllCall("user32.dll", "bool", "ShowScrollBar", "hwnd", $hwnd, "int", $SB_VERT, "int", True)
DllCall("user32.dll", "bool", "EnableScrollBar", "hwnd", $hwnd, "uint", $SB_VERT, "uint", $ESB_DISABLE_BOTH)

EnableScrollBar function is used to disable the scrollbar. These functions can also be accessed through the GuiScrollBars UDF.

Link to comment
Share on other sites

I have found a solution for this. By calling the ShowScrollBar function in user32.dll. It must be called after each ListViewItem creation, else the window's default settings (i.e. no scrollbar) are restored. It causes some minor flickering though.

One time or constant? You could try putting something in your script to only update when it's changed if it happening every loop.

-Aaron

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