Leaderboard
Popular Content
Showing content with the highest reputation on 01/23/2016 in all areas
-
I'm turning off the ability for user's to change their own display names at the end of today. After that you can request a name change from a moderator. Just to prevent confusion, messing about, etc.8 points
-
listview edit udf
argumentum reacted to Kanashius for a topic
This UDF can be used to simply edit an Listview. There will be created an inputfield at the position of the subitem, with enter you save, use esc to interrupt,... You can specify single rows and cols or single field (giving row and col,...), also you can specify, if a singleclick or a doubleclick is needed to edit. If you like it, please leave me a comment, also if you have any suggestions to make it better or if you found bugs. I reworked the UDF with AutoIt v3.3.16.1 and added the functionality to use tab to go to the next cell. Files without version numbers contain the current version. Changelog: v1.1.0: - Release v2.0.0: - Add the ability to switch to the next editable cell with tab - Rework to AutoIt v3.3.16.1 (partly) using maps v3.0.0: - Fully reworked to use maps instead of structs (more flexibility/performance) - Uses maps to save editable rows/cols to make ..._isCellEditable faster (No string parsing every time) - Bugfixes v3.0.1: - Fixes Bug with the registered keys not working systemwide v3.0.2: - Fixes Bug where the key input gui wide - The last edited item is now selected - The selection moves with the editable cell, when using ..__updateNextCellIndex (Using the tab key) ListViewEditInput_v1_1_0.au3 Example_v1_1_0.au3 Example_v2_0_0.au3 ListViewEditInput_v2_0_0.au3 Example.au3 ListViewEditInput.au31 point -
Wow, you're genius! Thanks1 point
-
I was lucky lol. I thought, that funtions return a graphic object(a pointer memory ). that pointer(memory area) should have some information for other funtions. I saw some few memory bytes and notice that there are my values (width and height). Saludos1 point
-
With "What have you tried so far" Danyfirex means: "What have you coded so far to solve your problem and which errors do you get?"1 point
-
I found another way looking the graphic's memory. #include <GDIPlus.au3> _GDIPlus_Startup() Local $hWinSurface = GUICreate("Drawing paper",500,400) ; Create a GUI window GUISetState(@SW_SHOW) Local $hGraphicSurface = _GDIPlus_GraphicsCreateFromHWND($hWinSurface) Local $tGraphic=DllStructCreate("long width;long height",$hGraphicSurface+24) MsgBox(0,"","width: " & $tGraphic.width & @CRLF & "height: " & $tGraphic.height) _GDIPlus_GraphicsDispose($hGraphicSurface) _GDIPlus_Shutdown() Saludos1 point
-
GUISetAccelerators problem with ListViewEditInput UDF
langthang084 reacted to Kanashius for a topic
At first, you forgot to initialize the Enter and Escape key. Because of that, it would never do anything. I have rewritten your Example and Edited my UDF, so you can pass your own Accelerator-Array (Except Enter and ESC. There you must give a function instead of the Control) At the moment I have not enough time to edit the whole UDF, but after 16.02.2016 you can look there, I think I will add multiple Guis and Remove the use of Accelerators then. YourProject.zip1 point -
@0Camus0 this is called GIGO: For the start you do not run IE (one instance or two), do not check the help file and do not have any error checking. Do not be surprised by the results You get what you deserve.1 point
-
GUIListViewEx - Deprecated Version
argumentum reacted to Omega19 for a topic
I know this UDF is based on user interaction with the ListViews. This is quite good for what I need, but through I more often add or delete items automaticly (without user action), I made two new functions. These are just slimmed versions of what Melba23 did, but now they fit my needs. If anyone has a use for this, feel free ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIListViewEx_DeleteSpecified ; Description ...: Deletes specified item in the specified ListView ; Syntax.........: _GUIListViewEx_DeleteSpecified() ; Parameters ....: $iLVEx - index of the ListViewEx element as returned by _GUIListViewEx_Init ; $iRow - the index (zero based) of the rows you want to delete, default: 0 (first row) ; Requirement(s).: v3.3 + ; Return values .: Success: Array of specified ListView ; Failure: If $iLVEx is bad then returns "" and sets @error to 1 ; Author ........: Melba23 ; Modified ......: Omega19 ; Remarks .......: - ; Example........: No ;===================================================================================================================== Func _GUIListViewEx_DeleteSpecified($iLVEx, $iRow = 0) ; If $iLVEx is wrong then return If $iLVEx = 0 Or $iLVEx >= UBound($aGLVEx_Data) Then Return SetError(1, 0, "") ; Load ListView details $hGLVEx_SrcHandle = $aGLVEx_Data[$iLVEx][0] $cGLVEx_SrcID = $aGLVEx_Data[$iLVEx][1] Local $fCheckBox = $aGLVEx_Data[$iLVEx][6] ; Copy array for manipulation $aGLVEx_SrcArray = $aGLVEx_Data[$iLVEx][2] ; Create Local array for checkboxes (if no checkboxes makes no difference) Local $aCheck_Array[UBound($aGLVEx_SrcArray)] For $i = 1 To UBound($aCheck_Array) - 1 $aCheck_Array[$i] = _GUICtrlListView_GetItemChecked($hGLVEx_SrcHandle, $i - 1) Next ; Delete element from array _GUIListViewEx_Array_Delete($aGLVEx_SrcArray, $iRow + 1) _GUIListViewEx_Array_Delete($aCheck_Array, $iRow + 1) ; Rewrite ListView _GUIListViewEx_ReWriteLV($hGLVEx_SrcHandle, $aGLVEx_SrcArray, $aCheck_Array, $iLVEx, $fCheckBox) ; Store amended array $aGLVEx_Data[$iLVEx][2] = $aGLVEx_SrcArray ; Delete copied array $aGLVEx_SrcArray = 0 ; Return amended array Return _GUIListViewEx_ReturnArray($iLVEx) EndFunc ;==>_GUIListViewEx_DeleteSpecified ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIListViewEx_InsertSpecified ; Description ...: Inserts data just below selected item in specified ListView - if no selection, data added at end ; Syntax.........: _GUIListViewEx_InsertSpecified($iLVEx, $vData[, $fMultiRow = False[, $bInsertAtEnd = True[, $fRetainWidth = False]]]) ; Parameters ....: $iLVEx - index of the ListViewEx element as returned by _GUIListViewEx_Init ; $vData - Data to insert, can be in array or delimited string format ; $fMultiRow - If $vData is a 1D array: ; - False (default) - elements added as subitems to a single row ; - True - elements added as rows containing a single item ; Ignored if $vData is a single item or a 2D array ; $bInsertAtEnd - True (default) - elements will be added at the end ; False = does not force the elements to be added at the end ; $fRetainWidth - True = native ListView column width is retained on insert ; False = native ListView columns expand to fit data (default) ; Requirement(s).: v3.3 + ; Return values .: Success: Array of current ListView with count in [0] element ; Failure: If $iLVEx is bad then returns "" and sets @error to 1 ; Author ........: Melba23 ; Modified ......: Omega19 ; Remarks .......: - New data is inserted after the selected item. If no item is selected or $bInsertAtEnd is set True then the data is added at ; the end of the ListView. If multiple items are selected, the data is inserted after the first ; - $vData can be passed in string or array format - it is automatically transformed if required ; - $vData as single item - item added to all columns ; - $vData as 1D array - see $fMultiRow above ; - $vData as 2D array - added as rows/columns ; - Native ListViews automatically expand subitem columns to fit inserted data. Setting the ; $fRetainWidth parameter resets the original width after insertion ; Example........: No ;===================================================================================================================== Func _GUIListViewEx_InsertSpecified($iLVEx, $vData, $fMultiRow = False, $bInsertAtEnd = True, $fRetainWidth = False) Local $vInsert ; If $iLVEx false then return If $iLVEx = 0 Or $iLVEx >= UBound($aGLVEx_Data) Then Return SetError(1, 0, "") ; Load specified ListView details $hGLVEx_SrcHandle = $aGLVEx_Data[$iLVEx][0] $cGLVEx_SrcID = $aGLVEx_Data[$iLVEx][1] Local $fCheckBox = $aGLVEx_Data[$iLVEx][6] ; Copy array for manipulation $aGLVEx_SrcArray = $aGLVEx_Data[$iLVEx][2] ; Create Local array for checkboxes (if no checkboxes makes no difference) Local $aCheck_Array[UBound($aGLVEx_SrcArray)] For $i = 1 To UBound($aCheck_Array) - 1 $aCheck_Array[$i] = _GUICtrlListView_GetItemChecked($hGLVEx_SrcHandle, $i - 1) Next ; Get selected item in ListView Local $iIndex = _GUICtrlListView_GetSelectedIndices($hGLVEx_SrcHandle) If $bInsertAtEnd Then $iIndex = "" Local $iInsert_Index = $iIndex ; If no selection If $iIndex = "" Then $iInsert_Index = -1 ; Check for multiple selections If StringInStr($iIndex, "|") Then Local $aIndex = StringSplit($iIndex, "|") ; Use first selection $iIndex = $aIndex[1] ; Cancel all other selections For $i = 2 To $aIndex[0] _GUICtrlListView_SetItemSelected($hGLVEx_SrcHandle, $aIndex[$i], False) Next EndIf Local $aCol_Width, $iColCount ; If width retain required and native ListView If $fRetainWidth And $cGLVEx_SrcID Then $iColCount = _GUICtrlListView_GetColumnCount($hGLVEx_SrcHandle) ; Store column widths Local $aCol_Width[$iColCount] For $i = 1 To $iColCount - 1 $aCol_Width[$i] = _GUICtrlListView_GetColumnWidth($hGLVEx_SrcHandle, $i) Next EndIf ; If empty array insert at 0 If $aGLVEx_SrcArray[0][0] = 0 Then $iInsert_Index = 0 ; Get data into array format for insert If IsArray($vData) Then $vInsert = $vData Else Local $aData = StringSplit($vData, $sGLVEx_SepChar) Switch $aData[0] Case 1 $vInsert = $aData[1] Case Else Local $vInsert[$aData[0]] For $i = 0 To $aData[0] - 1 $vInsert[$i] = $aData[$i + 1] Next EndSwitch EndIf ; Insert data into arrays If $iIndex = "" Then _GUIListViewEx_Array_Add($aGLVEx_SrcArray, $vInsert, $fMultiRow) _GUIListViewEx_Array_Add($aCheck_Array, $vInsert, $fMultiRow) Else _GUIListViewEx_Array_Insert($aGLVEx_SrcArray, $iInsert_Index + 2, $vInsert, $fMultiRow) _GUIListViewEx_Array_Insert($aCheck_Array, $iInsert_Index + 2, $vInsert, $fMultiRow) EndIf ; Rewrite ListView _GUIListViewEx_ReWriteLV($hGLVEx_SrcHandle, $aGLVEx_SrcArray, $aCheck_Array, $iLVEx, $fCheckBox) ; Set highlight #cs If $iIndex = "" Then _GUIListViewEx_Highlight($hGLVEx_SrcHandle, $cGLVEx_SrcID, _GUICtrlListView_GetItemCount($hGLVEx_SrcHandle) - 1) Else _GUIListViewEx_Highlight($hGLVEx_SrcHandle, $cGLVEx_SrcID, $iInsert_Index + 1) EndIf #ce ; Restore column widths if required If $fRetainWidth And $cGLVEx_SrcID Then For $i = 1 To $iColCount - 1 $aCol_Width[$i] = _GUICtrlListView_SetColumnWidth($hGLVEx_SrcHandle, $i, $aCol_Width[$i]) Next EndIf ; Store amended array $aGLVEx_Data[$iLVEx][2] = $aGLVEx_SrcArray ; Delete copied array $aGLVEx_SrcArray = 0 ; Return amended array Return _GUIListViewEx_ReturnArray($iLVEx) EndFunc ;==>_GUIListViewEx_InsertSpecified For anyone wondering if you can now simultaniously drag/drop and change the ListView in the background using the new funktions (because you don't need to set any ListView active): No. Everything you can do with this functions you could have done with the ones Melba23 made. These just give simpler access, if you want to insert/delete without user actions. Best regards, Omega191 point -
Hello everybody ! You want a source code for Wake On LAN without copyright ? It's here ! ENJOY ! $IPAddress = "192.168.1.255"; This is the broadcast address ! $MACAddress = "000D8787E226" UDPStartUp() $connexion = UDPOpen($IPAddress, 7) $res = UDPSend($connexion, GenerateMagicPacket($MACAddress)) MsgBox(0, "", $res) UDPCloseSocket($connexion) UDPShutdown() ; =================================================================== ; Functions ; =================================================================== ; This function convert a MAC Address Byte (e.g. "1f") to a char Func HexToChar($strHex) Return Chr(Dec($strHex)) EndFunc ; This function generate the "Magic Packet" Func GenerateMagicPacket($strMACAddress) $MagicPacket = "" $MACData = "" For $p = 1 To 11 Step 2 $MACData = $MACData & HexToChar(StringMid($strMACAddress, $p, 2)) Next For $p = 1 To 6 $MagicPacket = HexToChar("ff") & $MagicPacket Next For $p = 1 To 16 $MagicPacket = $MagicPacket & $MACData Next Return $MagicPacket EndFunc Thanks for your remarks... Next to see you !1 point