rachel Posted November 28, 2007 Share Posted November 28, 2007 CODE Case $Msg = $Select_All _GUICtrlListViewSetItemSelState($PC_LISTStatus, -1, 1) Case $Msg = $UnSelect_All _GUICtrlListViewSetItemSelState($PC_LISTStatus, -1, 0) 3.2.10.0 autoit v3 not this function how to actualize thanks Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 28, 2007 Share Posted November 28, 2007 (edited) CODE Case $Msg = $Select_All _GUICtrlListViewSetItemSelState($PC_LISTStatus, -1, 1) Case $Msg = $UnSelect_All _GUICtrlListViewSetItemSelState($PC_LISTStatus, -1, 0)3.2.10.0 autoit v3 not this function how to actualize thanksTry it with _GUICtrlListView_SetItemSelected(). Many of the functions from PaulIA's AU3LIB.au3 have been rewritten and incorporated. The variable $PC_LISTStatus will have to be a handle, not Control ID, I believe. The new help file entry doesn't mention using index = -1 to select all, you'll have to test to be sure it still works. If not, then Kat gets to spank Gary... Edited November 28, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
rachel Posted November 28, 2007 Author Share Posted November 28, 2007 $PC_LISTStatus = GUICtrlCreateListView("aaa| bbb ", 24, 40, 162, 286, $LVS_SHOWSELALWAYS) Case $Msg = $Select_All _GuiCtrlListView_SetItemSelected($PC_LISTStatus,-1) -1 not work Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 28, 2007 Share Posted November 28, 2007 (edited) $PC_LISTStatus = GUICtrlCreateListView("aaa| bbb ", 24, 40, 162, 286, $LVS_SHOWSELALWAYS) Case $Msg = $Select_All _GuiCtrlListView_SetItemSelected($PC_LISTStatus,-1) -1 no work You are still working with the Control ID instead of the handle. Try it this way: $PC_LISTStatus = GUICtrlCreateListView("aaa| bbb ", 24, 40, 162, 286, $LVS_SHOWSELALWAYS) $hPC_LISTStatus = ControlGetHandle($WinTitle, $WinText, $PC_LISTStatus) ; ... Case $Msg = $Select_All _GuiCtrlListView_SetItemSelected($hPC_LISTStatus, -1) Edit: Fixed bad syntax on ControlGetHandle(). Edited November 28, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
rachel Posted November 29, 2007 Author Share Posted November 29, 2007 You are still working with the Control ID instead of the handle. Try it this way: $PC_LISTStatus = GUICtrlCreateListView("aaa| bbb ", 24, 40, 162, 286, $LVS_SHOWSELALWAYS) $hPC_LISTStatus = ControlGetHandle($WinTitle, $WinText, $PC_LISTStatus) ; ... Case $Msg = $Select_All _GuiCtrlListView_SetItemSelected($hPC_LISTStatus, -1) Edit: Fixed bad syntax on ControlGetHandle(). the same not work Link to comment Share on other sites More sharing options...
GaryFrost Posted November 29, 2007 Share Posted November 29, 2007 The old function was broken, the new at this time doesn't support the -1 for index. I've finally got my old function working again and will be replacing the new function with the contents of the following function. Func _GUICtrlListView_SetItemSelectedState($hWnd, $iIndex = -1, $fSelected = True, $fFocused = False) If $Debug_LV Then _GUICtrlListView_ValidateClassName($hWnd) Local $tstruct = DllStructCreate($tagLVITEM) Local $pItem = DllStructGetPtr($tstruct) Local $iResult, $iSelected = 0, $iFocused = 0, $iSize, $tMemMap, $pMemory If ($fSelected = True) Then $iSelected = $LVIS_SELECTED If ($fFocused = True) Then $iFocused = $LVIS_FOCUSED DllStructSetData($tstruct, "Mask", $LVIF_STATE) DllStructSetData($tstruct, "Item", $iIndex) DllStructSetData($tstruct, "State", BitOR($iSelected, $iFocused)) DllStructSetData($tstruct, "StateMask", BitOR($LVIS_SELECTED, $iFocused)) $iSize = DllStructGetSize($tstruct) If IsHWnd($hWnd) Then $pMemory = _MemInit($hWnd, $iSize, $tMemMap) _MemWrite($tMemMap, $pItem, $pMemory, $iSize) $iResult = _SendMessage($hWnd, $LVM_SETITEMSTATE, $iIndex, $pItem, 0, "wparam", "ptr") _MemFree($tMemMap) Else $iResult = GUICtrlSendMsg($hWnd, $LVM_SETITEMSTATE, $iIndex, $pItem) EndIf Return $iResult <> 0 EndFunc ;==>_GUICtrlListView_SetItemSelectedState SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 29, 2007 Share Posted November 29, 2007 The old function was broken, the new at this time doesn't support the -1 for index.I've finally got my old function working again and will be replacing the new function with the contents of the following function.Killjoy. I thought you'd just take your spanking like a man! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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