Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/27/2017 in all areas

  1. Do what I've suggested. Saludos
    1 point
  2. Skysnake, As I said to another poster just above, if you want to ask questions which do not specifically involve this UDF then please post in the open forum and leave this thread uncluttered. As neither of your posts above fall into this category I will be removing them shortly, as well as this rejoinder. M23 Edit: But here is how you can use the UDF to have a column (2) which uses a combo to limit user edit options and a right-click menu to select the colour of another column (1) of the selected row. Not terribly difficult after all: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <StaticConstants.au3> #include <UpDownConstants.au3> #include <EditConstants.au3> #include <File.au3> #include <Misc.au3> #include <String.au3> #include <Array.au3> #include "GUIListViewEx.au3" Global $iYellow = "0xFFFF00", _ $iLtBlue = "0xCCCCFF", _ $iGreen = "0x00FF00", _ $iBlack = "0x000000", _ $iRed = "0xFF0000", _ $iBlue = "0x0000FF", _ $iWhite = "0xFFFFFF" Global $sRet $hGUI = GUICreate("Coloured ListView Example", 500, 300) ; Create ListView $cLV = GUICtrlCreateListView("Column 0|Colourable|Editable|Column 3", 10, 10, 480, 260, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS)) For $i = 0 To 3 _GUICtrlListView_SetColumnWidth($cLV, $i, 100) Next ; Initiate ListView = user colours $iLVIndex = _GUIListViewEx_Init($cLV, "", 0, 0, True, 32) ; Set deafult colours to use Global $aDefCols[4] = ["0x000000", "0xFEFEFE", "0xFFFFFF", "0x0000FF"] _GUIListViewEx_SetDefColours($iLVIndex, $aDefCols) ; Set column edit status _GUIListViewEx_SetEditStatus($iLVIndex, 2, 2, "1|2|3", True) ; 2 = Read-only combo ; If colours used then this function must be run BEFORE GUISetState _GUIListViewEx_MsgRegister() GUISetState() ; Create array and fill listview Global $aLVArray[6][4] For $i = 0 To 5 $sData = "Item " & $i & "-0" $aLVArray[$i][0] = $sData For $j = 1 To 3 $sData &= "|SubItem " & $i & "-" & $j $aLVArray[$i][$j] = "SubItem " & $i & "-" & $j Next _GUIListViewEx_InsertSpec($iLVIndex, 0, $sData) Next ; Create context menu for native ListView $mContextmenu = GUICtrlCreateContextMenu($cLV) $mWhtTxt = GUICtrlCreateMenuItem("White text", $mContextmenu) $mYelTxt = GUICtrlCreateMenuItem("Yellow text", $mContextmenu) $mBluTxt = GUICtrlCreateMenuItem("Cyan text", $mContextmenu) $mGrnTxt = GUICtrlCreateMenuItem("Green text", $mContextmenu) $mBlkTxt = GUICtrlCreateMenuItem("Black text", $mContextmenu) GUICtrlCreateMenuItem("", $mContextmenu) $mWhtFld = GUICtrlCreateMenuItem("White field", $mContextmenu) $mRedFld = GUICtrlCreateMenuItem("Red field", $mContextmenu) $mBluFld = GUICtrlCreateMenuItem("Blue field", $mContextmenu) $mGrnFld = GUICtrlCreateMenuItem("Green field", $mContextmenu) $mBlkFld = GUICtrlCreateMenuItem("Black field", $mContextmenu) GUICtrlCreateMenuItem("", $mContextmenu) $mDefTxt = GUICtrlCreateMenuItem("Default txt", $mContextmenu) $mDefFld = GUICtrlCreateMenuItem("Default field", $mContextmenu) $mDefBoth = GUICtrlCreateMenuItem("Default both", $mContextmenu) While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $mWhtTxt To $mDefBoth ; Check context menu items _SetColour($iMsg) EndSwitch $vRet = _GUIListViewEx_EventMonitor() WEnd Func _SetColour($iCID) ; Get information on where last right click occurred within ListView Local $aContext = _GUIListViewEx_ContextPos() ; Set new colour required Local $sColSet = "", $aColArray, $aSplit, $fDef = False Switch $iCID Case $mWhtTxt $sColSet = $iWhite & ";" ; Text colour followed by ";" Case $mYelTxt $sColSet = $iYellow & ";" Case $mBluTxt $sColSet = $iLtBlue & ";" Case $mGrnTxt $sColSet = $iGreen & ";" Case $mBlkTxt $sColSet = $iBlack & ";" Case $mWhtFld $sColSet = ";" & $iWhite ; Field colour preceded by ";" Case $mRedFld $sColSet = ";" & $iRed Case $mBluFld $sColSet = ";" & $iBlue Case $mGrnFld $sColSet = ";" & $iGreen Case $mBlkFld $sColSet = ";" & $iBlack Case $mDefTxt ; Get current colours $aColArray = _GUIListViewEx_ReturnArray($aContext[0], 2) ; Extract current colours $aSplit = StringSplit($aColArray[$aContext[1]][$aContext[2]], ";") ; Create required setting $sColSet = ";" & $aSplit[2] ; Set default flag $fDef = True Case $mDefFld $aColArray = _GUIListViewEx_ReturnArray($aContext[0], 2) $aSplit = StringSplit($aColArray[$aContext[1]][$aContext[2]], ";") $sColSet = $aSplit[1] & ";" $fDef = True Case $mDefBoth $sColSet = ";" EndSwitch If $sColSet Then ; Reset to default if needed If $fDef Then _GUIListViewEx_SetColour($aContext[0], ";", $aContext[1], 1) EndIf ; Set required item colour _GUIListViewEx_SetColour($aContext[0], $sColSet, $aContext[1], 1) EndIf EndFunc
    1 point
  3. With Coded UI, you just record your tests!! and they run time after time. i would rather program in c# anyway so it's a no-brainer for me (you can use ANY .NET language, I love Python as well for scripting). But with that link I posted above this comment, you should be able to talk to that tab control and the buttons. thank you Danyfirex !!! Loved your samples in that kit
    1 point
  4. Google it. There are many examples over the forum. Saludos
    1 point
  5. Call _OL_Open and check @error. 1 means that there was a problem creating the Outlook object. If you want to process Outlook objects outside of an _OL_* function then call _OL_ErrorNotify at the start of your script. This handles all COM errors in your script and sets @error and @extended and even allows to log the errors to the Console, MsgBox or a logfile. You can set the profile to be used when calling function _OL_Open, parameter $sProfileName.
    1 point
  6. water

    QUESTION

    Welcome to AutoIt and the forum! Just a side note: Could you please give meaningful titles to your threads? Everyone on this forum has a question or is looking for help The better you describe in the title what you are looking for the more people you will attract to read your post and the more help you will get
    1 point
  7. gruntydatsun

    QUESTION

    If you were to manually do it, what tool would you use? Browser, putty etc
    1 point
  8. gruntydatsun

    Hotkey Program

    Its a dead quiet day here so I've been mucking around with it $aHotkeys = IniReadSection(@ScriptDir & "\test.ini", "Hotkeys") For $i = 1 To $aHotkeys[0][0] HotKeySet($aHotkeys[$i][0],"HotKeyPressed") Next While 1 Sleep(500) WEnd Func HotKeyPressed() for $x = 1 to UBound($aHotkeys)-1 if @HotKeyPressed = $aHotkeys[$x][0] Then Execute($aHotkeys[$x][1]) Next EndFunc and make a file called test.ini in the root of the program folder with contents: [Hotkeys] +!d=ShellExecute("D:\backup") +!x=ShellExecute("D:\repo") this works for me
    1 point
  9. I do not seem to use variables already used in the calling loop, only a few local variables and the array passed by the _StoreData ($ aBody) function by reference, however, in short, from further tests it seems that: 1) if I use a single loop with two consecutive calls, crash occurs; 2) if I use two distinct loops each with its single call, everything works regularly. I have no words and no explanation about this strange behaviour, ... however I am satisfied for now with this solution, or rather, this workaround In short: using this way, that is, 2 calls in one loop, the appcrash occurs For $mail = 1 to $aItems[0][0] ; scan all items $aBody = StringSplit($aItems[$mail][2], @CRLF, 1); split the body of the mail into an array _StoreData($aBody) ; --> this function extract data from the single lines of the email and store fields to an SQLite DB _OL_ItemMove($oOL, $aItems[$mail][0], Default, StringMid($oAnotherPST.FolderPath, 3) & "\Done") ; move the emails Next If I split instead the two calls in two distinct loops, all works flawlessly .... For $mail = 1 to $aItems[0][0] ; scan all items $aBody = StringSplit($aItems[$mail][2], @CRLF, 1); split the body of the mail into an array _StoreData($aBody) ; --> this function extract data from the single lines of the email and store fields to an SQLite DB Next For $mail = 1 to $aItems[0][0] ; scan all items (again) _OL_ItemMove($oOL, $aItems[$mail][0], Default, StringMid($oAnotherPST.FolderPath, 3) & "\Done") ; move the emails Next Thank you all for your interest.
    1 point
×
×
  • Create New...