Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/20/2013 in all areas

  1. kescho

    multiple sort [SOLVED]

    Hi UEZ! I think I found a bug in your UDF. If I have an array with 2 columns and when sorting descending by column 2 and also ascending by column 1 then all items are sorted as I want except the last one. example: col1 col2 10 3 11 3 12 3 10 2 11 2 12 2 12 1 11 1 10 1 The problem is commented in the code below: WEnd If $k - $j > 1 Then _ArraySort($aSort, $oDir, $j, $k, $2nd) ;<<<<<<<<<<<< $oDir has to be changed to $iDir $l += 1 ; #FUNCTION# ============================================================================= ; Name.............: _ArraySort_MultiColumn ; Description ...: sorts an array at given colums (multi colum sort) ; Syntax...........: _ArraySort_MultiColumn(ByRef $aSort, ByRef $aIndices) ; Parameters ...: $aSort - array to sort ; $aIndices - array with colum indices which should be sorted in specified order - zero based ; $dir - sort direction - if set to 1, sort descendingly ; Author .........: UEZ ; Version ........: v0.60 build 2011-04-19 Beta ; ======================================================================================== Func _ArraySort_MultiColumn(ByRef $aSort, ByRef $aIndices, $oDir = 0, $iDir = 0) Local $1st, $2nd If Not IsArray($aIndices) Or Not IsArray($aSort) Then Return SetError(1, 0, 0) ;checks if $aIndices is an array If UBound($aIndices) > UBound($aSort, 2) Then Return SetError(2, 0, 0) ;check if $aIndices array is greater the $aSort array Local $x For $x = 0 To UBound($aIndices) - 1 ;check if array content makes sense If Not IsInt($aIndices[$x]) Then Return SetError(3, 0, 0) ;array content is not numeric Next If UBound($aIndices) = 1 Then Return _ArraySort($aSort, $oDir, 0, 0, $aIndices[0]) ;check if only one index is given Local $j, $k, $l = 0 _ArraySort($aSort, $oDir, 0, 0, $aIndices[0]) Do $1st = $aIndices[$l] $2nd = $aIndices[$l + 1] $j = 0 $k = 1 While $k < UBound($aSort) If $aSort[$j][$1st] <> $aSort[$k][$1st] Then If $k - $j > 1 Then _ArraySort($aSort, $iDir , $j, $k - 1, $2nd) $j = $k Else $j = $k EndIf EndIf $k += 1 WEnd If $k - $j > 1 Then _ArraySort($aSort, $oDir, $j, $k, $2nd) ;<<<<<<<<<<<< $oDir has to be changed to $iDir $l += 1 Until $l = UBound($aIndices) - 1 Return 1 EndFunc It's only a small bug, but after correcting it everything works as it should.
    1 point
  2. mLipok

    RDC Black Screen in AutoIT

    Anyone can have a bad day, or a moment of doubt. I also happens So do not give up, raise your head and grow together with us.
    1 point
  3. So, on a standard computer installation, you can't use hotkeyset with a mouse button. Isn't that what I said several posts back? If you want to remap your mouse button so that when you press the left button it triggers the 5 key feel free, myself I prefer my mouse buttons to do what they should be doing so I can use the mouse normally.
    1 point
  4. Uhm, why are you using _FileListToArray() at all? That doesn't make much sense to me. Just FileMove() it.
    1 point
  5. Hi, mohan93. Why bother using the vbs at all? Check the help file for more info on _FileListToArray. #include <File.au3> #include <Array.au3> Local $aArray = _FileListToArray("C:\Temp", "*", 1) For $i = 1 To $aArray[0] If $aArray[$i] = "GLW123.tmp" Then FileMove("C:\Temp\GLW123.tmp", "C:\Temp\SETUP.WSE", 1) Next
    1 point
  6. BrewManNH

    Avoid screensaver

    3 lines.. DllCall('kernel32.dll','long', 'SetThreadExecutionState', 'long', 0x80000003) ; No clue what this value is? While Sleep(100) WEnd That "0x80000003" number was in the original script so when I copied and pasted it there I didn't check it. It stands for BitOr(ES_CONTINUOUS, $ES_DISPLAY_REQUIRED, $ES_SYSTEM_REQUIRED) in case any one really is that interested. I've used this script, or something very similar to it, in the last job I was working at when the corporate office decided to put every computer to sleep after an hour without bothering to check if they'd be able to be woken up remotely. This eliminated having to drive an hour and a half just to wake up a room of computers that needed updates.
    1 point
  7. fikri1979, If you had wanted to use my UDF then it works like this: #include <GUIConstantsEx.au3> #include "GUIExtender.au3" Example() Func Example() $Formoninotool = GUICreate("0nin0 ", 343, 600, 420, 100) _GUIExtender_Init($Formoninotool) $MenuItemtutor = GUICtrlCreateMenu("&TUTOR") $MenuItemtools = GUICtrlCreateMenu("T&OOLS") $MenuItemxl = GUICtrlCreateMenu("&XL") GUISetBkColor(0xC0DCC0) _GUIExtender_Section_Start($Formoninotool, 0, 215) $btnstart = GUICtrlCreateButton("START", 16, 24, 65, 25) $btnstop = GUICtrlCreateButton("STOP", 96, 24, 65, 25) $Inputportproxy = GUICtrlCreateInput("Port injek", 184, 24, 65, 21) $Checkboxproxy = GUICtrlCreateCheckbox("use proxy", 264, 24, 73, 17) $Status = GUICtrlCreateGroup("Status", 8, 112, 321, 49) $Copyright = GUICtrlCreateLabel("Copyright@0nin0 Faundation 2013", 32, 136, 168, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $GroupMode = GUICtrlCreateGroup("Mode", 8, 56, 321, 49) $Radio1ssh = GUICtrlCreateRadio("2 SSH", 16, 80, 57, 17) $Radio2ssh = GUICtrlCreateRadio("3 SSH", 80, 80, 57, 17) $Radio4ssg = GUICtrlCreateRadio("4 SSH", 144, 80, 57, 17) $Radio5ssh = GUICtrlCreateRadio("5 SSH", 208, 80, 57, 17) $Radio6ssh = GUICtrlCreateRadio("6 SSH", 272, 80, 49, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) _GUIExtender_Section_Action($Formoninotool, 2, "Hide Akun", "Data Akun", 8, 168, 97, 17) ; Normal button _GUIExtender_Section_End($Formoninotool) _GUIExtender_Section_Start($Formoninotool, 215, 385) $ExLaInput1 = GUICtrlCreateLabel("Host:", 32, 200, 30, 17) $ExLAInput2 = GUICtrlCreateLabel("Port: ", 32, 250, 30, 17) $ExLaInput3 = GUICtrlCreateLabel("User: ", 32, 300, 30, 17) $Inputproxy = GUICtrlCreateInput("Host",100, 198, 100, 17) $Inputport = GUICtrlCreateInput("Port", 100, 248, 100, 17) $InputUser = GUICtrlCreateInput("User", 100, 298, 100, 17) $ExInput4 = GUICtrlCreateLabel("Melba23", 32, 350, 168, 17) $ExInput5 = GUICtrlCreateLabel("Melba23", 32, 400, 168, 17) $ExInput6 = GUICtrlCreateLabel("Melba23", 32, 450, 168, 17) $ExInput7 = GUICtrlCreateLabel("Melba23", 32, 500, 168, 17) _GUIExtender_Section_End($Formoninotool) ; Retract lower section _GUIExtender_Section_Extend($Formoninotool, 2, False) GUISetState(@SW_SHOW) While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[0] Case $GUI_EVENT_CLOSE Exit EndSwitch Switch $aMsg[1] Case $Formoninotool _GUIExtender_Action($aMsg[1], $aMsg[0]) ; Check for click on Action control EndSwitch WEnd EndFunc M23
    1 point
  8. trancexx

    Drag and Drop with UAC

    There is no need to look at anything. It can't be done. edit: No, it can be done. That guy was right. Great! If IsAdmin() Then ; Allow to receive this messages if run elevated _ChangeWindowMessageFilterEx($hGUI, 0x233, 1) ; $WM_DROPFILES _ChangeWindowMessageFilterEx($hGUI, $WM_COPYDATA, 1) ; redundant? _ChangeWindowMessageFilterEx($hGUI, 0x0049, 1) ; $WM_COPYGLOBALDATA EndIf Func _ChangeWindowMessageFilterEx($hWnd, $iMsg, $iAction) Local $aCall = DllCall("user32.dll", "bool", "ChangeWindowMessageFilterEx", _ "hwnd", $hWnd, _ "dword", $iMsg, _ "dword", $iAction, _ "ptr", 0) If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) Return 1 EndFunc
    1 point
×
×
  • Create New...