Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/30/2018 in all areas

  1. thank you it works now.
    1 point
  2. In my OutlookEX UDF you will find a function (used with _OL_Open) to click away security warnings 😃
    1 point
  3. Glad we have Melba here, he wrote some nice Array UDF's Without his UDF, I would have added an empty column on each row (a future 'sort column') then populate it like this : #include <Array.au3> Global $aArray[][] = [["1234", "low", '=HYPERLINK(STH,STH)', 0], _ ["2341", "medium", '=HYPERLINK(STH,STH)', 0], _ ["3412", "lowest", '=HYPERLINK(STH,STH)', 0], _ ["4123", "high", '=HYPERLINK(STH,STH)', 0], _ ["1235", "critical", '=HYPERLINK(STH,STH)', 0]] _ArrayDisplay($aArray, "Unsorted" , "|2") ; hide last column $sStatus = "5=critical 4=high 3=medium 2=low 1=lowest" For $i = 0 to UBound($aArray) - 1 $iPos = StringInStr($sStatus, $aArray[$i][1]) If $iPos <> 0 Then $aArray[$i][3] = StringMid($sStatus, $iPos - 2, 1) Else MsgBox(0, "Row " & $i, "Status not found : " & $aArray[$i][1]) Exit EndIf Next _ArraySort($aArray, 1, 0, 0, 3) ; 1 = descending . 3 = sort on column 3 _ArrayDisplay($aArray, "Sorted" , "|2") ; hide last column
    1 point
  4. PunkoHead, Try using my ArrayMultiColSort UDF (the link is in my sig below) - this works for me: #include "ArrayMultiColSort.au3" Global $aArray[][] = [["1234", "low", '=HYPERLINK(STH,STH)'], _ ["2341", "medium", '=HYPERLINK(STH,STH)'], _ ["3412", "lowest", '=HYPERLINK(STH,STH)'], _ ["4123", "high", '=HYPERLINK(STH,STH)'], _ ["1235", "critical", '=HYPERLINK(STH,STH)']] _ArrayDisplay($aArray, "Unsorted") ; Create sort data array ; Col 1 - Required order of elements Global $aSortData[][] = [[1, "critical,high,medium,low,lowest"]] ; Sort and display array _ArrayMultiColSort($aArray, $aSortData) ; Display any errors encountered If @error Then ConsoleWrite("Oops: " & @error & " - " & @extended & @CRLF) _ArrayDisplay($aArray, "Sorted") And notice the way to declare and fill an array - a bit less finger wear than yours! M23
    1 point
  5. rudi

    Increase .exe file size

    If you want to *CHECK* a password, a user has to put in on program startup, don't store the password itself, but it's hash code: #Region Password Check $PWD = "" $PW_hash = "0x83CA415F8BA7FCE3163736F7BB472DA7F307B832" Do $PWD = InputBox("Password Check", "enter your password", "", "*") Until $PWD <> "" _Crypt_Startup() $Hash_Input = _Crypt_HashData($PWD, $CALG_SHA1) If $Hash_Input <> $PW_hash Then MsgBox(64, "Wrong Password", "Please type your password again, the SHA1 Hash calculated doesn't match!", 10) Exit EndIf _Crypt_Shutdown() #EndRegion That way the user cannot retrieve your password from the compiled EXE, but *YOU* can verify, he/she knows it. Regards, Rudi.
    1 point
  6. UEZ

    Convert jpg to bmp? Modern?

    It is a bug in an UDF (_WinAPI_WideCharToMultiByte()): Which AutoIt version are you using?
    1 point
  7. Checkbox Combo A Checkbox Combo control for multiple selections must be owner drawn to display Checkboxes. And the ListBox must remain open after an item is in/un-checked. Owner drawn Combo An owner drawn Combo control is discussed in first post. But there was one thing I forgot. For both WM_DRAWITEM and WM_MEASUREITEM messages, controlId is contained in wParam. In case of multiple Combo controls, the correct Combo can be determined by comparing controlId with wParam. Of course, it's much faster than first to create $tDIS and $tMIS structures from lParam, then extract CtlID from the structures, and finally compare controlId and CtlID. UDF and zip-file in first post updated. ListBox control An owner drawn Combo control can be implemented by subclassing the parent window. To keep the ListBox open, it's necessary to subclass the ListBox itself, and respond to WM_LBUTTONUP messages this way: Case $WM_LBUTTONUP Return 0 ; Prevents ListBox from closing This looks relatively easy in first place, but it has significant impact on the functionality of the entire Combo control. A number of smaller pieces of code must be added to make the control work normally again. Among other things AutoIt events are no longer generated for the corresponding controlID. This can be corrected by generating events for a Dummy control instead of: Case $WM_COMMAND Switch BitShift( $wParam, 16 ) ; _WinAPI_HiWord Case $CBN_CLOSEUP ; $idComboBox (Dummy control) event is generated when ListBox is closed GUICtrlSendToDummy( $aCheckboxCombo_Info[$iIdx][5] ) ; Dummy control EndSwitch Functions CheckboxCombo_Create() creates the Combo control but returns a Dummy control as mentioned above. CheckboxCombo_GetChecked() takes controlID (Dummy control) as input and returns checked items. CheckboxCombo_Delete() takes controlID (Dummy control) as input and deletes control. Example CheckboxCombo, 2D array.au3: ;#include <Array.au3> #include <GUIConstantsEx.au3> #include "..\Includes\CheckboxCombo.au3" Example() Func Example() ; Create GUI GUICreate( "Checkbox Combo", 220, 244 ) ; Combo items Local $aItems = [ [ "Item0" ], _ [ "Item1" ], _ [ "Item2", 1 ], _ ; Item2 is checked [ "Item3" ], _ [ "Item4", 1 ], _ ; Item4 is checked [ "Item5" ], _ [ "Item6", 1 ], _ ; Item6 is checked [ "Item7" ], _ [ "Item8" ], _ [ "Item9" ] ] ; Create Checkbox Combo Local $idComboBox = CheckboxCombo_Create( 10, 10, 200, 20, 10, $aItems ) ; Show GUI GUISetState() ; Message loop While 1 Switch GUIGetMsg() Case $idComboBox ConsoleWrite( "Checked items: " & CheckboxCombo_GetChecked( $idComboBox ) & @CRLF ) ;Local $aChecked = CheckboxCombo_GetChecked( $idComboBox, 1 ) ;_ArrayDisplay( $aChecked ) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup GUIDelete() EndFunc Zip-file You need AutoIt 3.3.12 or later. Tested on Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. CheckboxCombo.7z
    1 point
  8. price98, Welcome to the AutoIt forums. However, we do not just produce code for you - we help you get your code working properly. Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers. So I suggest you look at the examples in the Help file for GUICreate, GUICtrlCreateButton, GUICtrlCreateInput & GUICtrlCreateList to get your GUI started - and _FileListToArray to get the files on your desktop. Have a go at producing something yourself and then post it (see here how to do it) - even if it does not do what you require. We can then start helping you to get it working as you wish. M23
    1 point
×
×
  • Create New...