Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/03/2021 in all areas

  1. If you want to improve _ArrayDisplay loading speed, why not use a virtual listview. Since data isn't stored in a virtual listview, there's no loading time and the listview shows up instantly. Here an example with 1,000,000 rows and 10 columns. Run the code in SciTE with F5. #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=Y Opt( "MustDeclareVars", 1 ) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Global $iRows = 1000000, $iCols = 10, $aArray[$iRows][$iCols] Global $hListView Example() Func Example() ; Create array Local $l, $hTimer = TimerInit() For $i = 0 To 9 For $j = 0 To $iRows / 10 - 1 $l = $i * $iRows / 10 + $j For $k = 0 To 9 $aArray[$l][$k] = 10 * $l + $k Next Next ConsoleWrite( "Rows = " & ( $i + 1 ) * $j & @CRLF ) Next ConsoleWrite( TimerDiff( $hTimer ) & @CRLF ) ; Approx. 8/11 seconds on Windows 7/10 ; Create GUI Local $hGui = GUICreate( "Virtual ListView", 788+20, 788+20 ) ; Create ListView Local $idListView = GUICtrlCreateListView( "", 10, 10, 788, 788, $LVS_OWNERDATA, $WS_EX_CLIENTEDGE ) _GUICtrlListView_SetExtendedListViewStyle( $idListView, $LVS_EX_DOUBLEBUFFER + $LVS_EX_FULLROWSELECT ) $hListView = GUICtrlGetHandle( $idListView ) For $i = 0 To $iCols - 1 _GUICtrlListView_AddColumn( $idListView, "Col" & $i, 75 ) Next GUICtrlSendMsg( $idListView, $LVM_SETITEMCOUNT, $iRows, 0 ) ; Register WM_NOTIFY message handler through subclassing Local $pNotifyHandler = DllCallbackGetPtr( DllCallbackRegister( "NotifyHandler", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr" ) ) DllCall( "comctl32.dll", "bool", "SetWindowSubclass", "hwnd", $hGui, "ptr", $pNotifyHandler, "uint_ptr", 0, "dword_ptr", 0 ) ; $iSubclassId = 0, $pData = 0 ; Show GUI GUISetState( @SW_SHOW ) ; Loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup DllCall( "comctl32.dll", "bool", "RemoveWindowSubclass", "hwnd", $hGui, "ptr", $pNotifyHandler, "uint_ptr", 0 ) ; $iSubclassId = 0 GUIDelete( $hGui ) EndFunc Func NotifyHandler( $hWnd, $iMsg, $wParam, $lParam, $iSubclassId, $pData ) If $iMsg <> 0x004E Then Return DllCall( "comctl32.dll", "lresult", "DefSubclassProc", "hwnd", $hWnd, "uint", $iMsg, "wparam", $wParam, "lparam", $lParam )[0] ; 0x004E = $WM_NOTIFY Local $tNMHDR = DllStructCreate( $tagNMHDR, $lParam ) Switch HWnd( DllStructGetData( $tNMHDR, "hWndFrom" ) ) Case $hListView Switch DllStructGetData( $tNMHDR, "Code" ) Case $LVN_GETDISPINFOW Local $tNMLVDISPINFO = DllStructCreate( $tagNMLVDISPINFO, $lParam ) Local Static $tText = DllStructCreate( "wchar[50]" ), $pText = DllStructGetPtr( $tText ) DllStructSetData( $tText, 1, $aArray[DllStructGetData($tNMLVDISPINFO,"Item")][DllStructGetData($tNMLVDISPINFO,"SubItem")] ) DllStructSetData( $tNMLVDISPINFO, "Text", $pText ) Return EndSwitch EndSwitch Return DllCall( "comctl32.dll", "lresult", "DefSubclassProc", "hwnd", $hWnd, "uint", $iMsg, "wparam", $wParam, "lparam", $lParam )[0] #forceref $iSubclassId, $pData EndFunc
    2 points
  2. Certainly I miss patch5 in the merge for the transpose do what you want perhaps less speed is enough if the 2 functions to add is to much I include the updated file ArrayDisplayInternals2.au3
    2 points
  3. 1 point
  4. As the WebDriver UDF - Help & Support thread has grown too big, I started a new one. The prior thread can be found here.
    1 point
  5. Well the photo has been taken correctly since you got the consolewrite stating that the file exists. Now it seems that the _SendPhoto function is not working properly. I am not familiar with Telegram Bot, but don't you need to _InitBot first ?
    1 point
×
×
  • Create New...