Search the Community
Showing results for tags 'listview'.
-
Hi all, I have an array $htags[13][3] where x,0 is a list of html tags divided by "|" (i.e. tag1|tag2|tag3|...) x,1 is 1 or 0 (1 if tag is available in HTML, otherwise 0) x,2 is a string (H1, H2, H3,H4,H5, H6, Title, Keywords, Description, Paragraphs, Anchors, Div, LI) Then I have a Listview: $iLVStyle = BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS) $iLVExtStyle = BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT) $hListView_Tags = GUICtrlCreateListView("H1|H2|H3|H4|H5|H6|Title|Keywords|Description|Paragraphs|Anchors|DIV|LI", 96, 576, 818, 262, $iLVStyle, $iLVExtStyle) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 8, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 9, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 10, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 11, 65) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 12, 65) It appears like that. I need to fill every columns of the listview with equivalent Tag as in column 2 of $htags This achieved by splitting $aTags = StringSplit($htags[$i][0], "|", 2) I tried this: Func _fillListview($hTags, $hListView_Tags) For $i = 0 To UBound($htags) - 1 ; Split the tags in $htags[$i][0] Local $aTags = StringSplit($htags[$i][0], "|", 2) ; Add a new item to the ListView GUICtrlCreateListViewItem("", $hListView_Tags) ; Loop through the tags and set the corresponding subitem in the ListView For $j = 1 To UBound($aTags) - 1 _GUICtrlListView_SetItem($hListView_Tags, $aTags[$j], $i, $j - 1) Next ; Set the other columns in the ListView _GUICtrlListView_SetItem($hListView_Tags, $htags[$i][1], $i, UBound($aTags) - 1) Next EndFunc But it doesn't work properly. Can someone help me to sort it out? Thanks in advance, Marco
- 12 replies
-
Any idea how to change this example from LarsJ so that the selection via arrow keys works for marked cells? ;coded by LarsJ #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> Opt( "MustDeclareVars", 1 ) Global $hGui, $hLV, $iLVx, $iLVy, $aHit[2] = [ -1, -1 ] ; $aHit contains row & col of marked cell Global $aLV = [ [ 0, 25, 45, -1, -1 ], _ ; $hLV, $iLVx, $iLVy, $aHit[0], $aHit[1] [ 0, 125, 145, -1, -1 ], _ [ 0, 225, 245, -1, -1 ] ] Example() Func Example() $hGui = GUICreate( "Mark Cell in Listview", 500, 520 ) Local $idTab = GUICtrlCreateTab( 10, 10, 480, 500 ) GUICtrlCreateTabItem( "Tab 0, LV 0" ) Local $idLV0 = GUICtrlCreateListView( "Column 0|Column 1|Column 2", 25, 45, 250, 250 ) For $i = 0 To 99 GUICtrlCreateListViewItem( "Cell " & $i & ".0" & "|Cell " & $i & ".1" & "|Cell " & $i & ".2", $idLV0 ) Next $hLV = GUICtrlGetHandle( $idLV0 ) $aLV[0][0] = $hLV $iLVx = 25 $iLVy = 45 GUICtrlCreateTabItem( "Tab 1, LV 1" ) Local $idLV1 = GUICtrlCreateListView( "Column 0|Column 1|Column 2", 125, 145, 250, 250 ) For $i = 0 To 99 GUICtrlCreateListViewItem( "Cell " & $i & ".0" & "|Cell " & $i & ".1" & "|Cell " & $i & ".2", $idLV1 ) Next $aLV[1][0] = GUICtrlGetHandle( $idLV1 ) GUICtrlCreateTabItem( "Tab 2, LV 2" ) Local $idLV2 = GUICtrlCreateListView( "Column 0|Column 1|Column 2", 225, 245, 250, 250 ) For $i = 0 To 99 GUICtrlCreateListViewItem( "Cell " & $i & ".0" & "|Cell " & $i & ".1" & "|Cell " & $i & ".2", $idLV2 ) Next $aLV[2][0] = GUICtrlGetHandle( $idLV2 ) GUICtrlCreateTabItem( "" ) GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY" ) GUISetState() Local $iTab, $iTabPrev = 0 While 1 Switch GUIGetMsg() Case $idTab $iTab = GUICtrlRead( $idTab ) $aLV[$iTabPrev][3] = $aHit[0] $aLV[$iTabPrev][4] = $aHit[1] $hLV = $aLV[$iTab][0] $iLVx = $aLV[$iTab][1] $iLVy = $aLV[$iTab][2] $aHit[0] = $aLV[$iTab][3] $aHit[1] = $aLV[$iTab][4] If $aHit[0] <> -1 Then _ _GUICtrlListView_RedrawItems( $hLV, $aHit[0], $aHit[0] ) $iTabPrev = $iTab Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc Func WM_NOTIFY( $hWnd, $iMsg, $wParam, $lParam ) Local $tNMHDR, $hWndFrom, $iCode $tNMHDR = DllStructCreate( $tagNMHDR, $lParam ) $hWndFrom = HWnd( DllStructGetData( $tNMHDR, "hWndFrom" ) ) $iCode = DllStructGetData( $tNMHDR, "Code" ) Switch $hWndFrom Case $hLV Switch $iCode Case $LVN_ITEMCHANGED Local $tNMLISTVIEW, $iItem, $aInfo $tNMLISTVIEW = DllStructCreate( $tagNMLISTVIEW, $lParam ) $iItem = DllStructGetData( $tNMLISTVIEW, "Item" ) _GUICtrlListView_SetItemSelected( $hLV, $iItem, False ) _GUICtrlListView_SetItemState( $hLV, $iItem, 0, $LVIS_FOCUSED ) Local $aInfo = GUIGetCursorInfo( $hGui ) If $aInfo[2] Then $aInfo = _GUICtrlListView_SubItemHitTest( $hLV, $aInfo[0]-$iLVx, $aInfo[1]-$iLVy ) If $aInfo[0] > -1 And $aInfo[1] > -1 And $aInfo[0] = $iItem Then If $aHit[0] > -1 Then _ _GUICtrlListView_RedrawItems( $hLV, $aHit[0], $aHit[0] ) If $aHit[0] <> $aInfo[0] Or $aHit[1] <> $aInfo[1] Then $aHit[0] = $aInfo[0] ; Row $aHit[1] = $aInfo[1] ; Col Else $aHit[0] = -1 ; Row $aHit[1] = -1 ; Col EndIf _GUICtrlListView_RedrawItems( $hLV, $iItem, $iItem ) EndIf EndIf Case $NM_CUSTOMDRAW Local $tNMLVCUSTOMDRAW = DllStructCreate( $tagNMLVCUSTOMDRAW, $lParam ) Local $dwDrawStage = DllStructGetData( $tNMLVCUSTOMDRAW, "dwDrawStage" ) Switch $dwDrawStage ; Holds a value that specifies the drawing stage Case $CDDS_PREPAINT ; Before the paint cycle begins Return $CDRF_NOTIFYITEMDRAW ; Notify the parent window of any ITEM-related drawing operations Case $CDDS_ITEMPREPAINT ; Before painting an item Return $CDRF_NOTIFYSUBITEMDRAW ; Notify the parent window of any SUBITEM-related drawing operations Case BitOR( $CDDS_ITEMPREPAINT, $CDDS_SUBITEM ) ; Before painting a subitem Local $dwItemSpec = DllStructGetData( $tNMLVCUSTOMDRAW, "dwItemSpec" ) ; Item index Local $iSubItem = DllStructGetData( $tNMLVCUSTOMDRAW, "iSubItem" ) ; Subitem index Local $uItemState = DllStructGetData( $tNMLVCUSTOMDRAW, "uItemState" ) ; Item state If $dwItemSpec = $aHit[0] Then ; Marked row Switch $iSubItem Case $aHit[1] ; Marked column DllStructSetData( $tNMLVCUSTOMDRAW, "ClrText", 0xFFFFFF ) ; Forecolor white DllStructSetData( $tNMLVCUSTOMDRAW, "clrTextBk", 0xCC6600 ) ; Backcolor dark blue, BGR Case Else ; Other columns DllStructSetData( $tNMLVCUSTOMDRAW, "ClrText", 0x000000 ) ; Forecolor black DllStructSetData( $tNMLVCUSTOMDRAW, "ClrTextBk", 0xFFFFFF ) ; Backcolor white EndSwitch Else ; Other rows DllStructSetData( $tNMLVCUSTOMDRAW, "ClrText", 0x000000 ) DllStructSetData( $tNMLVCUSTOMDRAW, "ClrTextBk", 0xFFFFFF ) EndIf Return $CDRF_NEWFONT ; $CDRF_NEWFONT must be returned after changing font or colors EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
- 12 replies
-
- listview
- arrow keys
-
(and 1 more)
Tagged with:
-
I am trying to automate the steps required by an compiler app. After loading and starting compilation the compiler opens a dialogue window with a ListView component in which the progress is logged. I need to know how many items are in the ViewList so I can detect when compilation is finished. I've tried several things with no success: Local $hCtrl = ControlGetHandle($hWnd, "", $sCtrlClass) Local $aRetVal = _GUICtrlListView_GetItemCount($hCtrl) $aRetVal = DllCall("user32.dll", "int", "SendMessage", "hwnd", $hCtrl, "int", $LVM_GETITEMCOUNT, "int", 0, "int", 0) $aRetVal = _WinAPI_SendMessageTimeout ( $hCtrl, $LVM_GETITEMCOUNT , 0 , 0) _GUICtrlListView_GetItemCount seems to be intented for use on ViewLists created when making an AutoIt GUI as far as I can see. Not sure for 100%. In all 3 cases $aRetVal = 0. Any help welcome here...
-
Hi. I'm using the FreeCommander XE file manager here, and i'v written a script, which will create an empty, new file, after choosing an extension out from the Listbox. The listview code is not mine, iv found the scripts somewhere on this forum. I have no credits in it, because it was intended to be only for my personal use. But now, i have a lot of free time, so i remembered that i haven't posted anything on this forum, yet, so here is my first script: It should be compiled with the Autoit v3.3.14.3 . The compiled exe needs a folder passed as a parameter, so that it know where to create the new file. A Listbox is opened, with a selection of available extensions. After selecting and doubleclicking (or using the ok button), the script creates a filename (if specified in the config file) with increased numbers (up to 9999). If the filename exist, the counter is checking the next number, until the maximum is reached. This script uses an ini file for configuration, called "NewFile.ini" which should be in the same folder, as the compiled exe. NewFile.au3 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <String.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <EditConstants.au3> #include <GuiEdit.au3> #include <ScrollBarsConstants.au3> Global $test[0][2], $hFile, $cmd = "", $cmdtmp, $tmptxt, $tmpinidir, $filesetting, $MouseX, $MouseY, $UseMouseX, $UseMouseY, $Edit1 Global $aArray[1] = [] $cmdtmp = StringReplace($cmdlineraw, Chr(34), "") If StringLen($cmdtmp) = 2 Then If StringRight($cmdtmp, 1) = ":" Then $cmd = $cmdtmp & "\" EndIf Else If StringRight($cmdtmp, 1) <> "\" Or StringRight($cmdtmp, 1) <> "/" Then $cmd = $cmdtmp & "\" EndIf EndIf If Not FileExists($cmd) Then ;Check if the folder exists, display an error message if not ! DisplayReadMe(1) Exit EndIf If StringLen(@ScriptDir) > 3 And StringRight(@ScriptDir, 1) <> "\" Then $tmpinidir = @ScriptDir & "\" Else $tmpinidir = @ScriptDir EndIf Local Const $sFilePath = $tmpinidir & "NewFile.ini" $filesetting = IniRead($sFilePath, "setting", "filename", "MyNewFile") $filesetting = StringReplace($filesetting, ">", " ") ;msgbox (0,"",$filesetting) ;Debugging $UseMouseX = IniRead($sFilePath, "setting", "UseMouseX", "1") $UseMouseY = IniRead($sFilePath, "setting", "UseMouseY", "0") If FileExists($sFilePath) Then $aArray = IniReadSectionNames($sFilePath) ; Read the INI section names. This will return a 1 dimensional array. EndIf ; Check if an error occurred. If @error=0 Then ; Enumerate through the array displaying the section names. Local $count = 0 If FileExists($sFilePath) Then For $i = 1 To $aArray[0] $tmp1 = IniRead($sFilePath, $aArray[$i], "1", "none") If $tmp1 <> "none" And StringLeft($tmp1, 1) = "." Then ;Extension need to have a dot, or it will be ignored ! $tmptxt = $tmptxt & $tmp1 & "|" & $aArray[$i] & @CRLF $count = $count + 1 ;Count how many extensions are added ! EndIf Next EndIf If $count = 0 Then $tmptxt = ".au3|AutoIt 3" & @CRLF & ".txt|Text File" & @CRLF ;MsgBox($MB_SYSTEMMODAL,"",$tmptxt) _ArrayAdd($test, $tmptxt, 0, "|", @CRLF) Else ;Reading the ini failed, create a default array for the extensions $tmptxt = ".au3|AutoIt 3" & @CRLF & ".txt|Text" & @CRLF _ArrayAdd($test, $tmptxt, 0, "|", @CRLF) EndIf ;Local $test[5][2] = [['.au3', 'AutoIt'], ['.ahk', 'Auto Hotkey'], ['.txt', 'text'], ['.sdlbas', 'Sdl Basic'], ['.html', 'Webpage']] If $UseMouseX = 1 Then $MouseX = MouseGetPos(0) Else $MouseX = -1 EndIf If $UseMouseY = 1 Then $MouseY = MouseGetPos(1) Else $MouseY = -1 EndIf $Form1 = GUICreate("Create New File", 210, 247, $MouseX, $MouseY, $WS_CAPTION, $WS_EX_TOOLWINDOW) $List = GUICtrlCreateListView("", 5, 5, 200, 200) _GUICtrlListView_InsertColumn($List, 0, "Extension", 65) _GUICtrlListView_InsertColumn($List, 1, "Description", 115) _GUICtrlListView_AddArray($List, $test) GUICtrlCreateLabel("Example:" & $filesetting & "0000.ext", 5, 205) $Button1 = GUICtrlCreateButton("Ok", 16, 224, 45, 22) $Button3 = GUICtrlCreateButton("ReadMe", 80, 224, 55, 22) $Button2 = GUICtrlCreateButton("Cancel", 150, 224, 45, 22) $cDummy = GUICtrlCreateDummy() GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button2 Exit Case $Button3 DisplayReadMe(0) Case $Button1, $cDummy Local $tmptxt = StringSplit(_GUICtrlListView_GetItemTextString($List), "|")[1] If StringLen($tmptxt) > 0 Then Local $fnr = 0, $tmpfile = "" While $fnr < 10000 $tmpfile = $cmd & $filesetting & _StringRepeat("0", 4 - StringLen($fnr)) & $fnr & $tmptxt ;MsgBox(0,"",$tmpfile) ; for debugging If Not (FileExists($tmpfile)) Then $hFile = _WinAPI_CreateFile($tmpfile, 0) _WinAPI_CloseHandle($hFile) Exit EndIf $fnr = $fnr + 1 WEnd EndIf EndSwitch WEnd ;================================================================================ Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $List If Not IsHWnd($List) Then $hWndListView = GUICtrlGetHandle($List) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_DBLCLK ; Fire the dummy if the ListView is double clicked GUICtrlSendToDummy($cDummy) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func DisplayReadMe($err) Local $Form1 = GUICreate("Read Me", 550, 400, 10, 10, BitOR($WS_CAPTION, $WS_THICKFRAME ,$WS_MAXIMIZEBOX)) $Edit1 = GUICtrlCreateEdit("", 0, 0, 549, 399) GUICtrlSetData(-1, "") GUISetState(@SW_SHOW) If $err=1 then local $txttmp01="Error: Path does not exist" local $txttmp02="Commandline call was: " AddText ($txttmp01) Addtext ($txttmp02 & $cmd & @CRLF & @CRLF) EndIf AddText("Instructions:" & @CRLF) AddText("Displays a selection of available extensions and then creates a new file at the Path's location." & @CRLF & @CRLF & "Usage: NewFile Path") AddText("Example: NewFile c:\myfolder\" & @CRLF) AddText("Result: A file with a name 'MyFile0000.ext' will be created at the Path's location.") AddText("If the filename exists, the number counter will increase, until it finds a free number, up to 9999." & @CRLF) AddText("Uses a configuration file in the .exe folder named NewFile.ini !" & @CRLF) AddText("Example of a config file:" & @CRLF) AddText("[setting]" & @CRLF & "filename=MyFile>") AddText("UseMouseX=0 ;0 or 1 - position the dialog at the mouse x coordinate - usefull for multi monitor settings !") AddText("UseMouseY=0 ;0 or 1 - Set this and UseMouseX to spawn the dialog at the mouse coordinates !" & @CRLF) AddText(";Use > in filename as a space char ! (only needed if you want the space char at the beginning or at the end : in between filename and the number)" & @CRLF) AddText(";Format for this ini file is:" & @CRLF & ";Name e.g [Auto It]") AddText(";extension e.g 1=.au3" & @CRLF & "; p.s. only 1 extension per section ! the number must be 1" & @CRLF) AddText("[AutoIt3]" & @CRLF & "1=.au3" & @CRLF & @CRLF & "[Text]" & @CRLF & "1=.txt") _GUICtrlEdit_SetSel($Edit1, 0, 0) _GUICtrlEdit_Scroll($Edit1, $SB_SCROLLCARET) If $err=1 Then _GUICtrlEdit_SetSel($Edit1, 0, StringLen($txttmp01 & $txttmp02 & $cmd)+5) EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form1) ExitLoop EndSwitch WEnd EndFunc ;==>DisplayReadMe Func AddText($edittxt) _GUICtrlEdit_AppendText($Edit1, $edittxt & @CRLF) EndFunc ;==>AddText NewFile.ini [setting] filename=MyNewFile_ UseMouseX=0 ;0 or 1 - position the dialog at the mouse x coordinate - usefull for multi monitor settings ! UseMouseY=0 ;0 or 1 - Set this and UseMouseX to spawn the dialog at the mouse coordinates ! ;Use > in filename as a space char ! (only needed if you want the space char at the beginning or at the end : in between filename and the number) ;Format for this ini file is: ;Name e.g [Auto It] ;extension e.g 1=.au3 ; p.s. only 1 extension per section ! the number must be 1 [AutoIt3] 1=.au3 [Auto Hotkey] 1=.ahk [Text] 1=.txt [Sdl Basic] 1=.sdlbas [Webpage] 1=.html [Basic] 1=.bas [Pascal] 1=.pas [Rich Text (RTF)] 1=.rtf [Word Document] 1=.doc [Hex File] 1=.hex
-
Newbie to _GUICtrlListView_RegisterSortCallBack and can't get it to sort properly on date in format MM/DD/YYYY. Example code below. Q - How do I get the date to sort properly? ;#AutoIt3Wrapper_run_debug_mode=Y #include <GUIConstantsEx.au3> #include <GuiListView.au3> Global $g_id_ListView Example() Exit Func Example() Local $idRow1, $idRow2, $idRow3 GUICreate("ListView Sort Question", 300, 200) $g_id_ListView = GUICtrlCreateListView("Row#|Name|Date", 10, 10, 280, 180) $id_Row1 = GUICtrlCreateListViewItem("#1|Alice|01/15/2022", $g_id_ListView) $id_Row2 = GUICtrlCreateListViewItem("#2|Bob|02/22/2021", $g_id_ListView) $id_Row3 = GUICtrlCreateListViewItem("#3|Carol|03/13/2021", $g_id_ListView) $id_Row10 = GUICtrlCreateListViewItem("#10|Dave|10/09/2021", $g_id_ListView) $id_Row11 = GUICtrlCreateListViewItem("#11|Eve|11/21/2021", $g_id_ListView) GUISetState(@SW_SHOW) ;$vCompareType = 0 ;not ok as Row# sort #1, #10, and want #1, #2, ;$vCompareType = 1 ;not ok as Row# sort #1, #10, and want #1, #2, $vCompareType = 2 ;Row# okay but Date messed up _GUICtrlListView_RegisterSortCallBack($g_id_ListView, $vCompareType) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $g_id_ListView ;MsgBox(0,"","col="&GUICtrlGetState($g_id_ListView)) _GUICtrlListView_SortItems($g_id_ListView, GUICtrlGetState($g_id_ListView)) EndSwitch WEnd _GUICtrlListView_UnRegisterSortCallBack($g_id_ListView) GUIDelete($g_id_ListView) EndFunc ;Func Example()
-
Hello, I'm trying to implement Virtual ListView in my project. I have been based on example from @LarsJ. The script loads data from csv file instead of array as in original example and perform some parsing. Sometimes, when running a script, it adds garbage to the end of the correct data. The data is loaded correctly into the global array (double-clicking on a row with garbage displays it correct in the console), but is not displayed correctly. What am I missing or doing wrong? #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <GuiStatusBar.au3> #include <FileConstants.au3> #include <GuiListBox.au3> #include <SendMessage.au3> #include <EditConstants.au3> Opt("MustDeclareVars", 1) Global $hWnd, $idLV, $hLV, $aItems[1][1] Global $gWinXMin = 1130, $gWinYMin = 615 Global Const $TopMost = 262144 ; Set MsgBox top-most attribute Example() Func Example() Local $Ver = "Virtual LV" ; Create GUI $hWnd = GUICreate("iTS - Test Sequencer [Ver " & $Ver & "]", $gWinXMin, $gWinYMin, -1, -1, BitOR($WS_SIZEBOX, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) ; Create ListView Reduces flicker Checkboxes Tooltip Icons Local $iLvStyle = BitOR($WS_EX_CLIENTEDGE, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_CHECKBOXES, $LVS_EX_INFOTIP);, $LVS_EX_SUBITEMIMAGES) $idLV = GUICtrlCreateListView("", 8, 50, 915, 477, $LVS_OWNERDATA, $iLvStyle) $hLV = GUICtrlGetHandle($idLV) ; Virtual listview ; --- ListView Add columns --- _GUICtrlListView_AddColumn($hLV, "# ID", 45) ; 0 _GUICtrlListView_AddColumn($hLV, "Group", 120) ; 1 _GUICtrlListView_AddColumn($hLV, "Name", 335) ; 2 _GUICtrlListView_AddColumn($hLV, "Min", 50) ; 3 _GUICtrlListView_AddColumn($hLV, "Max", 50) ; 4 _GUICtrlListView_AddColumn($hLV, "Result", 50) ; 5 _GUICtrlListView_AddColumn($hLV, "Status", 50) ; 6 _GUICtrlListView_AddColumn($hLV, "Description", 179) ; 7 ; Checkboxes _GUICtrlListView_SetCallBackMask($hLV, 32) ; 32 - The application stores the image list index of the current state image ; Load icon images ;~ Local $hImage = _GUIImageList_Create() ;~ _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hLV, 0xFF0000, 16, 16)) ; Index = 0 ;~ _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hLV, 0x00FF00, 16, 16)) ; Index = 1 ;~ _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hLV, 0x0000FF, 16, 16)) ; Index = 2 ;~ _GUICtrlListView_SetImageList($hLV, $hImage, 1) ; --- StatusBar --- Local $aStatusBarParts[5] = [220, 160, 160, 140, -1] Global $StatusBar = _GUICtrlStatusBar_Create($hWnd, $aStatusBarParts) ; $SBARS_SIZEGRIP ; --- DEBUG --- Local $Debug_1 = GUICtrlCreateButton("Check Random", 928, 383, 91, 25) ; 152 Local $Debug_2 = GUICtrlCreateButton("Load From Array", 1024, 383, 91, 25) ; 152 Local $Debug_3 = GUICtrlCreateButton("Load 15 Rows", 928, 412, 91, 25) Local $Debug_4 = GUICtrlCreateButton("Load 500 Rows", 1024, 412, 91, 25) Local $DebugLabel_1 = GUICtrlCreateLabel("DEBAG", 928, 444, 36, 17) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUIRegisterMsg($WM_GETMINMAXINFO, "MY_WM_GETMINMAXINFO") ; Restrict minimaze window below specified size [$gWinXMin, $gWinYMin] GUISetState(@SW_SHOW) ; ============================================================================================= ; --- Load Test --- Local $sTestCsvFile = @ScriptDir & "\Test CSV 15.csv" _ListView_Load($sTestCsvFile, $aItems, True) ; Load Autosized ; ============================================================================================= ; Message loop While 1 Switch GUIGetMsg() Case $Debug_1 ConsoleWrite(UBound($aItems, 1) & @CRLF) ConsoleWrite(UBound($aItems, 2) & @CRLF) For $i = 0 To UBound($aItems, 1) - 1 $aItems[$i][10] = 8192 ; Checked Next ConsoleWrite("- $i " & $i & @CRLF) GUICtrlSendMsg( $idLV, $LVM_SETITEMCOUNT, $i, 0 ) ;~ $aItems[$i][10] = 4096 ; Unchecked ;~ $aItems[$k+$j][10] = 8192 ; Checked Case $Debug_2 Local $iRows = 250 Dim $aItems[$iRows+1][12] For $iRow = 0 To $iRows - 1 $aItems[$iRow][0] = $iRow + 1 $aItems[$iRow][1] = "AAA-" & Random(1000000, 9999999, 1) $aItems[$iRow][2] = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" $aItems[$iRow][3] = "CCC-" & Random(1000000, 9999999, 1) $aItems[$iRow][4] = "DDD-" & Random(1000000, 9999999, 1) $aItems[$iRow][10] = 4096 ; Unchecked Next GUICtrlSendMsg( $idLV, $LVM_SETITEMCOUNT, $iRow, 0 ) _GUICtrlStatusBar_SetText($StatusBar, $iRow & " Rows Loaded", 1) Case $Debug_3 GUICtrlSetData($Debug_3, "Load 15") $sTestCsvFile = @ScriptDir & "\Test CSV 15.csv" _ListView_Load($sTestCsvFile, $aItems, True) ; Load Autosized Case $Debug_4 GUICtrlSetData($Debug_4, "Load 500") $sTestCsvFile = @ScriptDir & "\Test CSV 500.csv" _ListView_Load($sTestCsvFile, $aItems, True) ; Load Autosized Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Example ; ; ; Return Test Count Func _ListView_Load($sTestCsvFile, ByRef $aItems, $AutoSize = True) Local $iRow = 0, $iNumLen, $aData, $aName, $GroupName, $TestName, $TestIdx, $MinVal, $MaxVal, $iStatus;, $aName Local $sTestIniFile = StringRegExpReplace($sTestCsvFile, '\.[^.]*$', '.tcf') ; INI File ;~ _SendMessage($hLV, $LVM_DELETEALLITEMS) ; Delete All Local $aCsv = FileReadToArray($sTestCsvFile) ; 9.289ms If @error Then Return MsgBox($TopMost+16, "_ListView_Load()", "! CSV File Reading ERROR") Local $LinesCount = @extended Dim $aItems[$LinesCount][12] $iNumLen = StringLen($LinesCount) For $i = 1 To $LinesCount-1 ; If StringLeft($aCsv[$i], 5) = "TEST_" Then $aData = StringSplit($aCsv[$i], ",") If $aData[0] >= 5 Then $iRow += 1 $aData[1] = StringReplace($aData[1], "TEST_", "", 1) $aData[1] = StringReplace(StringReplace($aData[1], "__", "|", 1), "_", " ", 1) $aName = StringSplit($aData[1], "|", 3) If @error Then $GroupName = "" $TestName = $aName[0] Else $GroupName = $aName[0] $TestName = StringReplace($aName[1], "_", " ") ; (all '_' replaced with ' ') EndIf $TestIdx = StringStripWS($aData[2], 7) $MinVal = StringStripWS($aData[3], 7) $MaxVal = StringStripWS( $aData[4], 7) $aItems[$iRow - 1][0] = StringFormat("%0" & $iNumLen & "i ", $iRow) $aItems[$iRow - 1][1] = $GroupName $aItems[$iRow - 1][2] = $TestName $aItems[$iRow - 1][3] = $MinVal $aItems[$iRow - 1][4] = $MaxVal $aItems[$iRow - 1][10] = 4096 ; 4096-Unchecked, 8192-Checked EndIf Else ContinueLoop EndIf Next _GUICtrlListView_BeginUpdate($hLV) GUICtrlSendMsg($idLV, $LVM_SETITEMCOUNT, $iRow, 0) ; Update data [$aItems] to ListView _GUICtrlListView_SetColumnWidth($hLV, 0, -1) If $AutoSize Then For $i = 1 To 2 _GUICtrlListView_SetColumnWidth($hLV, $i, $LVSCW_AUTOSIZE) Next EndIf _GUICtrlListView_EndUpdate($hLV) _GUICtrlStatusBar_SetText($StatusBar, $iRow & " Rows Loaded", 1) Return $iRow EndFunc ;==>_ListView_Load Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local Static $tText = DllStructCreate("wchar[50]") Local Static $pText = DllStructGetPtr($tText) Local $tNMHDR, $hWndFrom, $iCode $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hLV Switch $iCode Case $LVN_GETDISPINFOW Local $tNMLVDISPINFO = DllStructCreate($tagNMLVDISPINFO, $lParam) Local $iItem = DllStructGetData($tNMLVDISPINFO, "Item") Local $iSubItem = DllStructGetData($tNMLVDISPINFO, "SubItem") Local $iMask = DllStructGetData($tNMLVDISPINFO, "Mask") ; Text If BitAND($iMask, $LVIF_TEXT) Then Local $sText = $aItems[$iItem][$iSubItem] DllStructSetData($tText, 1, $sText) DllStructSetData($tNMLVDISPINFO, "Text", $pText) DllStructSetData($tNMLVDISPINFO, "TextMax", StringLen($sText)) EndIf ; Checkbox in first column If BitAND($iMask, $LVIF_STATE) And $iSubItem = 0 Then DllStructSetData($tNMLVDISPINFO, "State", $aItems[$iItem][10]) EndIf ; Icon in first column ; Use proper $iSubItem value for other columns If BitAND($iMask, $LVIF_IMAGE) And $iSubItem = 6 Then ; Status Column Icon DllStructSetData($tNMLVDISPINFO, "Image", $aItems[$iItem][11]) EndIf Case $NM_CUSTOMDRAW Local $tNMLVCUSTOMDRAW = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) Local $dwDrawStage = DllStructGetData($tNMLVCUSTOMDRAW, "dwDrawStage") Local $dwItemSpec = DllStructGetData($tNMLVCUSTOMDRAW, "dwItemSpec") Switch $dwDrawStage ; Holds a value that specifies the drawing stage Case $CDDS_PREPAINT ; Before the paint cycle begins Return $CDRF_NOTIFYITEMDRAW ; Notify the parent window of any item-related drawing operations Case $CDDS_ITEMPREPAINT ; Before painting an item If Mod($dwItemSpec, 2) = 1 Then DllStructSetData($tNMLVCUSTOMDRAW, "ClrTextBk", 0xFFFFFF) Else DllStructSetData($tNMLVCUSTOMDRAW, "ClrTextBk", 0xEBF7FF) ; BGR EndIf Return $CDRF_NEWFONT ; $CDRF_NEWFONT must be returned after changing font or colors EndSwitch Case $NM_CLICK Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) Local $iItem = DllStructGetData($tInfo, "Index") Local $iSubItem = DllStructGetData($tInfo, "SubItem") If $iSubItem = 0 Then If $aItems[$iItem][10] = 4096 Then $aItems[$iItem][10] = 8192 ; Checked Else $aItems[$iItem][10] = 4096 ; Unchecked EndIf _GUICtrlListView_RedrawItems($hLV, $iItem, $iItem) EndIf Case $NM_DBLCLK ; User double-clicks an item with the left mouse button (No return value) Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) Local $iItem = DllStructGetData($tInfo, "Index") Local $iSubItem = DllStructGetData($tInfo, "SubItem") ConsoleWrite("--> DBLCLK Row : " & $iItem + 1 & @CRLF) ConsoleWrite("--> Name : " & $aItems[$iItem][$iSubItem] & @CRLF) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY ; Resize the status bar when GUI size changes Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam ;~ ConsoleWrite("ListView Width " & ControlGetPos($hWnd, "", $idLV)[2] & @CRLF) _GUICtrlStatusBar_Resize($StatusBar) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Func MY_WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam) Local $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int",$lParam) DllStructSetData($minmaxinfo, 7, $gWinXMin); min X (+15) DllStructSetData($minmaxinfo, 8, $gWinYMin); min Y (+15) Return 0 EndFunc Test CSV 15.csv Test CSV 500.csv Virt_LV_Garbage.au3
- 4 replies
-
- listview
- virtual listview
-
(and 1 more)
Tagged with:
-
Hello all, I have an ListView with checkboxes and about 300 - 400 items. Entire list is loaded (from ini) every time and I need to store and load "checked scenario" by name. Store list of checked indexless is a bad idea because in the case of sorting the list - scenario will no longer be correct. What is the best way to store list of various scenarios of checked items? Base code and database ini are attached Example_LV_Store_Scenario.au3 Example.ini
-
Topic Closed, please go here SQLite demonstration of native recognition of BLOB object in Listview Following an idea that was raised in a discussion with water and jchd, I have been working during the past week on a ListView SQLite demo that integrates BLOB (Binary large Object) fields. Download link at the bottom of this post This is what I have until now, version sero sero sero … one – to use the words of a well know Spanish biker . It is a fully workable example and I would be happy if you could test it and give me your comments. Pre-requisites: 1. You have to download the SQLite Database here: http://users.telenet.be/GreenCan/AutoIt/GreenCan_SQLite_Database_demo.zip 2. You have to download trancexx’ great GIFAnimation udf here: GIFAnimation or http://code.google.com/p/gif-animation/downloads/list For your comfort, I included the latest version in the above zip file. I decided to use GIFAnimation.au3 for the Image display because it works with several kinds of graphic types (except multipage tiff) including animated GIFs J . GIFAnimation? What’s in a name… 3. SQLite3.dll (also included in the zip package) In this first version, you will see two different icons in the Listview (as opposed to the screenshot where you see all images as icons) 1. Eye Icon: this is an image object, clicking once will open a preview box 2. Database with lightning arrow: any kind of other (non-image) object A BLOB field doesn’t need to be an image, it can store literally everything you can imagine, the database contains several objects that you can try-out. I didn’t include an exe file, but why not? It is possible. Up to you to find out if it is useful. These non-graph objects are not preview-able and will be executed. By the way, all these BLOB examples are inoffensive, for example the autoit code just displays an ‘Hello World’ MsgBox. If you don’t trust it, just comment out the ShellExecute in line 219 and verify the content in the Temp folder… or pass your favorite virus scanner over these files You will notice that the first execute take a bit more time to start, afterwards, everything is blinking fast. Not sure why this slow behavior, maybe it’s only on my PC. Although the example looks good, I am not completely satisfied with the result. The BLOB object is not natively recognized and I think it should, but I don’t know how to do this. Any suggestion is welcome here… I can use a isBinary() to identify the field as a BLOB, but I still don’t know how to recognize the BLOB as an image, or an Excel sheet, or anything else. So this is the reason why I have the TypeOfObject column, that links the object to the physical file. Again, any suggestion is welcome here… Another issue is that I have to export the file to a physical file to be able to display (or use) it. I tried UEZ’s _GDIPlus_BMPFromMemory() function for the bitmaps but it is too slow (not even sure it can handle anything else than BMP. And slowness will increase with very large binary objects. I am wondering what the performance would be with a database containing several hundreds of objects to export. I will come with version 0.0.0.2 within a few days. I just let you test the current version first. Version 2 has, as you can see in the screenshot above, a visible icon representation of the image object. This is how it should be but there are significant disadvantages in the way that I programmed it. But I will explain that when I publish the new example script. SQLite GreenCan_demo BLOB in Listview 0.0.0.1.au3 (Please jump immediately to version 0.0.0.2 if you do not intend to test both examples) Edit: 06 May 2013 New version! Version 0.0.0.2 This enhanced version displays a visible thumbnail of each Database image object in the ListView. The example works with the database file that you have to download or already downloaded with the first version (see Prerequisite 1 higher in this post) SQLite GreenCan_demo BLOB in Listview 0.0.0.2.au3 Edit: 10 May 2013 With this script, you can import your own objects into the GreenCan_demo.db Database (you have to download the database again from the link in Pre-requisite 1, because I modified the structure, the key column is now autoincremental) The script will work for both demo's Import Object in SQLite Database.zip Anyhow, enjoy and please give me feedback. GreenCan
-
How to move scrollbar thumb to top or bottom?
ahha posted a topic in AutoIt General Help and Support
Under program control is there an easy way to move a slider (thumb) to the top or bottom? I am aware of Melba23's GUIScrollbars_Ex UDF (https://www.autoitscript.com/forum/topic/113723-scrollbars-made-easy-bugfix-version-2-may-21/) but I believe it's overkill for my simple needs. In a listview with a vertical scrollbar when the window is active one can hit Ctrl+Home to move the scrollbar slider (thumb) to the top and Ctrl+End to the bottom. One can also right click the slider and choose Scroll Here, Top, Bottom, Page UP, Page Down, Scroll Up, and Scroll Down. I must be doing something basically wrong but am stuck. Move the thumb to the middle before clicking the Top button to test the code below (Bottom is not coded). I've commented out other trys. try #3 is a strange fail. Any comments on what I'm missing greatly appreciated as I'm stuck #AutoIt3Wrapper_run_debug_mode=Y #include <Debug.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <GuiScrollBars.au3> AutoItSetOption("MustDeclareVars", 1) ;v1b - cut out extraneous code Example() Exit Func Example() Local $i, $j, $x, $hGUI, $idListView, $bTop, $bBottom $hGUI = GUICreate("Scrollbar Question", 300, 400) ;get handle in case we need it later $idListView = GUICtrlCreateListView("Col 0", 10, 10, 280, 300) $bTop = GUICtrlCreateButton("Top", 10, 350, 60, 25) $bBottom = GUICtrlCreateButton("Bottom", 120, 350, 60, 25) ;Pause("$hGUI = '" & $hGUI &"'"& @CRLF & "$idListView = '" & $idListView &"'") For $i = 1 to 100 _GUICtrlListView_AddItem($idListView, $i) Next GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $bTop ;drag thumb to middle of scrollbar before clicking Top button ;try #1 - FAILS Opt("WinTitleMatchMode", 2) ;2 = Match any substring in the title $x = WinActivate("Scrollbar Question") ;not $idListview but main GUI $hGUI - neither working If $x <> $hGUI Then Pause("WinActivate FAILED") Send("^{HOME}") ;Ctrl+home ;try#2 - FAILS ;~ $x = WinActivate($hGUI) ;try Main GUI ;~ If $x <> $hGUI Then Pause("WinActivate FAILED") ;~ Send("^{HOME}") ;Ctrl+home ;try#3 - strange FAILS ;~ $x = WinActivate($idListview) ;try $idListview ;~ If $x <> $idListview Then Pause("WinActivate FAILED") ;strange it works BUT if I comment out this line it fails ;~ ;Sleep(1000) ;it's not a time delay issue ;~ Send("^{HOME}") ;Ctrl+home ;try#4 - same strange fail as #3 ;~ $x = WinActivate($idListview) ;try $idListview ;~ If $x <> $idListview Then Pause("WinActivate FAILED") ;~ Send("{UP 100}") ;try#5 - what the heck is going on? same strange fail as #3 ;$x = WinActivate($idListview) ;try $idListview ;~ $x = WinActivate($hGUI) ;try Main GUI ;~ If $x <> $idListview Then Pause("WinActivate FAILED") ;~ MouseWheel($MOUSE_WHEEL_UP, 100) ;_GUIScrollBars_ScrollWindow($hGUI, 0, 100) ;NO - moves the ListView window in the $hGUI ;_GUIScrollBars_ScrollWindow($idListview, 0, 100) ;does not seem to work ;_GUIScrollBars_SetScrollInfoPos($hGUI, $SB_VERT, 30) ;does not work ;_GUIScrollBars_SetScrollInfoPos($idListview, $SB_VERT, 30) ;does not work ;I'm doing something very basic wrong. I need help. Pause("Scrollbar thumb should be at Top") Case $bBottom Pause("In: Case $bBottom") Pause("Scroll bar should be at BOttom") EndSwitch WEnd GUIDelete($idListView) EndFunc ;Func Example() Func Pause($text="") MsgBox(262144, "DEBUG", "Paused: " & $text) EndFunc- 3 replies
-
- scrollbar
- scrollbar thumb
-
(and 2 more)
Tagged with:
-
Hi everyone, I have created a ListView that is in a tab, and I want to display an image in that tab, with the ListView on top. However, the image still appears on top of my ListView. If I remove the tabs everything works. I looked at the autoit documentation and the <GuiListView.au3> documentation , I can't figure out how to display a background image, and put on top a ListView, inside a tab. 😥 Here is the code: Opt("GUIOnEventMode", 1) $Form1 = GUICreate($Titre, 700, 627, $Form1Width, $Form1Height); main window $tabulation = GUICtrlCreateTab(148,0,700,580); creating tabs $tab1=GUICtrlCreateTabItem("Tab 1"); first tab GUICtrlSetState(-1, $GUI_SHOW); this tab is selected by default $Pic1 = GUICtrlCreatePic("image.jpg", 0, 30, 700, 627) GUICtrlSetState(-1, $GUI_DISABLE). $idListview = GUICtrlCreateListView("list 1|list 2|list 3", 200, 50, 390, 200) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Thank you in advance.
-
Hello all. It's me again. I've got a ListView with an associated ImageList to display icons. What I seem to be hung up on is how to keep the ImageList updated to match the ListView as the latter changes. I thought it was the case that the indices of the items in the ListView and those in the ImageList just needed to match. So, for example, if I: Delete an item from the ListView [_GUICtrlListView_DeleteItem()], and also delete the image at the matching index in the ImageList [_GUIImageList_Remove()]. Then add a new item to the end of the ListView [_GUICtrlListView_AddItem()], and correspondingly add an image at the end of the ImageList [_GUIImageList_AddIcon()] Shouldn't everything stay in sync? Here's the code I thought would work: #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <FontConstants.au3> #include <WindowsConstants.au3> #include <GuiImageList.au3> Test() func Test() $gui = GUICreate("Test", 400, 300) ; Create ListView $lv = _GUICtrlListView_Create($gui, "", 10, 10, 380, 240, $LVS_DEFAULT) _GUICtrlListView_AddColumn($lv, "Col1", 50) _GUICtrlListView_AddColumn($lv, "Col2", 50) for $i = 0 to 2 $s = StringFormat("%d,1", $i+1) _GUICtrlListView_AddItem($lv, $s, $i) $s = StringFormat("%d,2", $i+1) _GUICtrlListView_AddSubItem($lv, $i, $s, 1) next ; Add ImageList $img_list = _GUIImageList_Create(16, 16, 5, 3) for $i = 0 to 2 $ico = StringFormat("%d.ico", $i+1) _GUIImageList_AddIcon($img_list, $ico) next _GUICtrlListView_SetImageList($lv, $img_list, 1) ; $btn = GUICtrlCreateButton("Test", 10, 260, 60, 30) GUISetState(@SW_SHOW) HotKeySet("^q", Quit) ; Loop until the user exits. while True switch GUIGetMsg() case $GUI_EVENT_CLOSE Exit case $btn ; Remove 2nd list item and image _GUICtrlListView_DeleteItem($lv, 1) _GUIImageList_Remove($img_list, 1) ; Add new item to end of ListView $idx = _GUICtrlListView_AddItem($lv, "foo") _GUICtrlListView_AddSubItem($lv, $idx, "bar", 1) ; Add new image to end of ImageList _GUIImageList_AddIcon($img_list, "5.ico") endswitch wend GUIDelete() endfunc func Quit() Exit endfunc What seems to happen is that when the new item is added to the ListView, its icon is 1.ico (the first item in the ImageList), rather than 5.ico (the newly added item that should be at the end of the ImageList). Or do I need to re-create the whole ImageList any time the ListView changes? A zip file is attached that contains the script and also the .ico files, for easier testing. Thanks! /John test.zip
-
I have the following code. You can see there are $color_normal and $color_trans In my case normal is too dark . And color trans is to much violet. If you run it you will see how its looks. I want gui with listView have the same color like taskbar in windows 10. How to achieve that? #include <Date.au3> #include <MsgBoxConstants.au3> #include <GuiListBox.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> HotKeySet("{ESC}", "Terminate") $color_normal = "0x" & StringLeft(StringRight(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent", "AccentPalette"), 24), 6) $color_trans = "0x" & StringLeft(StringRight(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent", "AccentPalette"), 16), 6) $trans = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "EnableTransparency") ConsoleWrite("Transpart = " & $trans & @CRLF) ConsoleWrite("Color normal = " & $color_normal & @CRLF) ConsoleWrite("Color trans = " & $color_trans & @CRLF) ConsoleWrite(_Get_taskbar_color()); It return AARRGGBB $taskbarColor = _Get_taskbar_color() Global $gui = GUICreate("Test", 150, 58,@DesktopWidth-300,@DesktopHeight-58,$WS_POPUP,BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) Global $idListview = GUICtrlCreateListView("", 0, 0, 150, 58,BitOR($LBS_NOTIFY,$LBS_SORT), 0) ;_GuiCtrlMakeTrans(-1,100) ; Add column _GUICtrlListView_AddColumn($idListview, "Msgs", 100) GUICtrlSetFont(-1, 7, 400, 0, "Segoe UI") GUICtrlSetColor(-1, 0x470C4F) GUICtrlSetBkColor($idListview, 0x310638) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Terminate() Exit EndFunc Func _Get_taskbar_color() If RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "ColorPrevalence") Then If RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "EnableTransparency") Then Return "0xD9" & StringLeft(StringRight(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent", "AccentPalette"), 16), 6) Else Return "0xFF" & StringLeft(StringRight(RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent", "AccentPalette"), 24), 6) EndIf Else If RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "EnableTransparency") Then Return "0xD9000000" Else Return "0xFF000000" EndIf EndIf EndFunc
-
Hello everybody, #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GUIListViewEx.au3> $Form1 = GUICreate("Form1", 539, 350, 192, 124) $ListView1 = GUICtrlCreateListView("CLM1|CLM2", 0, 0, 538, 326) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 150) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 150) Local $dynamic = GUICtrlCreateListViewItem("Example1|Example2", $ListView1) $SubMenu = GUICtrlCreateContextMenu($dynamic) $Run = GUICtrlCreateMenuItem("Run", $SubMenu) $Edit = GUICtrlCreateMenuItem("Edit", $SubMenu) $Delete = GUICtrlCreateMenuItem("Delete", $SubMenu) Local $dynamic2 = GUICtrlCreateListViewItem("Example3|Example6", $ListView1) $SubMenu = GUICtrlCreateContextMenu($dynamic2) $Run = GUICtrlCreateMenuItem("Run", $SubMenu) $Edit = GUICtrlCreateMenuItem("Edit", $SubMenu) $Delete = GUICtrlCreateMenuItem("Delete", $SubMenu) _GUIListViewEx_Init($ListView1, "", 0, 0, True, 64) _GUIListViewEx_MsgRegister() GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I use GUIListViewEx.au3 for position of items in listview but when I move one the context menu disappear. Any solution of this? Any method than array it is possible? Thank you, appreciate it.
-
Hello everybody, I download the GUIListViewEx.au3 by Melba23 in order to move up or down my items from a listview. Everything it's looking good in script but when I move an item it will crash. Any suggestions? Thank you!
-
Hello everybody, Sorry for my bad english. I try to figure out if I have a dynamic listview with as many items as I want, how to save to a text file all the data listview contains in the same form that you put when you create a listviewitem. I will give you an example. When the script is running it will show you the listview and some items. How to take the items data "Data1|Data1_Sub1|Data1_Sub2" in this format and paste into a text file? All of them. I tried to explain as good as I can. Thank you for your attention! #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> $Form_Menu = GUICreate("Form Example", 351, 234, -1, -1) $Form_Menu_ListView1 = GUICtrlCreateListView("Column #1|Column #2|Column #3", 0, 0, 346, 230) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 75) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 75) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 75) GUICtrlCreateListViewItem("Data1|Data1_Sub1|Data1_Sub2", $Form_Menu_ListView1) GUICtrlCreateListViewItem("Data2|Data2_Sub1|Data2_Sub2", $Form_Menu_ListView1) GUICtrlCreateListViewItem("DataN|DataN_SubN|DataN_SubN", $Form_Menu_ListView1) ;The data that appear in the listview be saved in a file like that : #cs Data1|Data1_Sub1|Data1_Sub2 Data2|Data2_Sub1|Data2_Sub2 DataN|DataN_SubN|DataN_SubN #ce GUISetState(@SW_SHOW, $Form_Menu) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
-
Hello, I tried with many methods and searched a lot for items to move up and down but couldn't find it. Sorry for my bad english. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 307, 247, 192, 124) GUISetFont(10, 400, 0, "Arial") $ListView1 = GUICtrlCreateListView("C1|C2|C3", 0, 0, 250, 246) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 100) GUICtrlCreateListViewItem("Test1|Test2|Test3", $ListView1) GUICtrlCreateListViewItem("Cat|Dog|Fish", $ListView1) GUICtrlCreateListViewItem("ABC|DEF|GHI", $ListView1) $Button1 = GUICtrlCreateButton("/\", 264, 8, 27, 25) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Button2 = GUICtrlCreateButton("\/", 264, 40, 27, 25) GUICtrlSetFont(-1, 10, 800, 0, "Arial") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ;up Case $Button2 ;down EndSwitch WEnd Thank you for your help!
-
Hey guys, I ran into a problem when I wanted to delete items of a listview using the delete key. My approach is to register my own WndProc for the listview and then filter the $WM_GETDLGCODE msg and then call the original WndProc. That works like a charm. The problem is that when the listview gets redrawn it somehow ends up in an infinite loop. The listview is suddenly emtpy and I can't interact with any controls of the GUI at all. Here's the code: #include <GUIConstantsEx.au3> #include <GUIListView.au3> #include <WinAPI.au3> $h_GUI = GUICreate("Test", 200, 200, 350, 350) $h_LV = GUICtrlCreateListView("Col 1|Col 2|Col 3", 0, 0, 200, 200) _GUICtrlListView_AddItem($h_LV, "") _GUICtrlListView_AddSubItem($h_LV, 0, "bla0", 0) _GUICtrlListView_AddSubItem($h_LV, 0, "bla0", 1) _GUICtrlListView_AddSubItem($h_LV, 0, "bla0", 2) _GUICtrlListView_AddItem($h_LV, "") _GUICtrlListView_AddSubItem($h_LV, 1, "bla1", 0) _GUICtrlListView_AddSubItem($h_LV, 1, "bla1", 1) _GUICtrlListView_AddSubItem($h_LV, 1, "bla1", 2) _GUICtrlListView_AddItem($h_LV, "") _GUICtrlListView_AddSubItem($h_LV, 2, "bla2", 0) _GUICtrlListView_AddSubItem($h_LV, 2, "bla2", 1) _GUICtrlListView_AddSubItem($h_LV, 2, "bla2", 2) _GUICtrlListView_AddItem($h_LV, "") _GUICtrlListView_AddSubItem($h_LV, 3, "bla3", 0) _GUICtrlListView_AddSubItem($h_LV, 3, "bla3", 1) _GUICtrlListView_AddSubItem($h_LV, 3, "bla3", 2) $h_LV_NewWndProc = DllCallbackRegister("WndProc_LV", "int", "hwnd;uint;wparam;lparam") $g_LV_OldWndProc = _WinAPI_SetWindowLong(GUICtrlGetHandle($h_LV), $GWL_WNDPROC, DllCallbackGetPtr($h_LV_NewWndProc)) GUISetState(@SW_SHOW) Func WndProc_LV($hWnd, $uMsg, $wParam, $lParam) Return _WinAPI_CallWindowProc($g_LV_OldWndProc, $hWnd, $uMsg, $wParam, $lParam) EndFunc ;==>WndProc_GUI Do Until GUIGetMsg() = $GUI_EVENT_CLOSE DllCallbackFree($h_LV_NewWndProc) As you can see I'm doing nothing in the WndProc of the listview. I'm simply calling the original WndProc. This still "freezes" when I mess with the width of the columns or in the original project when I add more items that they don't fit in the listview and I have to scroll. If I don't do that it's working fine.
-
I have Local $idListview = GUICtrlCreateListView("",8,8,@DesktopWidth/2-16,@DesktopHeight-150,$LVS_SHOWSELALWAYS, _ $LVS_EX_INFOTIP) Local $hListView = GUICtrlGetHandle($idListview) _GUICtrlListView_InsertColumn($hListview, 0, "Filename", 400) _GUICtrlListView_InsertColumn($hListview, 1, "Ext", 50) _GUICtrlListView_InsertColumn($hListview, 2, "Size",70) _GUICtrlListView_InsertColumn($hListview, 3, 'Date time',100) _GUICtrlListView_InsertColumn($hListview, 4, "Path", 385) _GUICtrlListView_InsertColumn($hListview, 5, "sizeInt", 0) _GUICtrlListView_JustifyColumn($hListview, $kSize,1) ; right align then further on While True $sFnamExt = FileFindNextFile($iSrch) If @error Then ExitLoop EndIf $sAtts = FileGetAttrib($sPath&'\'&$sFnamExt) If StringInStr($sAtts,'D') Then If $sFnamExt<>'$RECYCLE.BIN' Then $sDirs &= '?'&$sPath&'\'&$sFnamExt EndIf Else $p = StringInStr($sFnamExt,'.',0,-1) ; last If $p=0 Then $sFnam = $sFnamExt $sExt = '' Else $sFnam = StringLeft($sFnamExt,$p-1) $sExt = StringTrimLeft($sFnamExt,$p) EndIf _GUICtrlListView_AddItem($hListview,$sFnam,-1,_GUICtrlListView_GetItemCount($hListview)+1000) _GUICtrlListView_AddSubItem($hListview,$nItem,$sExt,$kExt) $nSize = FileGetSize($sPath&'\'&$sFnamExt) $sSize = AddThousandsSeparator($nsize) _GUICtrlListView_AddSubItem($hListview,$nItem,$sSize,$kSize) _GUICtrlListView_AddSubItem($hListview,$nItem,$nsize,$kSizeInt) $nTotBytes += $nSize $a1 = FileGetTime($sPath&'\'&$sFnamExt,$FT_MODIFIED,$FT_ARRAY) $t = $a1[0]&'-'&$a1[1]&'-'&$a1[2]&' '&$a1[3]&':'&$a1[4] _GUICtrlListView_AddSubItem($hListview,$nItem,$t,$kDateTime) _GUICtrlListView_AddSubItem($hListview,$nItem,$sPath,$kPath) If $gSQL Then $s = "Insert into tbl values ("&_SQLite_Escape($sFnam)&","&_SQLite_Escape($sExt)&",'"& _ $sSize&"','"& _ $t&"',"&_SQLite_Escape($sPath)&","&$nSize&")" _SQLite_Exec(-1,$s) If @error Then MsgBox(0,@ScriptLineNumber,_SQLite_ErrMsg()) EndIf EndIf EndIf WEnd FileClose($iSrch) You will see that I heeded the advice in Help > _GUICtrlListView_AddItem: "As AutoIt uses the $iParam parameter to store the controlID of native-created ListView items, this value should be set sufficiently high for UDF-created items to avoid possible conflict with any existing controls - a starting value of 1000 is recommended." (It's unfortunate that the Example does not heed this advice. OK, it doesn't need to because there are no other controls, but still --- it would help neophytes if it did. Also to me _GUICtrlListView_AddItem is not native because it is a UDF. Confused?) My script then does a sort using SQLite, and updates the ListView: Local $hQuery Local $colNames = ['fnam','ext','nsize','dateTime','path','SizeInt'] Local $s = "Select * FROM tbl ORDER BY "&$colNames[$ncol]&';' _SQLite_Query(-1,$s, $hQuery) If @error Then MsgBox(0,@ScriptLineNumber,_SQLite_ErrMsg()) EndIf Local $aRow[$kSizeInt+1] Local $iItem=-1 While _SQLite_FetchData($hQuery, $aRow, False, False) = $SQLITE_OK ; Read Out the next Row If @error Then MsgBox(0,@ScriptLineNumber,_SQLite_ErrMsg()) EndIf $iItem += 1 For $i = $kFnam To $kSizeInt _GUICtrlListView_SetItem($hListview,$aRow[$i],$iItem,$i,Default) Next WEnd This works, but I had earlier coded _GUICtrlListView_SetItem($hListview,$aRow[$i],$iItem,$i,Default,$iItem+1000) because the same advice is in the Help for this function. So my care in specifying $param back-fired! What am I not understanding? The only difference in what works is that the $param parameter is defaulted.
-
Good evening everyone I am building a management for the company I work with, and I just imported a real amount of rows ( about 29000 ), in my SQLite DB. The thing I am not understanding, is the time that the script takes to build this amount of rows in the ListView. I didn't measure it, but I think it took 2 minutes or so to create each ListView item... It is normal that it takes so much time? What can I do to improve the creation of the items? Here's the code I am using to query and to create ListView items... ; Articles ListView: Global $lvwArticles = GUICtrlCreateListView("ID|Fornitore|Codice|Descrizione|EU|Prezzo|Sconto Applicato|Note", 14, 87, 1507, 660, BitOR($GUI_SS_DEFAULT_LISTVIEW,$LVS_SORTASCENDING,$LVS_SORTDESCENDING), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT)) ; Query $strQuery = "SELECT * FROM ARTICOLI;" ; Query Execution _SQLite_GetTable2d($objDatabase, $strQuery, $arrResult, $intRows, $intColumns) If @error Then ; Error Handling Else ; Cleaning the ListView _GUICtrlListView_DeleteAllItems($lvwArticles) If @error Then ; Error Handling Else ; No records in the Table If UBound($arrResult) < 2 Then ; Error Handling Else _GUICtrlListView_BeginUpdate($lvwArticles) For $intCounter = 1 To UBound($arrResult) - 1 $strListViewItem = $arrResult[$intCounter][0] & "|" & _ $arrResult[$intCounter][1] & "|" & _ $arrResult[$intCounter][2] & "|" & _ $arrResult[$intCounter][3] & "|" & _ $arrResult[$intCounter][4] & "|" & _ $arrResult[$intCounter][5] & "|" & _ $arrResult[$intCounter][6] & "|" & _ $arrResult[$intCounter][7] $objListViewItem = GUICtrlCreateListViewItem($strListViewItem, $lvwArticles) Next _GUICtrlListView_EndUpdate($lvwArticles) EndIf EndIf EndIf Thanks in advance Best Regards.
-
Hello AutoIt community, I have a question for you. I have 3 separate ListViews which need to be auto sized to the GUI width / height. I've looked around the forum for a day or two and have tried using the WM_SIZE method, which after playing with it, I've realized that not everyone's screen is the same and hardcoding it could be troublesome. So, I'm thinking I need to come up with a better way of resizing my ListViews to my GUI. Does anyone have any suggestions on different ways of achieving this goal? Example script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon= #AutoIt3Wrapper_Outfile= #AutoIt3Wrapper_Res_Comment= #AutoIt3Wrapper_Res_Description= #AutoIt3Wrapper_Res_Fileversion= #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <Constants.au3> #include <GUIListBox.au3> #include <GuiListView.au3> #include <Array.au3> #include <ButtonConstants.au3> #include <ScrollBarConstants.au3> #include <Misc.au3> #include <GuiScrollBars.au3> ;~ #include <GUIListViewEx.au3> Local $List1, $List2, $List3, $List4, $lp_Buffer = 0 Local $List1Ex, $List2Ex, $List3Ex GUI() GUIRegisterMsg($WM_SIZE, "WM_SIZE") _GUIScrollBars_EnableScrollBar(ControlGetHandle("", "", $List2), $SB_BOTH, $ESB_DISABLE_BOTH) _GUIScrollBars_EnableScrollBar(ControlGetHandle("", "", $List3), $SB_BOTH, $ESB_DISABLE_BOTH) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Quit() EndSwitch WEnd ;END MAIN LINE Func Quit() Exit EndFunc ;==>Quit Func GUI() Local $Index, $LV1, $LV2, $LV3 $GUIhandle = GUICreate("tester", 680, 575, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX) ;creates the parent window GUICtrlSetResizing(-1, $GUI_DOCKAUTO) ;;allows resizing of full window $List1 = _GUICtrlListView_Create($GUIhandle, "Computer Name", 20, 35, 300, 448, -1, $LVS_EX_DOUBLEBUFFER) ;;$ES_READONLY incase you don't want to be able to select text ;~ $List1Ex = _GUIListViewEx_Init($List1, "") _GUICtrlListView_SetExtendedListViewStyle($List1, $LVS_EX_TWOCLICKACTIVATE) $List2 = _GUICtrlListView_Create($GUIhandle, "Date/Time", 355, 35, 190, 450, -1, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_FLATSB)) ;~ $List1Ex = _GUIListViewEx_Init($List2, "") $List3 = _GUICtrlListView_Create($GUIhandle, "Speed", 574, 35, 95, 450, -1, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_FLATSB)) ;~ $List1Ex = _GUIListViewEx_Init($List3, "") GUICtrlCreateLabel("Additional Info", 20, 489) ;creates the label for $List4 GUICtrlSetResizing(-1, $GUI_DOCKSIZE) $List4 = GUICtrlCreateList("", 20, 512, 635, 40, BitOR($WS_BORDER, $WS_VSCROLL), $ES_READONLY) GUICtrlSetResizing($List4, $GUI_DOCKAUTO) GUICtrlCreateLabel("Active Connections: ", 525, 487) ;creates the label for the active connections GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUISetState(@SW_SHOW) ;shows the GUI window For $Index = 0 To 100 Step 1 $LV1 = _GUICtrlListView_AddItem($List1, " ") ;adds a default value into $List1 $LV2 = _GUICtrlListView_AddItem($List2, " ") ;adds a default value into $List2 $LV3 = _GUICtrlListView_AddItem($List3, " ") ;adds a default value into $List3 Next EndFunc ;==>GUI ;===========MAXIMIZE THE WINDOW TO SEE HOW THIS TRULY FUNCTIONS===============; Func WM_SIZE($hWnd, $msg, $wParam, $lParam) $iWidth = BitAND($lParam, 0xFFFF) ; _WinAPI_LoWord $iHeight = BitShift($lParam, 16) ; _WinAPI_HiWord If $lParam > $lp_Buffer Then _WinAPI_MoveWindow($List1, 20, 35, $iWidth - 1200, 900) Else _WinAPI_MoveWindow($List1, 20, 35, $iWidth - 400, 448) EndIf $lp_Buffer = $lParam Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Any reply is much appreciated.
-
I am tracking this topic by @LarsJ. It is very advanced and overkill for what I am currently trying to do. Problem is this. Listview contains columns, one of which is right aligned and gets populated by float values, such as 123.99. Some do not have decimals ie 124.00 and on sort gets truncated to 124. Its obviously still the same value, but the display has reset. ; line below is for list VIEW ;..................................0.........1......2............ $cListView = GUICtrlCreateListView("CUSTOMER|AMOUNT|DESCRIPTION", 8, 152, 764, 279) GUICtrlSetBkColor($cListView, $GUI_BKCOLOR_LV_ALTERNATE) ; alternate between the listview background color and the listview item background color GUICtrlSetBkColor($cListView, $LVStdClr) ; Set the background color for the listview _GUICtrlListView_SetColumnWidth($cListView, 0, 120) ; -- the client name _GUICtrlListView_SetColumnWidth($cListView, 1, 90) ;-- the amount _GUICtrlListView_JustifyColumn($cListView, 1, 1) ; 1 - Text is right aligned _GUICtrlListView_SetColumnWidth($cListView, 2, 200) ; the description What I am looking for is something native and simple like a _GUICtrlListView_SetColumnFormat($cListView, 1, "%.2f") ; 1 - column is stringformatted to "%.2f" So that after each sort it will appear as it was in the original rendering. Is there something like this? I have not been able to find a simple solution. Thanks. Skysnake
-
ListView Change text Colour not working for me
Ambient posted a topic in AutoIt GUI Help and Support
I have tried several way sto get this to work to no avail. Any help would be appreciated. #include <ListViewConstants.au3> #include <GuiListView.au3> #include "GuiListViewEx.au3" $idItem = GUICtrlCreateListViewItem($r & " | " & $c & $adoRs.Fields("TransactionAmount").value & " | " & $Timestamp & " | " & _StringProper($adoRs.Fields("Tillid").value) & @CRLF & @CRLF & "Card Number : " & $cardnum & " " , $idListView) ConsoleWrite( "IDITEM" & $idItem) If STRINGLEFT($adoRs.Fields("TransactionAmount").value,1)= "-" Then Consolewrite(" String is Negative" & @CRLF) ;Drops in Here as expected ;GUICtrlSetColor(-1, $COLOR_RED) ; Colour line if item is negative this didn' work $TxC= _GUICtrlListView_SetTextColor($hListView, $CLR_RED) ; I also tried $TxC= _GUICtrlListView_SetTextColor(-1, 0xFF0000) CONSOLEWRITE("TEXTCOLOUR RETURNED " & $TxC & @crlf) ; This is returning True ELSE Consolewrite(" String is NOT Negative" & @CRLF) EndIf -
Example of Subclassing listviews using setwindowSubclass in order to intercept WM_KEYUP events Also pops context menu on Shift + F10 #include <Misc.au3> #include <ListViewConstants.au3> #include <GUIConstants.au3> #include <GuiMenu.au3> #include <WinAPIShellEx.au3> Global $g_hCB, $g_pCB, $g_ahProc[2][2] ;Stores the Data for subclassing listview Global $g_LVKEYUP = 0xFE00, $g_LVKEYDN = 0xFD00 ;Our Own Custom messages (Key Up/Dn) Global $g_iDummyData Global $g_hGui = GUICreate("test") Global $g_hList1 = GUICtrlCreateListView("#|x|y", 5, 24, 161, 70, $LVS_SHOWSELALWAYS Or $LVS_SINGLESEL) GUICtrlCreateListViewItem("text", $g_hList1) Global $g_hList1_LVN = GUICtrlCreateDummy() ;Recieves Messages from the callback Global $g_hContext1 = GUICtrlCreateContextMenu($g_hList1) GUICtrlCreateMenuItem("1", $g_hContext1) GUICtrlCreateMenuItem("2", $g_hContext1) Global $g_hList2 = GUICtrlCreateListView("#|x|y", 5, 100, 161, 70, $LVS_SHOWSELALWAYS Or $LVS_SINGLESEL) GUICtrlCreateListViewItem("text", $g_hList2) Global $g_hList2_LVN = GUICtrlCreateDummy() ;Recieves Messages from the callback Global $g_hContext2 = GUICtrlCreateContextMenu($g_hList2) GUICtrlCreateMenuItem("3", $g_hContext2) GUICtrlCreateMenuItem("4", $g_hContext2) GUISetState(@SW_SHOW) SubClassListView() ;Creates our subclass Func SubClassListView() OnAutoItExitRegister("Cleanup") ;to remove our subclass $g_hCB = DllCallbackRegister('_SubclassProc', 'lresult', 'hwnd;uint;wparam;lparam;uint_ptr;dword_ptr') $g_pCB = DllCallbackGetPtr($g_hCB) $g_ahProc[0][0] = $g_hList1 ;Add the Ids of the controls we'd like to subclass $g_ahProc[1][0] = $g_hList2 ;Set up the subclass _WinAPI_SetWindowSubclass ( $hWnd, $pSubclassProc, $idSubClass [, $pData = 0] ) $g_ahProc[0][1] = _WinAPI_SetWindowSubclass(GUICtrlGetHandle($g_ahProc[0][0]), $g_pCB, $g_ahProc[0][0], $g_hList1_LVN) $g_ahProc[1][1] = _WinAPI_SetWindowSubclass(GUICtrlGetHandle($g_ahProc[1][0]), $g_pCB, $g_ahProc[1][0], $g_hList2_LVN) EndFunc ;==>SubClassListView Func _SubclassProc($hWnd, $iMsg, $wParam, $lParam, $iID, $pData) #forceref $iID Local $iRtnMsg = 0 ;Events we'd like to intercept If $iMsg = $WM_KEYUP Or $iMsg = $WM_SYSKEYUP Then $iRtnMsg = $g_LVKEYUP ElseIf $iMsg = $WM_KEYDOWN Or $iMsg = $WM_SYSKEYDOWN Then $iRtnMsg = $g_LVKEYDN EndIf ;We Recieve the Id of the dummy through $pData and pass our RtnMsg to the dummy control If $iRtnMsg Then GUICtrlSendToDummy($pData, BitOR($iRtnMsg, $wParam)) ;Pass messages on to the default handler Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_SubclassProc Func Cleanup() For $i = 0 To UBound($g_ahProc) - 1 ;Remove Our Subclass' by setting it back to the original proc _WinAPI_RemoveWindowSubclass(GUICtrlGetHandle($g_ahProc[$i][0]), DllCallbackGetPtr($g_ahProc[$i][1]), $g_ahProc[$i][0]) Next DllCallbackFree($g_hCB) EndFunc ;==>Cleanup While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $g_hList1_LVN ;This is just a dummy it only recieves events ConsoleWrite("LV1 EVENT 0x" & Hex($g_iDummyData, 4) & @CRLF) $g_iDummyData = GUICtrlRead($g_hList1_LVN) ;Retrieve the code that was sent Switch BitAND($g_iDummyData, 0xFF00) ;Get the keyup/dn status Case $g_LVKEYDN If BitAND($g_iDummyData, 0x00FF) = 0x79 And (_IsPressed("A0") Or _IsPressed("A1")) Then ;Right/ Left Shift & F10 ShowMenu($g_hGui, $g_hList1, $g_hContext1) Else ConsoleWrite("Lv1 KeyDn Vk: 0x" & Hex(BitAND($g_iDummyData, 0x00FF), 2) & @CRLF) ;Get the Virtual keycode EndIf Case $g_LVKEYUP ConsoleWrite("Lv1 KeyUp Vk: 0x" & Hex(BitAND($g_iDummyData, 0x00FF), 2) & @CRLF) ;Get the Virtual keycode EndSwitch Case $g_hList2_LVN $g_iDummyData = GUICtrlRead($g_hList2_LVN) ;Retrieve the code that was sent ConsoleWrite("LV2 EVENT 0x" & Hex($g_iDummyData, 4) & @CRLF) Switch BitAND($g_iDummyData, 0xFF00) ;Get the keyup/dn status Case $g_LVKEYDN ConsoleWrite("Lv2 KeyDn Vk: 0x" & Hex(BitAND($g_iDummyData, 0x00FF), 2) & @CRLF) ;Get the Virtual keycode Case $g_LVKEYUP ConsoleWrite("Lv2 KeyUp Vk: 0x" & Hex(BitAND($g_iDummyData, 0x00FF), 2) & @CRLF) ;Get the Virtual keycode EndSwitch EndSwitch WEnd Func ShowMenu($hWnd, $idCtrl, $idContext) Local $aPos, $iX, $iY Local $hMenu = GUICtrlGetHandle($idContext) $aPos = ControlGetPos($hWnd, "", $idCtrl) $iX = $aPos[0] $iY = $aPos[1] + $aPos[3] ClientToScreen($hWnd, $iX, $iY) ; Show at the given coordinates (x, y) the popup menu (hMenu) which belongs to a given GUI window (hWnd) _GUICtrlMenu_TrackPopupMenu($hMenu, $hWnd, $iX, $iY) EndFunc ;==>ShowMenu ; Convert the client (GUI) coordinates to screen (desktop) coordinates Func ClientToScreen($hWnd, ByRef $iX, ByRef $iY) Local $tPoint = DllStructCreate("int;int") DllStructSetData($tPoint, 1, $iX) DllStructSetData($tPoint, 2, $iY) DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "struct*", $tPoint) $iX = DllStructGetData($tPoint, 1) $iY = DllStructGetData($tPoint, 2) ; release Struct not really needed as it is a local $tPoint = 0 EndFunc ;==>ClientToScreen Old Code Using setWindowLong
-
Literally just a list of listview styles / extended styles and WS / WSEX styles prints them in the console by their name ;Debug ;Debug_GetLvMStyles($g_hListView) ;Debug_GetHDStyles($g_hListView) ;Debug_GetWSStyles($g_hListView) ;Debug_GetWSStyles($g_hWnd) ;;#include <ListViewConstants.au3> Func Debug_GetLvMStyles($hListView) Local $LVStyle = _WinAPI_GetWindowLong($hListView, -16) Local $LVExStyle = _GUICtrlListView_GetExtendedListViewStyle($hListView) Local $sLVSTYLES Local $sLVExSTYLES If @error Then ConsoleWrite(" Error Debug_GetLvMStyles Couldn't retrieve Styles") Return EndIf If BitAND($LVStyle, $LVS_ALIGNLEFT) Then $sLVSTYLES &= "$LVS_ALIGNLEFT, " If BitAND($LVStyle, $LVS_ALIGNMASK) Then $sLVSTYLES &= "$LVS_ALIGNMASK, " If BitAND($LVStyle, $LVS_ALIGNTOP) Then $sLVSTYLES &= "$LVS_ALIGNTOP, " If BitAND($LVStyle, $LVS_AUTOARRANGE) Then $sLVSTYLES &= "$LVS_AUTOARRANGE, " If BitAND($LVStyle, $LVS_DEFAULT) Then $sLVSTYLES &= "LVS_DEFAULT," If BitAND($LVStyle, $LVS_EDITLABELS) Then $sLVSTYLES &= "LVS_EDITLABELS, " If BitAND($LVStyle, $LVS_ICON) Then $sLVSTYLES &= "LVS_ICON, " If BitAND($LVStyle, $LVS_LIST) Then $sLVSTYLES &= "LVS_LIST, " If BitAND($LVStyle, $LVS_NOCOLUMNHEADER) Then $sLVSTYLES &= "LVS_NOCOLUMNHEADER, " If BitAND($LVStyle, $LVS_NOLABELWRAP) Then $sLVSTYLES &= "LVS_NOLABELWRAP, " If BitAND($LVStyle, $LVS_NOSCROLL) Then $sLVSTYLES &= "LVS_NOSCROLL, " If BitAND($LVStyle, $LVS_NOSORTHEADER) Then $sLVSTYLES &= "LVS_NOSORTHEADER, " If BitAND($LVStyle, $LVS_OWNERDATA) Then $sLVSTYLES &= "LVS_OWNERDATA, " If BitAND($LVStyle, $LVS_OWNERDRAWFIXED) Then $sLVSTYLES &= "LVS_OWNERDRAWFIXED, " If BitAND($LVStyle, $LVS_REPORT) Then $sLVSTYLES &= "LVS_REPORT, " If BitAND($LVStyle, $LVS_SHAREIMAGELISTS) Then $sLVSTYLES &= "LVS_SHAREIMAGELISTS, " If BitAND($LVStyle, $LVS_SHOWSELALWAYS) Then $sLVSTYLES &= "LVS_SHOWSELALWAYS, " If BitAND($LVStyle, $LVS_SINGLESEL) Then $sLVSTYLES &= "LVS_SINGLESEL, " If BitAND($LVStyle, $LVS_SMALLICON) Then $sLVSTYLES &= "LVS_SMALLICON, " If BitAND($LVStyle, $LVS_SORTASCENDING) Then $sLVSTYLES &= "LVS_SORTASCENDING, " If BitAND($LVStyle, $LVS_SORTDESCENDING) Then $sLVSTYLES &= "LVS_SORTDESCENDING, " If BitAND($LVStyle, $LVS_TYPEMASK) Then $sLVSTYLES &= "LVS_TYPEMASK, " If BitAND($LVStyle, $LVS_TYPESTYLEMASK) Then $sLVSTYLES &= "LVS_TYPESTYLEMASK, " If BitAND($LVExStyle, $LVS_EX_AUTOAUTOARRANGE) Then $sLVExSTYLES &= "$LVS_EX_AUTOARRANGE, " If BitAND($LVExStyle, $LVS_EX_AUTOCHECKSELECT) Then $sLVExSTYLES &= "$LVS_EX_AUTOCHECKSELECT, " If BitAND($LVExStyle, $LVS_EX_AUTOSIZECOLUMNS) Then $sLVExSTYLES &= "$LVS_EX_AUTOSIZECOLUMNS, " If BitAND($LVExStyle, $LVS_EX_BORDERSELECT) Then $sLVExSTYLES &= "$LVS_EX_BORDERSELECT, " If BitAND($LVExStyle, $LVS_EX_CHECKBOXES) Then $sLVExSTYLES &= "$LVS_EX_CHECKBOXES, " If BitAND($LVExStyle, $LVS_EX_COLUMNOVERFLOW) Then $sLVExSTYLES &= "$LVS_EX_COLUMNOVERFLOW, " If BitAND($LVExStyle, $LVS_EX_COLUMNSNAPPOINTS) Then $sLVExSTYLES &= "$LVS_EX_COLUMNSNAPPOINTS, " If BitAND($LVExStyle, $LVS_EX_DOUBLEBUFFER) Then $sLVExSTYLES &= "$LVS_EX_DOUBLEBUFFER, " If BitAND($LVExStyle, $LVS_EX_FLATSB) Then $sLVExSTYLES &= "$LVS_EX_FLATSB, " If BitAND($LVExStyle, $LVS_EX_FULLROWSELECT) Then $sLVExSTYLES &= "$LVS_EX_FULLROWSELECT, " If BitAND($LVExStyle, $LVS_EX_GRIDLINES) Then $sLVExSTYLES &= "$LVS_EX_GRIDLINES, " If BitAND($LVExStyle, $LVS_EX_HEADERDRAGDROP) Then $sLVExSTYLES &= "$LVS_EX_HEADERDRAGDROP, " If BitAND($LVExStyle, $LVS_EX_HEADERINALLVIEWS) Then $sLVExSTYLES &= "$LVS_EX_HEADERINALLVIEWS, " If BitAND($LVExStyle, $LVS_EX_HIDELABELS) Then $sLVExSTYLES &= "$LVS_EX_HIDELABELS, " If BitAND($LVExStyle, $LVS_EX_INFOTIP) Then $sLVExSTYLES &= "$LVS_EX_INFOTIP, " If BitAND($LVExStyle, $LVS_EX_JUSTIFYCOLUMNS) Then $sLVExSTYLES &= "$LVS_EX_JUSTIFYCOLUMNS, " If BitAND($LVExStyle, $LVS_EX_LABELTIP) Then $sLVExSTYLES &= "$LVS_EX_LABELTIP, " If BitAND($LVExStyle, $LVS_EX_MULTIWORKAREAS) Then $sLVExSTYLES &= "$LVS_EX_MULTIWORKAREAS, " If BitAND($LVExStyle, $LVS_EX_ONECLICKACTIVATE) Then $sLVExSTYLES &= "$LVS_EX_ONECLICKACTIVATE, " If BitAND($LVExStyle, $LVS_EX_REGIONAL) Then $sLVExSTYLES &= "$LVS_EX_REGIONAL, " If BitAND($LVExStyle, $LVS_EX_SIMPLESELECT) Then $sLVExSTYLES &= "$LVS_EX_SIMPLESELECT, " If BitAND($LVExStyle, $LVS_EX_SNAPTOGRID) Then $sLVExSTYLES &= "$LVS_EX_SNAPTOGRID, " If BitAND($LVExStyle, $LVS_EX_SUBITEMIMAGES) Then $sLVExSTYLES &= "$LVS_EX_SUBITEMIMAGES, " If BitAND($LVExStyle, $LVS_EX_TRACKSELECT) Then $sLVExSTYLES &= "$LVS_EX_TRACKSELECT, " If BitAND($LVExStyle, $LVS_EX_TRANSPARENTBKGND) Then $sLVExSTYLES &= "$LVS_EX_TRANSPARENTBACKGROUND, " If BitAND($LVExStyle, $LVS_EX_TRANSPARENTSHADOWTEXT) Then $sLVExSTYLES &= "$LVS_EX_TRANSPARENTTEXTSHADOW, " If BitAND($LVExStyle, $LVS_EX_TWOCLICKACTIVATE) Then $sLVExSTYLES &= "$LVS_EX_TWOCLICKACTIVATE, " If BitAND($LVExStyle, $LVS_EX_UNDERLINECOLD) Then $sLVExSTYLES &= "$LVS_EX_UNDERLINECOLD, " If BitAND($LVExStyle, $LVS_EX_UNDERLINEHOT) Then $sLVExSTYLES &= "$LVS_EX_UNDERLINEHOT, " ConsoleWrite("Lv Styles= " & $sLVSTYLES & @CRLF) ConsoleWrite("Lv Ex Styles= " & $sLVExSTYLES & @CRLF) EndFunc ;==>Debug_GetLvMStyles ;;#include <HeaderConstants.au3> Func Debug_GetHDStyles($hListView) Local $hHeader = _GUICtrlListView_GetHeader($hListView) Local $HDStyle = _WinAPI_GetWindowLong($hHeader, -16) Local $sHDSTYLES If @error Then ConsoleWrite(" Error Debug_GetHDStyles Couldn't retrieve Styles") Return EndIf If BitAND($HDStyle, $HDS_BUTTONS) Then $sHDSTYLES &= "$HDS_STYLES, " ;0x00000002 ; Each item in the control looks and behaves like a push button If BitAND($HDStyle, $HDS_CHECKBOXES) Then $sHDSTYLES &= "$HDS_CHECKBOXES, " ;0x00000400 ; Allows the placing of checkbo ;es on header items on Vista If BitAND($HDStyle, $HDS_DRAGDROP) Then $sHDSTYLES &= "$HDS_DRAGDROP, " ;0x00000040 ; Allows drag-and-drop reordering of header items If BitAND($HDStyle, $HDS_FILTERBAR) Then $sHDSTYLES &= "$HDS_FILTERBAR, " ;0x00000100 ; Include a filter bar as part of the standard header control If BitAND($HDStyle, $HDS_FLAT) Then $sHDSTYLES &= "$HDS_FLAT, " ;0x00000200 ; Control is drawn flat when XP is running in classic mode If BitAND($HDStyle, $HDS_FULLDRAG) Then $sHDSTYLES &= "$HDS_FULLDRAG, " ;0x00000080 ; Column contents are displayed while the user resizes a column If BitAND($HDStyle, $HDS_HIDDEN) Then $sHDSTYLES &= "$HDS_HIDDEN, " ;0x00000008 ; Indicates a header control that is intended to be hidden If BitAND($HDStyle, $HDS_HORZ) Then $sHDSTYLES &= "$HDS_HORZ, " ;0x00000000 ; Creates a header control with a horizontal orientation If BitAND($HDStyle, $HDS_HOTTRACK) Then $sHDSTYLES &= "$HDS_HOTTRACK, " ;0x00000004 ; Enables hot tracking If BitAND($HDStyle, $HDS_NOSIZING) Then $sHDSTYLES &= "$HDS_NOSIZING, " ;0x0800 ; The user cannot drag the divider on the header control on Vista If BitAND($HDStyle, $HDS_OVERFLOW) Then $sHDSTYLES &= "$HDS_OVERFLOW, " ;0x1000 ; A button is displayed when not all items can be displayed within the header control's rectangle on Vista If BitAND($HDStyle, $HDS_DEFAULT) Then $sHDSTYLES &= "$HDS_DEFAULT, " ;0x00000046 ; Default header style $HDS_DRAGDROP + $HDS_HOTTRACK + $HDS_BUTTONS ConsoleWrite("Header Styles= " & $sHDSTYLES & @CRLF) EndFunc ;==>Debug_GetHDStyles Func Debug_GetWSStyles($hWnd) ;#include <WindowsConstants.au3> Local $WSStyle = _WinAPI_GetWindowLong($hWnd, -16) Local $sWSSTYLES Local $WSEXStyle = _WinAPI_GetWindowLong($hWnd, -20) ;_GUICtrlListView_GetExtendedListViewStyle($hListView); Local $sWSEXSTYLES If @error Then ConsoleWrite(" Error Debug_GetWSStyles Couldn't retrieve Styles") Return EndIf If BitAND($WSStyle, $WS_OVERLAPPED) Then $sWSSTYLES &= "$WS_OVERLAPPED, " If BitAND($WSStyle, $WS_TILED) Then $sWSSTYLES &= "$WS_TILED, " If BitAND($WSStyle, $WS_MAXIMIZEBOX) Then $sWSSTYLES &= "$WS_MAXIMIZEBOX, " ;0x00010000 If BitAND($WSStyle, $WS_MINIMIZEBOX) Then $sWSSTYLES &= "$WS_MINIMIZEBOX, " ;0x00020000 If BitAND($WSStyle, $WS_TABSTOP) Then $sWSSTYLES &= "$WS_TABSTOP, " ;0x00010000 If BitAND($WSStyle, $WS_GROUP) Then $sWSSTYLES &= "$WS_GROUP, " ;0x00020000 If BitAND($WSStyle, $WS_SIZEBOX) Then $sWSSTYLES &= "$WS_SIZEBOX, " ;0x00040000 If BitAND($WSStyle, $WS_THICKFRAME) Then $sWSSTYLES &= "$WS_THICKFRAME, " If BitAND($WSStyle, $WS_SYSMENU) Then $sWSSTYLES &= "$WS_SYSMENU, " ;0x00080000 If BitAND($WSStyle, $WS_HSCROLL) Then $sWSSTYLES &= "$WS_HSCROLL, " ;0x00100000 If BitAND($WSStyle, $WS_VSCROLL) Then $sWSSTYLES &= "$WS_VSCROLL, " ;0x00200000 If BitAND($WSStyle, $WS_DLGFRAME) Then $sWSSTYLES &= "$WS_DLGFRAME, " ;0x00400000 If BitAND($WSStyle, $WS_BORDER) Then $sWSSTYLES &= "$WS_BORDER, " ;0x00800000 If BitAND($WSStyle, $WS_CAPTION) Then $sWSSTYLES &= "$WS_CAPTION, " ;0x00C00000 If BitAND($WSStyle, $WS_OVERLAPPEDWINDOW) Then $sWSSTYLES &= "$WS_OVERLAPPEDWINDOW, " If BitAND($WSStyle, $WS_TILEDWINDOW) Then $sWSSTYLES &= "$WS_TILEDWINDOW, " If BitAND($WSStyle, $WS_MAXIMIZE) Then $sWSSTYLES &= "$WS_MAXIMIZE, " ;0x01000000 If BitAND($WSStyle, $WS_CLIPCHILDREN) Then $sWSSTYLES &= "$WS_CLIPCHILDREN, " ;0x02000000 If BitAND($WSStyle, $WS_CLIPSIBLINGS) Then $sWSSTYLES &= "$WS_CLIPSIBLINGS, " ;0x04000000 If BitAND($WSStyle, $WS_DISABLED) Then $sWSSTYLES &= "$WS_DISABLED, " ;0x08000000 If BitAND($WSStyle, $WS_VISIBLE) Then $sWSSTYLES &= "$WS_VISIBLE, " ;0x10000000 If BitAND($WSStyle, $WS_MINIMIZE) Then $sWSSTYLES &= "$WS_MINIMIZE, " ;0x20000000 If BitAND($WSStyle, $WS_ICONIC) Then $sWSSTYLES &= "$WS_ICONIC, " If BitAND($WSStyle, $WS_CHILD) Then $sWSSTYLES &= "$WS_CHILD, " ;0x40000000 If BitAND($WSStyle, $WS_CHILDWINDOW) Then $sWSSTYLES &= "$WS_CHILDWINDOW, " If BitAND($WSStyle, $WS_POPUP) Then $sWSSTYLES &= "$WS_POPUP, " ;0x80000000 If BitAND($WSStyle, $WS_POPUPWINDOW) Then $sWSSTYLES &= "$WS_POPUPWINDOW, " ;0x80880000 If BitAND($WSEXStyle, $WS_EX_ACCEPTFILES) Then $sWSEXSTYLES &= "$WS_EX_ACCEPTFILES, " ;0x00000010 If BitAND($WSEXStyle, $WS_EX_APPWINDOW) Then $sWSEXSTYLES &= "$WS_EX_APPWINDOW, " ;0x00040000 If BitAND($WSEXStyle, $WS_EX_COMPOSITED) Then $sWSEXSTYLES &= "$WS_EX_COMPOSITED, " ;0x02000000 If BitAND($WSEXStyle, $WS_EX_CONTROLPARENT) Then $sWSEXSTYLES &= "$WS_EX_CONTROLPARENT, " ;0x10000 If BitAND($WSEXStyle, $WS_EX_CLIENTEDGE) Then $sWSEXSTYLES &= "$WS_EX_CLIENTEDGE, " ;0x00000200 If BitAND($WSEXStyle, $WS_EX_CONTEXTHELP) Then $sWSEXSTYLES &= "$WS_EX_CONTEXTHELP, " ;0x00000400 If BitAND($WSEXStyle, $WS_EX_DLGMODALFRAME) Then $sWSEXSTYLES &= "$WS_EX_DLGMODALFRAME, " ;0x00000001 If BitAND($WSEXStyle, $WS_EX_LAYERED) Then $sWSEXSTYLES &= "$WS_EX_LAYERED, " ;0x00080000 If BitAND($WSEXStyle, $WS_EX_LAYOUTRTL) Then $sWSEXSTYLES &= "$WS_EX_LAYOUTRTL, " ;0x400000 If BitAND($WSEXStyle, $WS_EX_LEFT) Then $sWSEXSTYLES &= "$WS_EX_LEFT, " ;0x00000000 If BitAND($WSEXStyle, $WS_EX_LEFTSCROLLBAR) Then $sWSEXSTYLES &= "$WS_EX_LEFTSCROLLBAR, " ;0x00004000 If BitAND($WSEXStyle, $WS_EX_LTRREADING) Then $sWSEXSTYLES &= "$WS_EX_LTRREADING, " ;0x00000000 If BitAND($WSEXStyle, $WS_EX_MDICHILD) Then $sWSEXSTYLES &= "$WS_EX_MDICHILD, " ;0x00000040 If BitAND($WSEXStyle, $WS_EX_NOACTIVATE) Then $sWSEXSTYLES &= "$WS_EX_NOACTIVATE, " ;0x08000000 If BitAND($WSEXStyle, $WS_EX_NOINHERITLAYOUT) Then $sWSEXSTYLES &= "$WS_EX_NOINHERITLAYOUT, " ;0x00100000 If BitAND($WSEXStyle, $WS_EX_NOPARENTNOTIFY) Then $sWSEXSTYLES &= "$WS_EX_NOPARENTNOTIFY, " ;0x00000004 If BitAND($WSEXStyle, $WS_EX_RIGHT) Then $sWSEXSTYLES &= "$WS_EX_RIGHT, " ;0x00001000 If BitAND($WSEXStyle, $WS_EX_RIGHTSCROLLBAR) Then $sWSEXSTYLES &= "$WS_EX_RIGHTSCROLLBAR, " ;0x00000000 If BitAND($WSEXStyle, $WS_EX_RTLREADING) Then $sWSEXSTYLES &= "$WS_EX_RTLREADING, " ;0x2000 If BitAND($WSEXStyle, $WS_EX_STATICEDGE) Then $sWSEXSTYLES &= "$WS_EX_STATICEDGE, " ;0x00020000 If BitAND($WSEXStyle, $WS_EX_TOOLWINDOW) Then $sWSEXSTYLES &= "$WS_EX_TOOLWINDOW, " ;0x00000080 If BitAND($WSEXStyle, $WS_EX_TOPMOST) Then $sWSEXSTYLES &= "$WS_EX_TOPMOST, " ;0x00000008 If BitAND($WSEXStyle, $WS_EX_TRANSPARENT) Then $sWSEXSTYLES &= "$WS_EX_TRANSPARENT, " ;0x00000020 If BitAND($WSEXStyle, $WS_EX_WINDOWEDGE) Then $sWSEXSTYLES &= "$WS_EX_WINDOWEDGE, " ;0x00000100 If BitAND($WSEXStyle, $WS_EX_OVERLAPPEDWINDOW) Then $sWSEXSTYLES &= "$WS_EX_OVERLAPPEDWINDOW, " If BitAND($WSEXStyle, $WS_EX_PALETTEWINDOW) Then $sWSEXSTYLES &= "$WS_EX_PALETTEWINDOW, " ConsoleWrite("WS Styles= " & $sWSSTYLES & @CRLF) ConsoleWrite("WS EX Styles= " & $sWSEXSTYLES & @CRLF) EndFunc ;==>Debug_GetWSStyles
-
Hello all I have a question please this a question is about the context menu When i create a list box Or combo box if i create a context menu for this list When i press the application key or the shortcut shift + f10 the menu options is appear normally but When i create a List view if i create a context menu for this list When i press the application key or the shortcut shift + f10 the menu options isn't appear But the right mouse button works normally I need a solution please because I deal with the screen readers users Unfortunately They can not use the mouse to navigate So I have to find a solution to activate keyboard shortcuts am waiting for your help