
picaxe
Active Members-
Posts
473 -
Joined
-
Last visited
Everything posted by picaxe
-
Check if macro is declared
picaxe replied to SublimePorte's topic in AutoIt General Help and Support
One way;Opt("GUIOnEventMode", 1) If _IsOnEvent() Then $sState = "On" Else $sState = "Off" EndIf ConsoleWrite("Event Mode is " & $sState & @LF) Func _IsOnEvent() $iOnEvent = Opt("GUIOnEventMode", 1) Opt("GUIOnEventMode", $iOnEvent) Return $iOnEvent EndFunc -
Checkbox only at BelowTreeViewItem
picaxe replied to chipDE's topic in AutoIt General Help and Support
See this post by Holger -
Correct, AutoIt help says "The control must be in icon or small icon view mode". This works for me #include <GUIListView.au3> #include <GUIImageList.au3> $hGUI = GUICreate("") $hGUIListView = _GUICtrlListView_Create($hGUI, "", 0, 0, 212, 300, BitOR($LVS_ICON, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_SMALLICON));$LVS_LIST)) $hImageList = _GUIImageList_Create(24, 24, 5) _GUIImageList_AddIcon($hImageList, @ProgramFilesDir & "\AutoIt3\Icons\au3script_v9.ico", 0, True) _GUICtrlListView_SetImageList($hGUIListView, $hImageList, 1) _GUICtrlListView_AddItem($hGUIListView, "1", 0) _GUICtrlListView_AddItem($hGUIListView, "2", 0) _GUICtrlListView_AddItem($hGUIListView, "3", 0) GUISetState() _GUICtrlListView_SetItemPosition($hGUIListView, 0, 25, 80) While 1 If GUIGetMsg() = -3 Then Exit WEnd
-
Or use _ArrayUnique
-
Excel Add Worksheet After Worksheets.Count
picaxe replied to Fatum48's topic in AutoIt General Help and Support
#include <Excel.au3> $oExcel = _ExcelBookNew() For $i = 1 To 3 _ExcelSheetAddNew($oExcel, "S" & $i) Next ConsoleWrite("return=" & _ExcelSheetAddAfter($oExcel, "S2", "Add After S2") & " @error=" & @error & @LF) ConsoleWrite("return=" & _ExcelSheetAddAfter($oExcel) & " @error=" & @error & @LF) ConsoleWrite("return=" & _ExcelSheetAddAfter($oExcel, "", "Add After Last") & " @error=" & @error & @LF) ; #FUNCTION# ==================================================================================================================== ; Name...........: _ExcelSheetAddAfter ; Description ...: Add a new sheet (optionally with a name) to a workbook after a named sheet. ; Syntax.........: _ExcelSheetAddAfter($oExcel [, $sAfterSheet = "" [, $sNewSheetName = ""]]) ; Parameters ....: $oExcel - An Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew() ; $sAfterSheet - Name of the sheet after which a new sheet will be added, add to end if not supplied ; $sNewSheetName - Name of the added new sheet, use default name if none supplied ; Return values .: Success - Returns 1 ; Failure - Returns 0 and sets @error on errors: ; @error=1 - Specified object does not exist ; @error=2 - $sAfterSheet name not found ; Author ........: picaxe ; Remarks .......: None ; =============================================================================================================================== Func _ExcelSheetAddAfter($oXl, $sAfterSheet = "", $sNewSheetName = "") If Not IsObj($oXl) Then Return SetError(1, 0, 0) Local $iSheetCount = $oXl.ActiveWorkbook.Sheets.Count If $sAfterSheet = "" Then $oXl.ActiveWorkBook.WorkSheets.Add(Default, $oXl.ActiveWorkbook.Sheets($iSheetCount)).Activate Else For $i = 1 To $iSheetCount If $oXl.ActiveWorkbook.Sheets($i).Name = $sAfterSheet Then $oXl.ActiveWorkBook.WorkSheets.Add(Default, $oXl.ActiveWorkbook.Sheets($i)).Activate ExitLoop EndIf Next If $i > $iSheetCount Then Return SetError(2, 0, 0) EndIf If $sNewSheetName <> "" Then $oXl.ActiveSheet.Name = $sNewSheetName Return 1 EndFunc -
Get the selected row value from a grid control
picaxe replied to YogeshDikshit's topic in AutoIt General Help and Support
_GUICtrlListView_GetItemSelectedsee help file example. -
Get the selected row value from a grid control
picaxe replied to YogeshDikshit's topic in AutoIt General Help and Support
Au3Info shows it is a listview, so try adapting this example. -
Determining the Last Row in Excel
picaxe replied to CE101's topic in AutoIt General Help and Support
Const $xlByRows = 1 Const $xlByColumns = 2 Const $xlPrevious = 2 $oExcel = ObjCreate("Excel.Application") With $oExcel ; open new workbook .Visible = True .WorkBooks.Add .ActiveWorkbook.Sheets(1).Select() $oSheet = .ActiveSheet $iStart = Random(1, 19, 1) $iEnd = Random(20, 49, 1) For $i = $iStart To $iEnd $oSheet.Cells($i, 1).Value = Random(1, 100000, 1) Next $iStart = Random(50, 69, 1) $iEnd = Random(70, 100, 1) For $i = $iStart To $iEnd $oSheet.Cells($i, 1).Value = Random(1, 100000, 1) Next EndWith $iLastRow = $oSheet.Cells.Find('*', $oSheet.Cells(1, 1), Default, Default, $xlByRows, $xlPrevious).Row $oSheet.Cells(3, 3).Value = "Last non empty row = " & $iLastRow -
help with Monitor flip via NVidia Controlpanel??
picaxe replied to tobject's topic in AutoIt General Help and Support
RotateDisplay() ; rotate 90 deg Sleep(3000) RotateDisplay(1, 0) ; restore Func RotateDisplay($iDisplayNumber = 1, $iRotate = 90) Run("rundll32.exe NvCpl.dll,dtcfg rotate " & $iDisplayNumber & " " & $iRotate) If @error Then Return SetError(1, 0, 0) EndFunc -
Two snippets, one works and one doesn't
picaxe replied to aommaster's topic in AutoIt General Help and Support
The problem is reusing the array $filelist in a For In Next statement, because of the read only limitation. Whereas For To Next is Ok. -
Two snippets, one works and one doesn't
picaxe replied to aommaster's topic in AutoIt General Help and Support
You can read but not update/create an array inside a For In Next statement. -
If problem is not as suggested by Melba23. Try this
-
uTorrent SysListview322 getting row information
picaxe replied to Pandaren's topic in AutoIt General Help and Support
#include <GuiListView.au3> $sDelim = "|" $hListview = ControlGetHandle("µTorrent 2.0.2", "", "[CLASS:SysListView32; INSTANCE:2]") $sItems = "" For $i = 0 To _GUICtrlListView_GetItemCount($hListview) - 1 For $j = 0 To _GUICtrlListView_GetColumnCount($hListview) - 1 $sItems &= _GUICtrlListView_GetItemText($hListview, $i, $j) & $sDelim Next $sItems = StringTrimRight($sItems, 1) & @CRLF Next ConsoleWrite($sItems) -
_excelSheetActivate() causes COM error
picaxe replied to sigil's topic in AutoIt General Help and Support
This works for me on Excel 2003, WinXP$eObj = _ExcelBookAttach($myfilepath) $eObj.Sheets($mySheet).Select() -
#include <GUIConstants.au3> #include <GUIEdit.au3> $gui = GUICreate('', 200, 120) $edit = GUICtrlCreateEdit('This is a string. This is a string', 0, 0, 200, 80) ;~ $button1 = GUICtrlCreateButton('Test 1', 0, 80, 100, 20) ;~ $button2 = GUICtrlCreateButton('Test 2', 100, 80, 100, 20) $label = GUICtrlCreateLabel('', 0, 100, 200, 20) GUISetState() Opt("CaretCoordMode", 0) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop ;~ Case $button1 ;~ GUICtrlSetState($edit, $GUI_FOCUS) ;~ _GUICtrlEdit_SetSel($edit, 5, 9) ;~ $aSel = _GUICtrlEdit_GetSel($edit) ;~ GUICtrlSetData($label, 'Selection is: ' & $aSel[0] & ' to ' & $aSel[1] & ' Active: ' & Active()) ;~ Case $button2 ;~ GUICtrlSetState($edit, $GUI_FOCUS) ;~ _GUICtrlEdit_SetSel($edit, 9, 5) ;~ $aSel = _GUICtrlEdit_GetSel($edit) ;~ GUICtrlSetData($label, 'Selection is: ' & $aSel[0] & ' to ' & $aSel[1] & ' Active: ' & Active()) EndSwitch $aSel = _GUICtrlEdit_GetSel($edit) If $aSel[0] <> $aSel[1] Then GUICtrlSetData($label, 'Selection is: ' & $aSel[0] & ' to ' & $aSel[1] & ' Active: ' & Active()) Else GUICtrlSetData($label, '') EndIf Sleep(50) WEnd Func Active() ;$iOpt = Opt("CaretCoordMode", 0) $aCaret = WinGetCaretPos() ;$iErrSav = @error ;Opt("CaretCoordMode", $iOpt) If @error Then Return SetError(1, 0, -1) $aPos = _GUICtrlEdit_CharFromPos($edit, $aCaret[0], $aCaret[1]) Return $aPos[0] EndFunc ;==>Active
-
Here's a quick hack of the _GUIImageList_Drag* help file example (with some small tweeks). You would probably want to remove the image list code.Opt("MustDeclareVars", 1) #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> #include <Constants.au3> #Include <SendMessage.au3> Global $hDragImageList, $h_ListView, $bDragging = False, $LV_Height, $fNoImage Global $a_index[2] ; from and to Global Const $DebugIt = 0 Opt("WinTitleMatchMode", 2) Local Const $image_width = 20 Local Const $image_height = 20 Local $h_images, $main_GUI, $iIndex, $sTitle = "Listview Drag & Drop Rearrange" Switch MsgBox(262144 + 4, $sTitle, '"Yes" for listview with icons' & @LF & '"No" for standard listview') Case 6 $fNoImage = False Case 7 $fNoImage = True EndSwitch $main_GUI = GUICreate($sTitle, 350, 300) $h_ListView = _GUICtrlListView_Create($main_GUI, "Entry Name|Category", 5, 10, 340, 280, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE)) $LV_Height = 280 - 75 _GUICtrlListView_SetColumnWidth($h_ListView, 0, 160) _GUICtrlListView_SetColumnWidth($h_ListView, 1, 160) If $fNoImage Then _GUICtrlListView_SetExtendedListViewStyle($h_ListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT)) Else _GUICtrlListView_SetExtendedListViewStyle($h_ListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) _GUICtrlListView_SetExtendedListViewStyle($h_ListView, BitOR($LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_SUBITEMIMAGES)) EndIf ;------------------------------------------------------ ; Using subitem images ;------------------------------------------------------ If Not $fNoImage Then $h_images = _GUIImageList_Create($image_width, $image_height, 5, 1) For $x = 1 To 21 _GUIImageList_AddIcon($h_images, @SystemDir & "\shell32.dll", $x) Next _GUICtrlListView_SetImageList($h_ListView, $h_images, $LVSIL_SMALL) EndIf ;Register WM_NOTIFY events GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUIRegisterMsg($WM_LBUTTONUP, "WM_LBUTTONUP") GUIRegisterMsg($WM_MOUSEMOVE, "WM_MOUSEMOVE") ;GUIRegisterMsg($WM_SIZE, "WM_SIZE") Local $y = 1 For $x = 0 To 9 $iIndex = _GUICtrlListView_AddItem($h_ListView, "Name " & $x + 1, $y) ; handle, string, image index _GUICtrlListView_AddSubItem($h_ListView, $iIndex, "Category " & $x + 1, 1, $y + 1) ; handle, index, string, subitem, image index $y += 2 Next GUISetState() While 1 Switch GUIGetMsg() ;This case statement exits and updates code if needed Case $GUI_EVENT_CLOSE ExitLoop ;put all the misc. stuff here Case Else ;;; EndSwitch WEnd _GUIImageList_Destroy($h_images) GUIDelete() Func _LVInsertItem($i_FromItem, $i_ToItem) Local $struct_LVITEM = DllStructCreate($tagLVITEM) If @error Then Return SetError(-1, -1, -1) Local $struct_String = DllStructCreate("char Buffer[4096]") If @error Then Return SetError(-1, -1, -1) Local $sBuffer_pointer = DllStructGetPtr($struct_String) DllStructSetData($struct_LVITEM, "Mask", BitOR($LVIF_STATE, $LVIF_IMAGE, $LVIF_INDENT, $LVIF_PARAM, $LVIF_TEXT)) DllStructSetData($struct_LVITEM, "StateMask", $LVIS_STATEIMAGEMASK) DllStructSetData($struct_LVITEM, "Item", $i_FromItem) DllStructSetData($struct_LVITEM, "SubItem", 0) DllStructSetData($struct_LVITEM, "TextMax", 4096) DllStructSetData($struct_LVITEM, "Text", $sBuffer_pointer) _GUICtrlListView_GetItemEx($h_ListView, $struct_LVITEM) If @error Then Return SetError(-1, -1, -1) Local $item_state = DllStructGetData($struct_LVITEM, "State") DllStructSetData($struct_LVITEM, "Item", $i_ToItem) ;~ Local $aItemText = _GUICtrlListView_GetItem($h_ListView, $i_FromItem) ; DllStructGetData($struct_String, "Buffer") only gets first letter possible bug ? Local $i_newIndex = _GUICtrlListView_InsertItem($h_ListView, _GUICtrlListView_GetItemText($h_ListView, $i_FromItem), $i_ToItem, DllStructGetData($struct_LVITEM, "Image")) If @error Then Return SetError(-1, -1, -1) If $DebugIt Then _DebugPrint("$i_newIndex = " & $i_newIndex) DllStructSetData($struct_LVITEM, "Mask", $LVIF_STATE) DllStructSetData($struct_LVITEM, "Item", $i_newIndex) DllStructSetData($struct_LVITEM, "State", $item_state) DllStructSetData($struct_LVITEM, "StateMask", $LVIS_STATEIMAGEMASK) _GUICtrlListView_SetItemState($h_ListView, $i_newIndex, $item_state, $LVIS_STATEIMAGEMASK) If @error Then Return SetError(-1, -1, -1) Return $i_newIndex EndFunc ;==>_LVInsertItem Func _LVCopyItem($i_FromItem, $i_ToItem, $i_SubItem = 0) Local $struct_LVITEM = DllStructCreate($tagLVITEM) Local $struct_String = DllStructCreate("char Buffer[4096]") Local $sBuffer_pointer = DllStructGetPtr($struct_String) ; get from item info DllStructSetData($struct_LVITEM, "Mask", BitOR($LVIF_STATE, $LVIF_IMAGE, $LVIF_INDENT, $LVIF_PARAM, $LVIF_TEXT)) DllStructSetData($struct_LVITEM, "StateMask", $LVIS_STATEIMAGEMASK) DllStructSetData($struct_LVITEM, "Item", $i_FromItem) DllStructSetData($struct_LVITEM, "SubItem", $i_SubItem) DllStructSetData($struct_LVITEM, "TextMax", 4096) DllStructSetData($struct_LVITEM, "Text", $sBuffer_pointer) _GUICtrlListView_GetItemEx($h_ListView, $struct_LVITEM) ; set to DllStructSetData($struct_LVITEM, "Item", $i_ToItem) ; set text DllStructSetData($struct_LVITEM, "Mask", $LVIF_TEXT) DllStructSetData($struct_LVITEM, "Text", $sBuffer_pointer) DllStructSetData($struct_LVITEM, "TextMax", 4096) _GUICtrlListView_SetItemEx($h_ListView, $struct_LVITEM) If @error Then Return SetError(@error, @error, @error) ; set status DllStructSetData($struct_LVITEM, "Mask", $LVIF_STATE) _GUICtrlListView_SetItemEx($h_ListView, $struct_LVITEM) ; set image DllStructSetData($struct_LVITEM, "Mask", $LVIF_IMAGE) DllStructSetData($struct_LVITEM, "State", $LVIF_IMAGE) _GUICtrlListView_SetItemEx($h_ListView, $struct_LVITEM) ; set state DllStructSetData($struct_LVITEM, "Mask", $LVIF_STATE) DllStructSetData($struct_LVITEM, "State", $LVIF_STATE) _GUICtrlListView_SetItemEx($h_ListView, $struct_LVITEM) ; set indent DllStructSetData($struct_LVITEM, "Mask", $LVIF_INDENT) DllStructSetData($struct_LVITEM, "State", $LVIF_INDENT) _GUICtrlListView_SetItemEx($h_ListView, $struct_LVITEM) ; set Param DllStructSetData($struct_LVITEM, "Mask", $LVIF_PARAM) DllStructSetData($struct_LVITEM, "State", $LVIF_PARAM) _GUICtrlListView_SetItemEx($h_ListView, $struct_LVITEM) EndFunc ;==>_LVCopyItem Func ListView_Click() ;---------------------------------------------------------------------------------------------- If $DebugIt Then _DebugPrint("$NM_CLICK") ;---------------------------------------------------------------------------------------------- EndFunc ;==>ListView_Click Func ListView_DoubleClick() ;---------------------------------------------------------------------------------------------- If $DebugIt Then _DebugPrint("$NM_DBLCLK") ;---------------------------------------------------------------------------------------------- EndFunc ;==>ListView_DoubleClick Func WM_MOUSEMOVE($hWndGUI, $MsgID, $wParam, $lParam) #forceref $MsgID, $wParam If $bDragging = False Then Return $GUI_RUNDEFMSG Local $lpos = ControlGetPos($hWndGUI, "", $h_ListView) Local $x = BitAND($lParam, 0xFFFF) - $lpos[0] Local $y = BitShift($lParam, 16) - $lpos[1] If $y > $LV_Height - 20 Then _GUICtrlListView_Scroll($h_ListView, 0, $y) ElseIf $y < 20 Then _GUICtrlListView_Scroll($h_ListView, 0, $y * - 1) EndIf _GUIImageList_DragMove($x, $y) Return $GUI_RUNDEFMSG EndFunc ;==>WM_MOUSEMOVE Func WM_LBUTTONUP($hWndGUI, $MsgID, $wParam, $lParam) #forceref $MsgID, $wParam $bDragging = False Local $lpos = ControlGetPos($hWndGUI, "", $h_ListView) Local $x = BitAND($lParam, 0xFFFF) - $lpos[0] Local $y = BitShift($lParam, 16) - $lpos[1] If $DebugIt Then _DebugPrint("$x = " & $x) If $DebugIt Then _DebugPrint("$y = " & $y) _GUIImageList_DragLeave($h_ListView) _GUIImageList_EndDrag() ;_GUIImageList_Destroy($hDragImageList[0]) If IsArray($hDragImageList) Then _GUIImageList_Destroy($hDragImageList[0]) ; gw _WinAPI_ReleaseCapture() Local $struct_LVHITTESTINFO = DllStructCreate($tagLVHITTESTINFO) DllStructSetData($struct_LVHITTESTINFO, "X", $x) DllStructSetData($struct_LVHITTESTINFO, "Y", $y) $a_index[1] = _SendMessage($h_ListView, $LVM_HITTEST, 0, DllStructGetPtr($struct_LVHITTESTINFO), 0, "wparam", "ptr") Local $flags = DllStructGetData($struct_LVHITTESTINFO, "Flags") If $DebugIt Then _DebugPrint("$flags: " & $flags) ;~ // Out of the ListView? If $a_index[1] = -1 Then Return $GUI_RUNDEFMSG ;~ // Not in an item? If BitAND($flags, $LVHT_ONITEMLABEL) = 0 And BitAND($flags, $LVHT_ONITEMSTATEICON) = 0 And BitAND($flags, $LVHT_ONITEMICON) = 0 Then Return $GUI_RUNDEFMSG ;If $a_index[0] < $a_index[1] - 1 Or $a_index[0] > $a_index[1] + 1 Then ; make sure insert is at least 2 items above or below, don't want to create a duplicate If $a_index[0] < $a_index[1] Or $a_index[0] > $a_index[1] Then If $DebugIt Then _DebugPrint("To = " & $a_index[1]) Local $i_newIndex = _LVInsertItem($a_index[0], $a_index[1]) If @error Then Return SetError(-1, -1, $GUI_RUNDEFMSG) Local $From_index = $a_index[0] If $a_index[0] > $a_index[1] Then $From_index = $a_index[0] + 1 For $x = 1 To _GUICtrlListView_GetColumnCount($h_ListView) - 1 _LVCopyItem($From_index, $i_newIndex, $x) If @error Then Return SetError(-1, -1, $GUI_RUNDEFMSG) Next _GUICtrlListView_DeleteItem($h_ListView, $From_index) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_LBUTTONUP ; WM_NOTIFY event handler Func WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tNMHDR, $code, $x, $y, $tNMLISTVIEW, $hwndFrom, $tDraw, $dwDrawStage, $dwItemSpec $tNMHDR = DllStructCreate($tagNMHDR, $lParam) ;NMHDR (hwndFrom, idFrom, code) If @error Then Return $code = DllStructGetData($tNMHDR, "Code") $hwndFrom = DllStructGetData($tNMHDR, "hWndFrom") Switch $hwndFrom Case $h_ListView Switch $code Case $LVN_BEGINDRAG If $DebugIt Then _DebugPrint("$LVN_BEGINDRAG") $x = BitAND($lParam, 0xFFFF) $y = BitShift($lParam, 16) $tNMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $lParam) $a_index[0] = DllStructGetData($tNMLISTVIEW, "Item") $hDragImageList = _GUICtrlListView_CreateDragImage($h_ListView, $a_index[0]) If @error Then Return SetError(-1, -1, $GUI_RUNDEFMSG) _GUIImageList_BeginDrag($hDragImageList[0], 0, 0, 0) If @error Then Return SetError(-1, -1, $GUI_RUNDEFMSG) If $DebugIt Then _DebugPrint("From = " & $a_index[0]) ;_GUIImageList_DragEnter($h_ListView, $x, $y) ; commenting out this shows dragged image ? _WinAPI_SetCapture($hWndGUI) $bDragging = True Case $NM_CUSTOMDRAW If $DebugIt Then _DebugPrint("$NM_CUSTOMDRAW") $tDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) $dwDrawStage = DllStructGetData($tDraw, "dwDrawStage") $dwItemSpec = DllStructGetData($tDraw, "dwItemSpec") Switch $dwDrawStage Case $CDDS_PREPAINT If $DebugIt Then _DebugPrint("$CDDS_PREPAINT") Return $CDRF_NOTIFYITEMDRAW Case $CDDS_ITEMPREPAINT If $DebugIt Then _DebugPrint("$CDDS_ITEMPREPAINT") ;~ If BitAND($dwItemSpec, 1) = 1 Then ;~ DllStructSetData($tDraw, "clrTextBk", $CLR_AQUA) ;~ Else ;~ DllStructSetData($tDraw, "clrTextBk", $CLR_WHITE) ;~ EndIf Return $CDRF_NEWFONT EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _DebugPrint($s_text) $s_text = StringReplace($s_text, @LF, @LF & "-->") ConsoleWrite("!===========================================================" & @LF & _ "+===========================================================" & @LF & _ "-->" & $s_text & @LF & _ "+===========================================================" & @LF) EndFunc ;==>_DebugPrint
-
Nicely done, thanks for sharing Sean. The fix is to either comment out or delete this line;_GUICtrlListView_SetUnicodeFormat($directory_listview, False) or change to _GUICtrlListView_SetUnicodeFormat($directory_listview, True)
-
Network Connection Information?
picaxe replied to darkjohn20's topic in AutoIt General Help and Support
Try this by trancexx -
How to read a listview that is dynamically updating
picaxe replied to jigne's topic in AutoIt General Help and Support
If you can get the listview handle, then _GUICtrlListView_GetItemTextString can do it. -
Problem with "_ExcelWriteFormula"
picaxe replied to CongTin's topic in AutoIt General Help and Support
This works on Excel2003 #include <Excel.au3> Local $oExcel = _ExcelBookNew() ;Create new book, make it visible _ExcelWriteCell($oExcel, 1234567, 2, 2) ; B2 _ExcelWriteCell($oExcel, 234567, 4, 2) ; B4 _ExcelWriteFormula($oExcel, '=IF(LEFT(R2C2,1)="1",RIGHT(R2C2,6)/RIGHT(R4C2,19),"")', 2, 3) ; C2 -
Good to see you've got it working. ShellExecute should also work, I often use it to register dll's.
-
Try this (untested), to register your dll FileInstall("C:\Program Files (x86)\ImageMagick-6.6.1-Q16\ImageMagickObject.dll", @SystemDir & "\", 0) $sDll = "ImageMagickObject.dll" If Not ShellExecute("regsvr32.exe", $sDll, @SystemDir) Then MsgBox(262144 + 16, @ScriptName, "Can not register " & $sDll & @TAB) Exit EndIf $oImg = ObjCreate("ImageMagickObject.MagickImage.1") If Not IsObj($oImg) Then MsgBox(262144 + 16, @ScriptName, "Can not create ImageMagickObject object" & @TAB) Exit EndIfEdit: message should be "Can not create ImageMagickObject object"
-
How to select more than one item in a list?
picaxe replied to apfeI's topic in AutoIt General Help and Support
Listbox requires style $LBS_EXTENDEDSEL for multiple select. -
Regular Expression to escape characters
picaxe replied to water's topic in AutoIt General Help and Support
You can use \Q and \E to disable/enable pattern metacharacter. -
Outer function has no return value
picaxe replied to zadu's topic in AutoIt General Help and Support
You don't directly call the error handler. Any COM errors should automatically call the handler and you will get a msgbox with error info. In some cases just the WinDesc text will tell you why the call failed.