Belini Posted April 10, 2012 Share Posted April 10, 2012 (edited) I used this script posted by Rover to remove the scrollbars further moves vertically using arrows left and right, how to solve?Rover script written by:expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GUIListBox.au3> #Include <GuiScrollBars.au3> #include <ScrollBarConstants.au3> Opt('MustDeclareVars', 1) Global $hGui, $hListView, $hList, $iDLLUser32 = DllOpen("user32.dll") Global $wProcNewLV, $wProcOldLV, $wProcNewLB, $wProcOldLB Example_UDF_Created() Func Example_UDF_Created() $hGui = GUICreate("Scrollable ListView/ListBox without scrollbars", 600, 550, -1, -1) Local $cListView = GUICtrlCreateListView("", 2, 2, 596, 293) Local $exStyles = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER) $hListView = GUICtrlGetHandle($cListView) _GUICtrlListView_SetExtendedListViewStyle($hListView, $exStyles) ;subclass listview $wProcNewLV = DllCallbackRegister("_LVWndProc", "ptr", "hwnd;uint;wparam;lparam") $wProcOldLV = _WinAPI_SetWindowLong($hListView, $GWL_WNDPROC, DllCallbackGetPtr($wProcNewLV)) _GUICtrlListView_InsertColumn($cListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($cListView, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($cListView, 2, "Column 3", 100) _GUICtrlListView_InsertColumn($cListView, 3, "Column 4", 292) For $i = 0 To 41 _GUICtrlListView_AddItem($cListView, "Row " & $i + 1 & ": Col 1") _GUICtrlListView_AddSubItem($cListView, $i, "Row " & $i + 1 & ": Col 2", 1) _GUICtrlListView_AddSubItem($cListView, $i, "Row " & $i + 1 & ": Col 3", 2) _GUICtrlListView_AddSubItem($cListView, $i, "Row " & $i + 1 & ": Col 4", 3) Next Local $sTxt For $i = 0 To 50 $sTxt &= "Line " & $i & "|" Next Local $cList = GUICtrlCreateList("", 2, 320, 596, 200) GUICtrlSetData(-1, $sTxt) Local $hList = GUICtrlGetHandle(-1) ;works without this, but seems to remove sliver of scrollbar button on right edge _GUIScrollBars_EnableScrollBar($hList, $SB_BOTH, $ESB_DISABLE_BOTH) _GUIScrollBars_ShowScrollBar($hList, $SB_BOTH, False) ;subclass listbox $wProcNewLB = DllCallbackRegister("_LBWndProc", "ptr", "hwnd;uint;wparam;lparam") $wProcOldLB = _WinAPI_SetWindowLong($hList, $GWL_WNDPROC, DllCallbackGetPtr($wProcNewLB)) ;mouse won't scroll list until top index item is one greater than visible items _GUICtrlListBox_SetTopIndex($hList, 15);set to item one greater than visible items _GUICtrlListBox_SetTopIndex($hList, 0);rest back to first item - scrolling by mouse now works ;on restore from minimize, scrolling stops again until selected item one greater than visible items ;_WinAPI_SetWindowPos($hList, 0, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOZORDER)) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _Exit() EndFunc Func _Exit() If $wProcOldLV Then _WinAPI_SetWindowLong($hListView, $GWL_WNDPROC, $wProcOldLV) If $wProcOldLB Then _WinAPI_SetWindowLong($hList, $GWL_WNDPROC, $wProcOldLB) GUIDelete($hGui);prevents crash on exit caused by DllCallbackFree() DllClose($iDLLUser32) If $wProcNewLV Then DllCallbackFree($wProcNewLV) If $wProcNewLB Then DllCallbackFree($wProcNewLB) Exit EndFunc Func _LVWndProc($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam, $lParam Switch $Msg Case $WM_NCCALCSIZE _RemoveVHScroll($hWnd) Case $WM_WINDOWPOSCHANGING Local $tWINDOWPOS = DllStructCreate($tagWINDOWPOS, $lParam) ;uncomment for mouse scrolling - no mouse scrolling without, but border is not erased (vertical key scrolling flickers visibly)) DllStructSetData($tWINDOWPOS, "Flags", _ BitAND(DllStructGetData($tWINDOWPOS, "Flags"), BitNOT($SWP_FRAMECHANGED))) EndSwitch ;pass the unhandled messages to default WindowProc Local $aResult = DllCall($iDLLUser32, "lresult", "CallWindowProcW", "ptr", _ $wProcOldLV, "hwnd", $hWnd, "uint", $Msg, "wparam", $wParam, "lparam", $lParam) If @error Then Return -1 Return $aResult[0] EndFunc ;==>_LVWndProc Func _LBWndProc($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam, $lParam Switch $Msg Case $WM_NCCALCSIZE _RemoveVHScroll($hWnd) ;listview will add these styles again when restored from minimize Case $WM_WINDOWPOSCHANGING Local $tWINDOWPOS = DllStructCreate($tagWINDOWPOS, $lParam) DllStructSetData($tWINDOWPOS, "Flags", _ BitAND(DllStructGetData($tWINDOWPOS, "Flags"), BitNOT($SWP_FRAMECHANGED))) EndSwitch ;pass the unhandled messages to default WindowProc Local $aResult = DllCall($iDLLUser32, "lresult", "CallWindowProcW", "ptr", _ $wProcOldLB, "hwnd", $hWnd, "uint", $Msg, "wparam", $wParam, "lparam", $lParam) If @error Then Return -1 Return $aResult[0] EndFunc ;==>_LBWndProc Func _RemoveVHScroll($hWnd) Local $iLVStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) $iLVStyle = BitAND($iLVStyle, BitNOT($WS_VSCROLL)) $iLVStyle = BitAND($iLVStyle, BitNOT($WS_HSCROLL)) _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $iLVStyle) EndFunc Edited April 10, 2012 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
LarsJ Posted April 10, 2012 Share Posted April 10, 2012 Do you mean like this expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GUIListBox.au3> #Include <GuiScrollBars.au3> #include <ScrollBarConstants.au3> Opt('MustDeclareVars', 1) Global Const $iScrollBarWidth = 17 ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Global $hGui, $hListView, $hList, $iDLLUser32 = DllOpen("user32.dll") Global $wProcNewLV, $wProcOldLV, $wProcNewLB, $wProcOldLB Example_UDF_Created() Func Example_UDF_Created() $hGui = GUICreate("Scrollable ListView/ListBox without scrollbars", 600, 550, -1, -1) Local $cListView = GUICtrlCreateListView("", 2, 2, 596, 293) Local $exStyles = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER) $hListView = GUICtrlGetHandle($cListView) _GUICtrlListView_SetExtendedListViewStyle($hListView, $exStyles) ;subclass listview $wProcNewLV = DllCallbackRegister("_LVWndProc", "ptr", "hwnd;uint;wparam;lparam") $wProcOldLV = _WinAPI_SetWindowLong($hListView, $GWL_WNDPROC, DllCallbackGetPtr($wProcNewLV)) _GUICtrlListView_InsertColumn($cListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($cListView, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($cListView, 2, "Column 3", 100) _GUICtrlListView_InsertColumn($cListView, 3, "Column 4", 292-$iScrollBarWidth) ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< For $i = 0 To 41 _GUICtrlListView_AddItem($cListView, "Row " & $i + 1 & ": Col 1") _GUICtrlListView_AddSubItem($cListView, $i, "Row " & $i + 1 & ": Col 2", 1) _GUICtrlListView_AddSubItem($cListView, $i, "Row " & $i + 1 & ": Col 3", 2) _GUICtrlListView_AddSubItem($cListView, $i, "Row " & $i + 1 & ": Col 4", 3) Next Local $sTxt For $i = 0 To 50 $sTxt &= "Line " & $i & "|" Next Local $cList = GUICtrlCreateList("", 2, 320, 596, 200) GUICtrlSetData(-1, $sTxt) Local $hList = GUICtrlGetHandle(-1) ;works without this, but seems to remove sliver of scrollbar button on right edge _GUIScrollBars_EnableScrollBar($hList, $SB_BOTH, $ESB_DISABLE_BOTH) _GUIScrollBars_ShowScrollBar($hList, $SB_BOTH, False) ;subclass listbox $wProcNewLB = DllCallbackRegister("_LBWndProc", "ptr", "hwnd;uint;wparam;lparam") $wProcOldLB = _WinAPI_SetWindowLong($hList, $GWL_WNDPROC, DllCallbackGetPtr($wProcNewLB)) ;mouse won't scroll list until top index item is one greater than visible items _GUICtrlListBox_SetTopIndex($hList, 15);set to item one greater than visible items _GUICtrlListBox_SetTopIndex($hList, 0);rest back to first item - scrolling by mouse now works ;on restore from minimize, scrolling stops again until selected item one greater than visible items ;_WinAPI_SetWindowPos($hList, 0, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOZORDER)) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _Exit() EndFunc Func _Exit() If $wProcOldLV Then _WinAPI_SetWindowLong($hListView, $GWL_WNDPROC, $wProcOldLV) If $wProcOldLB Then _WinAPI_SetWindowLong($hList, $GWL_WNDPROC, $wProcOldLB) GUIDelete($hGui);prevents crash on exit caused by DllCallbackFree() DllClose($iDLLUser32) If $wProcNewLV Then DllCallbackFree($wProcNewLV) If $wProcNewLB Then DllCallbackFree($wProcNewLB) Exit EndFunc Func _LVWndProc($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam, $lParam Switch $Msg Case $WM_NCCALCSIZE _RemoveVHScroll($hWnd) Case $WM_WINDOWPOSCHANGING Local $tWINDOWPOS = DllStructCreate($tagWINDOWPOS, $lParam) ;uncomment for mouse scrolling - no mouse scrolling without, but border is not erased (vertical key scrolling flickers visibly)) DllStructSetData($tWINDOWPOS, "Flags", _ BitAND(DllStructGetData($tWINDOWPOS, "Flags"), BitNOT($SWP_FRAMECHANGED))) EndSwitch ;pass the unhandled messages to default WindowProc Local $aResult = DllCall($iDLLUser32, "lresult", "CallWindowProcW", "ptr", _ $wProcOldLV, "hwnd", $hWnd, "uint", $Msg, "wparam", $wParam, "lparam", $lParam) If @error Then Return -1 Return $aResult[0] EndFunc ;==>_LVWndProc Func _LBWndProc($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam, $lParam Switch $Msg Case $WM_NCCALCSIZE _RemoveVHScroll($hWnd) ;listview will add these styles again when restored from minimize Case $WM_WINDOWPOSCHANGING Local $tWINDOWPOS = DllStructCreate($tagWINDOWPOS, $lParam) DllStructSetData($tWINDOWPOS, "Flags", _ BitAND(DllStructGetData($tWINDOWPOS, "Flags"), BitNOT($SWP_FRAMECHANGED))) EndSwitch ;pass the unhandled messages to default WindowProc Local $aResult = DllCall($iDLLUser32, "lresult", "CallWindowProcW", "ptr", _ $wProcOldLB, "hwnd", $hWnd, "uint", $Msg, "wparam", $wParam, "lparam", $lParam) If @error Then Return -1 Return $aResult[0] EndFunc ;==>_LBWndProc Func _RemoveVHScroll($hWnd) Local $iLVStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) $iLVStyle = BitAND($iLVStyle, BitNOT($WS_VSCROLL)) $iLVStyle = BitAND($iLVStyle, BitNOT($WS_HSCROLL)) _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, $iLVStyle) EndFunc Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Belini Posted April 10, 2012 Author Share Posted April 10, 2012 (edited) This is the same as I indicated, it moves vertically when you press right arrow or left. Edited April 10, 2012 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
LarsJ Posted April 10, 2012 Share Posted April 10, 2012 (edited) Just make sure that the sum of the column widths + $iScrollBarWidth < the width of the listview. Adjust the width of the last column in the listview. Edited April 10, 2012 by LarsJ Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Belini Posted April 10, 2012 Author Share Posted April 10, 2012 I do not want to appear space after the last column as the sample I posted. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
BrewManNH Posted April 10, 2012 Share Posted April 10, 2012 Resize the GUI, or the listview, or the listview columns, or any combination of the 3 to eliminate that issue. The version of _ArrayDisplay that I have in my _Array.au3 UDF (link is in my signature) does this for the array display in the listview. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Belini Posted April 10, 2012 Author Share Posted April 10, 2012 @ BrewManNH the only way is to leave a space after the last column and do not want this space in the listview, must not only move vertically. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Belini Posted April 11, 2012 Author Share Posted April 11, 2012 Solved thanks to the rover: My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now