Jump to content
Sign in to follow this  
Habland0

ListView: Ctrl+C, DisabledScroll, Drag disable

Recommended Posts

Habland0

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!

Share this post


Link to post
Share on other sites
FlyinRiz

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

Have you tried a custom function that gets called with HotKeySet() and dumps the currently selected ListView?

-Aaron

Share this post


Link to post
Share on other sites
Habland0

Have you tried a custom function that gets called with HotKeySet() and dumps the currently selected ListView?

That'd be my last resort, but if there is a cleaner way to do it then I'm very interested to hear it.

Share this post


Link to post
Share on other sites
Habland0

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.

Share this post


Link to post
Share on other sites
FlyinRiz

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.