Jump to content

Bruceway

Members
  • Posts

    10
  • Joined

  • Last visited

Bruceway's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi All, I am trying to mark out the middle square of this Magnify Routine "window on right" (stolen from M23 - Thanks) - I assume the DllCall is overwriting the boxes. But wherever I try and redraw, they won't stay on the Magnify Window. Can anyone advise, bet way to keep boxes around the middle square. Please be kind with my code, it is ripped from a MUCH bigger exe. The "half" transparent window, is for dragging to where you want it, and the buttons are for more precise placement. #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> Global $hMag_GUI, $hMagDC, $hDeskDC, $hPen, $oObj, $aWinPos[2], $iLast_Mouse_X = 0, $iLast_Mouse_Y = 0 Global $pWindowCaptureX, $pWindowCaptureY Global $pWindowMagWinX, $pWindowMagWinY #Region - GUI3 ; *** Grabber/Picker Window Global $hGUI3 = GUICreate("Capture", 150, 150, $pWindowCaptureX, $pWindowCaptureY, $WS_EX_TOOLWINDOW) Global $Pic1 = GUICtrlCreatePic("", 70, 40, 10, 10, BitOR($GUI_SS_DEFAULT_PIC,$WS_BORDER)) Global $hButtonUp = GUICtrlCreateButton("U", 65, 60, 20, 20) Global $hButtonDown = GUICtrlCreateButton("D", 65, 100, 20, 20) Global $hButtonLeft = GUICtrlCreateButton("L", 40, 80, 20, 20) Global $hButtonRight = GUICtrlCreateButton("R", 90, 80, 20, 20) Global $hButtonOK = GUICtrlCreateButton("OK", 60, 80, 30, 20) #EndRegion - GUI3 #Region - GUI4 Global $hGUI4 = GUICreate("MagWin", 250, 250, 325, 195) Global $hButtonMOK = GUICtrlCreateButton("OK", 45, 140, 30, 20) Global $hButtonMUp = GUICtrlCreateButton("U", 50, 120, 20, 20) Global $hButtonMDown = GUICtrlCreateButton("D", 50, 160, 20, 20) Global $hButtonMLeft = GUICtrlCreateButton("L", 25, 140, 20, 20) Global $hButtonMRight = GUICtrlCreateButton("R", 75, 140, 20, 20) Global $hLabelWindow = GUICtrlCreateLabel("Window", 5, 185, 44, 15) Global $hLabelWindowText = GUICtrlCreateLabel("", 60, 185, 176, 15) Global $hLabelCheck = GUICtrlCreateLabel("Check", 5, 205, 44, 15) Global $hLabelCheckText = GUICtrlCreateLabel("", 60, 205, 176, 15) Global $hLabelScreen = GUICtrlCreateLabel("Screen", 5, 225, 44, 15) Global $hLabelScreenText = GUICtrlCreateLabel("", 60, 225, 176, 15) #EndRegion - GUI4 ;GUISetState(@SW_HIDE, $hGUI1) GUISetState(@SW_SHOW, $hGUI3) GUISetState(@SW_SHOW, $hGUI4) WinSetTrans($hGUI3, "", 100) $hMag_GUI = WinGetHandle("MagWin") ; Get device context for Mag GUI $hMagDC = _WinAPI_GetDC($hMag_GUI) If @error Then Exit ; Get device context for desktop $hDeskDC = _WinAPI_GetDC(0) If @error Then _WinAPI_ReleaseDC($hMag_GUI, $hMagDC) Exit EndIf ; Create pen $hPen = _WinAPI_CreatePen($PS_SOLID, 5, 0x7E7E7E) $oObj = _WinAPI_SelectObject($hMagDC, $hPen) ; Loop until the user exits. ; *** Static Window While 1 ; Reset position Local $aWinPos = WinGetPos("Capture") If $aWinPos[0] <> $iLast_Mouse_X Or $aWinPos[1] <> $iLast_Mouse_Y Then ; Redraw Mag GUI _FOEA_Loupe($aWinPos) ;~ Local $TWPx = $aWinPos[0]+81 ;+81 Top Left Corner; +85 Middle ;~ Local $TWPy = $aWinPos[1]+75 ;+75 Top Left Corner; +80 Middle ;~ ;*** WINDOW COORDS = x+81 & y+75 (top left of picker square) GUISetState(@SW_HIDE, $hGUI3) Local $output1 = PixelCheckSum($aWinPos[0]+81, $aWinPos[1]+75, $aWinPos[0]+91, $aWinPos[1]+85) Local $output2 = PixelCheckSum($aWinPos[0]+73, $aWinPos[1]+66, $aWinPos[0]+83, $aWinPos[1]+76) If $aWinPos[0] < 1440 Then GUICtrlSetData($hLabelWindowText, $aWinPos[0]+81 & "(" & $aWinPos[0]+81+1440 &")," & $aWinPos[1]+75 & " : " & $output1) GUICtrlSetData($hLabelCheckText, $aWinPos[0]+73 & "(" & $aWinPos[0]+73+1440 & ")," & $aWinPos[1]+66 & " : " & $output2) GUICtrlSetData($hLabelScreenText, "W: " & $aWinPos[0]+73 & "(" & $aWinPos[0]+73+1440 &")," & $aWinPos[1]+66 & " C: " & $aWinPos[0]+81 & "," & $aWinPos[1]+75) Else GUICtrlSetData($hLabelWindowText, $aWinPos[0]+81-1440 & "(" & $aWinPos[0]+81 &")," & $aWinPos[1]+75 & " : " & $output1) GUICtrlSetData($hLabelCheckText, $aWinPos[0]+89-1440 & "(" & $aWinPos[0]+89 &")," & $aWinPos[1]+84 & " : " & $output2) GUICtrlSetData($hLabelScreenText, "W: " & $aWinPos[0]+73-1440 & "(" & $aWinPos[0]+73 & ")," & $aWinPos[1]+66 & " C: " & $aWinPos[0]+81 & "," & $aWinPos[1]+75) ;GUICtrlSetData($hLabel2, $aWinPos[1]+75) EndIf GUISetState(@SW_SHOW, $hGUI3) $iLast_Mouse_X = $aWinPos[0] $iLast_Mouse_Y = $aWinPos[1] $pWindowCaptureX = $aWinPos[0] $pWindowCaptureY = $aWinPos[1] ; *** Box ; Tried it here - doesn't work ;~ Global $Graphic = GUICtrlCreateGraphic(176, 55, 2, 20) ;~ Global $Graphic = GUICtrlCreateGraphic(194, 55, 2, 20) ;~ Global $Graphic = GUICtrlCreateGraphic(176, 55, 20, 2) ;~ Global $Graphic = GUICtrlCreateGraphic(176, 73, 20, 2) ;~ Global $Graphic = GUICtrlCreateGraphic(0, 0, 1, 1) EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Local $aWinPos = WinGetPos("MagWin") $pWindowMagWinX = $aWinPos[0] $pWindowMagWinY = $aWinPos[1] ;GUISetState(@SW_HIDE, $hGUI3) GUIDelete($hGUI3) ; Clear up Mag GUI _WinAPI_SelectObject($hMagDC, $oObj) _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC(0, $hDeskDC) _WinAPI_ReleaseDC($hMag_GUI, $hMagDC) ;GUISetState(@SW_HIDE, $hMag_G GUIDelete($hGUI4) GUIDelete($hMag_GUI) ExitLoop Case $hButtonMOK GUISetState(@SW_HIDE, $hGUI3) Local $aWinPos = WinGetPos("Capture") Local $TWPx = $aWinPos[0]+81 ;+81 Top Left Corner; +85 Middle Local $TWPy = $aWinPos[1]+75 ;+75 Top Left Corner; +80 Middle ;*** WINDOW COORDS = x+81 & y+75 (top left of picker square) If $aWinPos[0] > 1440 Then $aWinPos[0] = $aWinPos[0]-1440 $TWPx = $TWPx-1440 EndIf Local $output0 = PixelCheckSum($TWPx-8, $TWPy-9, $TWPx-8+10, $TWPy+1) ;_FOEA_WinAPI_DrawRect(LRChecksum($TWPx-8), $TWPy-9, LRChecksum($TWPx-8)+10, $TWPy+1, 0xFFFFFF, 50) MsgBox($MB_SYSTEMMODAL, "Results ", _ "Window Coords" & @CRLF & _ $TWPx & "(" & $TWPx+1440 & "), " & $TWPy & @CRLF & _ "Checksum0: " & $output0 & @CRLF) GUISetState(@SW_SHOW, $hGUI3) WinActivate($hGUI3, "Capture") Case $hButtonMUp _FOEA_ButtonMUp() Case $hButtonMDown _FOEA_ButtonMDown() Case $hButtonMRight _FOEA_ButtonMRight() Case $hButtonMLeft _FOEA_ButtonMLeft() EndSwitch WEnd Func _FOEA_Loupe($aWinPos) Local $iX, $iY DllCall("gdi32.dll", "int", "StretchBlt", _ "int", $hMagDC, "int", 10, "int", 10, "int", 110, "int", 110, _ "int", $hDeskDC, "int", $aWinPos[0]+68, "int", $aWinPos[1]+61, "int", 20, "int", 20, _ "long", $SRCCOPY) DllCall("gdi32.dll", "int", "StretchBlt", _ "int", $hMagDC, "int", 130, "int", 10, "int", 110, "int", 110, _ "int", $hDeskDC, "int", $aWinPos[0]+70, "int", $aWinPos[1]+63, "int", 7, "int", 7, _ "long", $SRCCOPY) ; Appears initially - then disappears... Global $Graph1 = GUICtrlCreateGraphic(170, 57, 8, 16, $SS_WHITERECT) Global $Graph2 = GUICtrlCreateGraphic(170, 73, 31, 8, $SS_WHITERECT) Global $Graph3 = GUICtrlCreateGraphic(193, 57, 8, 16, $SS_WHITERECT) Global $Graph4 = GUICtrlCreateGraphic(170, 49, 31, 8, $SS_WHITERECT) ; This apears to be needed to stop the Magnify window moving Global $Graph5 = GUICtrlCreateGraphic(0, 0, 1, 1) ;Tried this too - no difference GUISetState(@SW_SHOW, $Graph1) GUISetState(@SW_SHOW, $Graph2) GUISetState(@SW_SHOW, $Graph3) GUISetState(@SW_SHOW, $Graph4) EndFunc ;==>Loupe Func _FOEA_ButtonMUp() Local $aWinPos = WinGetPos("Capture") WinMove($hGUI3, "Capture", $aWinPos[0], $aWinPos[1]-1) EndFunc Func _FOEA_ButtonMDown() Local $aWinPos = WinGetPos("Capture") WinMove($hGUI3, "Capture", $aWinPos[0], $aWinPos[1]+1) EndFunc Func _FOEA_ButtonMRight() Local $aWinPos = WinGetPos("Capture") WinMove($hGUI3, "Capture", $aWinPos[0]+1, $aWinPos[1]) EndFunc Func _FOEA_ButtonMLeft() Local $aWinPos = WinGetPos("Capture") WinMove($hGUI3, "Capture", $aWinPos[0]-1, $aWinPos[1]) EndFunc
  2. Saw Line 75 ; Create context menu for native ListView and assumed it was only applying to the original ListView. Have grabbed the code and got it functioning, cheers. That will teach me to RTFM properly..
  3. Hi Melba23 - Is it possible to have a right click context menu in this UDF? I'm having issues understanding how to implement. Thanks
  4. FOUND IT!!!! - Thanks dmob Have changed the following - Removed _GUICtrlListView_AddSubItem & substituted for _GUiCtrlListViewEx_ChangeItem and it all works.... (Other than Melba's parameters being the other way round 😛) GetMouseCoords($iMouseX, $iMouseY) GUICtrlSetData($hLabelStatus, $iRow+1 & " | " & $iMouseX & " | " & $iMouseY & " | " & $iMouseType) _GUIListViewEx_ChangeItem($iLV, $iRow, 0, $iRow+1) ;_GUICtrlListView_AddSubItem($hListView, $iRow, $iRow+1, 0) $aItems[$iRow][0] = $iRow+1 _GUIListViewEx_ChangeItem($iLV, $iRow, 1, $iMouseX) ;_GUICtrlListView_AddSubItem($hListView, $iRow, $iMouseX, 1) $aItems[$iRow][1] = $iMouseX _GUIListViewEx_ChangeItem($iLV, $iRow, 2, $iMouseY) ;_GUICtrlListView_AddSubItem($hListView, $iRow, $iMouseY, 2) $aItems[$iRow][2] = $iMouseY _GUIListViewEx_ChangeItem($iLV, $iRow, 3, $iMouseType) ;_GUICtrlListView_AddSubItem($hListView, $iRow, $iMouseType, 3) $aItems[$iRow][3] = $iMouseType Sometimes I am so dumb, it pleases people!!
  5. dmob - I can do, but that bit of code actually works fine? The issue is with this bit. When I reach the bottom of the array, I want to add a new line and continue, but when I add _GUIListViewEx_Insert("I|0|0|0") The Listview adds a new line, but blanks all previous content. If UBound($aItems) = $iRow Then _ArrayDisplay($aItems) _GUIListViewEx_Insert("I|0|0|0") _ArrayDisplay($aItems) _ArrayAdd($aItems, "I|0|0|0") _ArrayDisplay($aItems) EndIf _GUIListViewEx_SelectItem($iRow)
  6. HI Dmob - The DIm is for when the load fails - I have no file to load yet! So I Dim the Array. Everything works up to the point where I insert the new line and the ListView craps out.
  7. OK - Posted WORKING Script - Where can I found your equivalent of - Copy contents of Array to Listview (I have found Listview to Array). Anyway feel free to take a look - Press Ins to get a mouse click - and it should move down to the next row (at the bottom is where I am having trouble (adding a new Row to the array and listview!) Treat me nicely, I'm as old as you and a newb... ; NOTES ; Array -> ListView ; _GUICtrlListView_AddArray ; ListView -> Array ; _GUIListViewEx_ReadToArray - Correct ; *** Includes *** #include <Misc.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> ;#include <GuiListView.au3> #include <GuiListViewEx_Beta.au3> #include <ButtonConstants.au3> #include <File.au3> ; *** Global Variables *** Global $sSelectedRow, $iRet, $iIndex, $iRow, $iColumn Global $iRowCounter, $aSelected Global $bMouseClick = False Global $dll = Null Global $iMouseX = 0 Global $iMouseY = 0 Global $iMouseType = 0 Global $aItems[4][4] Global $iEditMode = 0 #Region ### START Koda GUI section ### Form= Global $_1 = GUICreate("Array Create", 402, 374, 257, 223) GUISetBkColor(0xE0FFFF) ;Global $hListView = GUICtrlCreateListView("X |Y |Type", 12, 8, 220, 272) ;GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) ;GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50) ;GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 50) Global $hLabelStatus = GUICtrlCreateLabel("Status", 49, 286, 148, 17) Global $hButtonPlus = GUICtrlCreateButton("+", 66, 320, 20, 20) Global $hButtonMinus = GUICtrlCreateButton("-", 166, 320, 20, 20) Global $hButtonLeft = GUICtrlCreateButton("L", 96, 320, 20, 20) Global $hButtonDown = GUICtrlCreateButton("D", 116, 338, 20, 20) Global $hButtonRight = GUICtrlCreateButton("R", 136, 320, 20, 20) Global $hButtonUp = GUICtrlCreateButton("U", 116, 302, 20, 20) Global $Group1 = GUICtrlCreateGroup("Group1", 240, 8, 153, 113) Global $hRadioSupplies = GUICtrlCreateRadio("Supplies", 248, 24, 113, 17) Global $hRadioCoins = GUICtrlCreateRadio("Coins", 248, 60, 153, 17) Global $hRadioProduction = GUICtrlCreateRadio("Production", 248, 96, 113, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ; Added outsiede of Koda as New Ctrl is not in Koda Global $hListView = _GUICtrlListView_Create($_1, "Num |X |Y |Type", 12, 8, 220, 240, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT, $WS_BORDER)) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_HEADERDRAGDROP)) _GUICtrlListView_SetColumnWidth($hListView, 0, 50) _GUICtrlListView_SetColumnWidth($hListView, 1, 50) _GUICtrlListView_SetColumnWidth($hListView, 2, 50) _GUICtrlListView_SetColumnWidth($hListView, 3, 50) _GUICtrlListView_SetInsertMarkColor($hListView, 0) HotKeySet("{ESC}", "Terminate") HotKeySet("{INSERT}", "GetClick") HotKeySet("{DELETE}", "RemoveClick") ; *** Setup ready for first run *** _GUICtrlListView_AddArray($hListView, $aItems) LoadArray() ; Initiate LVEx - no count - green insert parameter - no drag image $iLV_Right_Index = _GUIListViewEx_Init($hListView, $aItems, 0, 0x00FF00) ; Register for sorting, dragging and editing _GUIListViewEx_MsgRegister() ; Set $iRowCounter to start $iRowCounter = 0 ; Set Blue selection to start _GUIListViewEx_SelectItem($iRowCounter) ; Set $hRadioSupplies by default GUICtrlSetState($hRadioSupplies, $GUI_CHECKED) ; All mouse coords are taken from Window sizing. AutoItSetOption('MouseCoordMode', 0) ;1 is screen/0 is active window ; Main Loop ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Terminate() ExitLoop Case $hButtonPlus GetClick() Case $hButtonMinus RemoveClick() Case $hButtonUp Case $hButtonDown Case $hButtonRight Case $hButtonLeft EndSwitch ; Routines for _GUIListViewEx - Functions $vRet = _GUIListViewEx_EventMonitor($iEditMode) ; Use combos to change EditMode If @error Then MsgBox($MB_SYSTEMMODAL, "Error", "Event error: " & @error) EndIf Switch @extended Case 0 ; No event detected Case 1 If $vRet = "" Then MsgBox($MB_SYSTEMMODAL, "Edit", "Edit aborted" & @CRLF) Else _ArrayDisplay($vRet, "ListView " & _GUIListViewEx_GetActive() & " content edited", Default, 8) EndIf Case 2 If $vRet = "" Then MsgBox($MB_SYSTEMMODAL, "Header edit", "Header edit aborted" & @CRLF) Else _ArrayDisplay($vRet, "ListView " & _GUIListViewEx_GetActive() & " header edited", Default, 8) EndIf Case 3 MsgBox($MB_SYSTEMMODAL, "Sorted", "ListView: " & $vRet & @CRLF) Case 4 MsgBox($MB_SYSTEMMODAL, "Dragged", "From:To" & @CRLF & $vRet & @CRLF) EndSwitch WEnd Func SaveArray() Local $sMyBox = Null $aItems = _GUIListViewEx_ReadToArray($hListView, 0) _ArrayDisplay ($aItems, "ArrayWrite", Default, 8) ;If $aItems[UBound($aItems)] = "I|0|0|0" Then ; MsgBox($MB_SYSTEMMODAL, "SaveArray", "Matched last line") ; EndIf $sMyBox = MsgBox(4100, "", "Save Y/N") If $sMyBox = 6 Then ;6=Yes 7=NO _FileWriteFromArray("G:\Documents\AutoIt3\NewFOE-5MArray.txt", $aItems, 0) EndIf EndFunc ;==>SaveArray Func LoadArray() If Not _FileReadToArray("G:\Documents\AutoIt3\NewFOE-5MArray.txt", $aItems, 0, "|") Then ; MsgBox($MB_SYSTEMMODAL,"", @error) Dim $aItems[4][4] EndIf _ArrayDisplay($aItems, "ArrayLoad", Default, 8) EndFunc ;==>LoadArray Func GetClick() $sSelectedRow = _GUIListViewEx_GetLastSelItem() ; Returns - Return | Index | Row | Column $aSelected = GetSelectedItem($sSelectedRow) $iRet = $aSelected[0] $iIndex = $aSelected[1] $iRow = $aSelected[2] $iColumn = $aSelected[3] ; MsgBox($MB_SYSTEMMODAL, "listview item", "Ret : " & $iRet & @CRLF _ ; & "Index: " & $iIndex & @CRLF _ ; & "Row : " & $iRow & @CRLF _ ; & "Col : " & $iColumn) $bMouseClick = False GetMouseCoords($iMouseX, $iMouseY) GUICtrlSetData($hLabelStatus, $iRow+1 & " | " & $iMouseX & " | " & $iMouseY & " | " & $iMouseType) _GUICtrlListView_AddSubItem($hListView, $iRow, $iRow+1, 0) $aItems[$iRow][0] = $iRow+1 _GUICtrlListView_AddSubItem($hListView, $iRow, $iMouseX, 1) $aItems[$iRow][1] = $iMouseX _GUICtrlListView_AddSubItem($hListView, $iRow, $iMouseY, 2) $aItems[$iRow][2] = $iMouseY _GUICtrlListView_AddSubItem($hListView, $iRow, $iMouseType, 3) $aItems[$iRow][3] = $iMouseType ;_Check here for end of array and add a line if necessary $iRow = $iRow +1 ;MsgBox($MB_SYSTEMMODAL,"GetClick", "Row " & $iRow & @CRLF _ ;& "Ubd " & UBound($aItems)) If UBound($aItems) = $iRow Then _ArrayDisplay($aItems) _GUIListViewEx_Insert("I|0|0|0") _ArrayDisplay($aItems) _ArrayAdd($aItems, "I|0|0|0") _ArrayDisplay($aItems) ; $aItems = _GUIListViewEx_ReadToArray($hListView) ; $iRow = $iRow +1 ; MsgBox($MB_SYSTEMMODAL,"GetClick", "Row " & $iRow & @CRLF _ ; & "Ubd " & UBound($aItems)) ; _GUICtrlListView_AddArray($hListView, $aItems) EndIf _GUIListViewEx_SelectItem($iRow) EndFunc ;==>GetClick Func RemoveClick() $iRow = $iRow -1 _GUIListViewEx_SelectItem($iRow) _GUICtrlListView_AddSubItem($hListView, $iRow, "", 0) $aItems[$iRow][0] = "" _GUICtrlListView_AddSubItem($hListView, $iRow, "", 1) $aItems[$iRow][1] = "" _GUICtrlListView_AddSubItem($hListView, $iRow, "", 2) $aItems[$iRow][2] = "" _GUICtrlListView_AddSubItem($hListView, $iRow, "", 3) $aItems[$iRow][3] = "" ;_ArrayDisplay($aItems, "AddClick", Default, 8) $iMouseX = 0 $iMouseY = 0 GUICtrlSetData($hLabelStatus, "Cleared") EndFunc ;==>RemoveClick Func GetMouseCoords(ByRef $iMouseX, ByRef $iMouseY) $dll = DllOpen("user32.dll") While $bMouseClick = False Sleep(10) ; This enough to prevent CPU overload <<<<<<<<<<<<<<<<<<<<<<<< If _IsPressed("01", $dll) Then $MousePos = MouseGetPos() ConsoleWrite("Mouse Counter= " & $iRowCounter & " | " & _ "X= " & $MousePos[0] & " | " & _ "Y= " & $MousePos[1] & " | " & @CRLF) $iMouseX = $MousePos[0] $iMouseY = $MousePos[1] $bMouseClick = True While _IsPressed("01", $dll) Sleep(10) WEnd EndIf WEnd DllClose($dll) EndFunc ;==>GetMouseCoords Func GetSelectedItem($SelectedRow) Local $Selected ;MsgBox($MB_SYSTEMMODAL, "GetSelectedItem", $sSelectedRow) $Selected = StringSplit($SelectedRow, "|") ; Returns - Ret[0] Index[1] Row[2] [3] Return $Selected EndFunc ;==>GetSelectedItem Func Terminate() DllClose($dll) SaveArray() Exit 0 EndFunc ;==>Terminate
  8. HI Melba23 Yes I can confirm that the selection works fine Thank you. Another question now I am trying to insert a line at the end, but when I do the redraw is emptying the previous lines in the array: - What am I doing wrong?? ;_Check here for end of array and add a line if necessary $iRow = $iRow +1 ;MsgBox($MB_SYSTEMMODAL,"GetClick", "Row " & $iRow & @CRLF _ ;& "Ubd " & UBound($aItems)) If UBound($aItems) = $iRow Then _ArrayDisplay($aItems) _GUIListViewEx_Insert("I|0|0|0") _ArrayDisplay($aItems) _ArrayAdd($aItems, "I|0|0|0") _ArrayDisplay($aItems) ; $aItems = _GUIListViewEx_ReadToArray($hListView) ; $iRow = $iRow +1 ; MsgBox($MB_SYSTEMMODAL,"GetClick", "Row " & $iRow & @CRLF _ ; & "Ubd " & UBound($aItems)) ; _GUICtrlListView_AddArray($hListView, $aItems) EndIf _GUIListViewEx_SelectItem($iRow) EndFunc ;==>GetClick
  9. Wow!! Such a fast reply - Cheers....
  10. Hi Melba - Read through the Doc, and looked through the examples, but can't see anything. Is there any way of selecting a row from code (so that it is highlighted) ? I know I can click on a row to highlight it ready for an action, But I want to open the UDF with the top row highlighted at start. Thanks
×
×
  • Create New...