
nacerbaaziz
Active Members-
Posts
347 -
Joined
-
Last visited
About nacerbaaziz
- Birthday 07/12/1998
Profile Information
-
Location
algeria
-
WWW
https://mx-blind.com
-
Interests
i am Interested in learning programming languages especially autoit language
Recent Profile Visitors
1,370 profile views
nacerbaaziz's Achievements

Universalist (7/7)
15
Reputation
-
no the list box is only to move with keyboard, the program is for blind users, so there is option to search, and to move one by one. here the list box is just to make them know the file that is selected and give them the ability to check the list items to remove file or play it or copy the file path.
-
Good morning autoit forum users Please, I need your opinion about this code, can you help me make it faster than it is now? By the way, this function adds a list of files to my listbox, the items may be more than 100k, need your help please? Now it takes a lot of time to load items Func arrayDir($folder = $dir) If StringRight($folder, 2) = "\\" Then $folder = StringTrimRight($folder, 1) Local $files, $next, $num = 0 FileChangeDir($folder) Opt("GUIOnEventMode", 0) Local $h_handleLink = $hGUI Local $h_handleLinkChild = $WS_CLIPCHILDREN If Not (BitAND(WinGetState($h_handleLink, ""), $WIN_STATE_VISIBLE)) Then $h_handleLink = False $h_handleLinkChild = -1 EndIf Local $PRGWindow = GUICreate("Opening Folder", 200, 200, -1, -1, $h_handleLinkChild, $rtl, $h_handleLink) Local $PRGRSLabel = GUICtrlCreateLabel(LNG("openingProcessing", 0), 10, 10, 200, 50) Local $PRGRS = GUICtrlCreateProgress(10, 80, 180, 30) GUIStartGroup("") Local $PRGCancel = GUICtrlCreateButton("cancel", 10, 120, 200, 30) GUICtrlSetState(-1, $GUI_focus) If $b_transpa Then WinSetTrans($PRGWindow, "", 0) GUISetState(@SW_SHOW, $PRGWindow) Global $ArrayDirCancel = False GUIRegisterMsg($WM_command, "arrayDirCancel") Opt("GUICloseOnESC", 1) $files = _FileListToArrayRec($folder, $FilesExt, $FLTAR_files + $FLTAR_NOHIDDEN, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH) If IsArray($files) Then ;AdlibUnRegister("UpdateProgress") $CrntPlayList[0] = False _GUICtrlListBox_BeginUpdate($List) For $i = 1 To $files[0] If ($ArrayDirCancel) Then GUIDelete($PRGWindow) ExitLoop EndIf If (_GUICtrlListBox_SelectString($List, _GetFileName($files[$i]) & "|" & $files[$i]) = -1) Then _GUICtrlListBox_AddString($List, _GetFileName($files[$i]) & "|" & $files[$i]) GUICtrlSetData($PRGRS, ($i * 100 / $files[0])) GUICtrlSetData($PRGRSLabel, LNG("openingProcessing", $i)) $aListItems[2] &= $files[$i] & "|" $aListItems[0] += 1 $aListItems[3] &= $aListItems[0] - 1 & "|" EndIf Next _GUICtrlListBox_EndUpdate($List) ;AdlibRegister("UpdateProgress", 1000) Opt("GUICloseOnESC", 0) Opt("GUIOnEventMode", 1) GUIDelete($PRGWindow) GUISetState(@SW_ENABLE, $hGUI) Return $files[0] Else Opt("GUICloseOnESC", 0) Opt("GUIOnEventMode", 1) GUIDelete($PRGWindow) GUISetState(@SW_ENABLE, $hGUI) Return 0 EndIf EndFunc ;==>arrayDir Func arrayDirCancel($hWnd, $iMsg, $wParam, $lParam) Local $nNotifyCode = BitShift($wParam, 16) Local $nID = BitAND($wParam, 0x0000FFFF) Local $hCtrl = $lParam #forceref $hWnd, $iMsg, $wParam, $lParam#cs Switch $nNotifyCode Case $BN_CLICKED $ArrayDirCancel = True EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>arrayDirCancel
-
how to get page source on firefox browser
nacerbaaziz replied to hamadahali's topic in AutoIt General Help and Support
hello again i did that it will open a firefox page and give the source but what if i have a page opened before i run the example and i wanted to get it source can any one show us how that will be #include "wd_helper.au3" #include "wd_capabilities.au3" _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) ;~ Local $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'firefox') _WD_CapabilitiesAdd('browserName', 'firefox') _WD_CapabilitiesAdd('acceptInsecureCerts', True) _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() _WD_Startup() _WD_ConsoleVisible(False) $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.autoitscript.com/forum/topic/207406-how-to-get-page-source-on-firefox-browser/") _WD_LoadWait($sSession) MSGBox(64, "source", _WD_GetSource($sSession)) -
how to get page source on firefox browser
nacerbaaziz replied to hamadahali's topic in AutoIt General Help and Support
hello guys am also trying to do that with firefox the ff.au3 require the addon to be installed and the addon does not support the latest firefox version can anyone please give us an example about how to do that using the web driver or any other way i tried to use the send function to press ^u but it does not work as I want. -
nacerbaaziz reacted to a post in a topic: Compile multiple .ico files into one .dll file
-
hello guys, please i need your help am trying to work with CreateWindowEx api, i created the window with it controls, also i setup the call back function i'am using WinMSGLoop to focus with the keyboard. here i have a problem, i hope that you can help me. on the controls i used the UDF that comme with the autoit, such as _GUIButton_Create, _GUIListBox_Create.... but i can't find a STATIC control UDF, for that i used this local $h_ssrvlbl = _WinAPI_CreateWindowEx(0, "STATIC", "الخادم", BitOr($WS_VISIBLE, $WS_CHILD, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN), 250, 10, 100, 20, $hWnd) as you can see here, there is an arabic text, so here is the problem, the arabic text isn't show normally, what is the problem here? also i have an other question about keyboard focus, when i used WinMSGLoop, it worked, but if i press alt+tab to switch windows or focus an other window and return back to my window, the focus of control is kill. can any one help me to solve that please? my code will be as file here with the include files i hope can any one help me here thanks in advance speed Test win.zip
-
Professor_Bernd reacted to a post in a topic: A function to run any external program with administrator privileges
-
hello autoit team please i tried to create a SPVoice object when i create the object and tried to use this function SetAlertBoundary it gave me an error please where is the problem? here is the code local $o_Sapi_OBJ = ObjCreate("SAPI.SpVoice") if IsObj($o_Sapi_OBJ) then $o_Sapi_OBJ.SetAlertBoundary("SPEI_PHONEME") endIf note i got the function name from microsoft web site https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms719784(v=vs.85) i have windows10
-
sorry i does not take care to the built function because i did not found it in the example files am sorry. thanks for let me know
- 4 replies
-
- date
- calculator
-
(and 3 more)
Tagged with:
-
it recomended to use the builten function _DateDiff hello autoit team i made a simple function to help me get the difference between to date i liked to share it with you the paramatrs of this function is firstdate and lastedate the two params is as the following year/month/day hours:minuts:seconds here is the function #include <date.au3> func _dateBetween($s_firstDate, $s_lastDate = default) if not (StringRegExp($s_firstDate, "((\d{4})\/(\d{2})\/(\d{2})\s(\d{2})\:(\d{2})\:(\d{2}))", 0) = 1) then Return SetError(1, 0, 0) if $s_lastDate = default then $s_lastDate = @year & "/" & @mon & "/" & @mday & " " & @hour & ":" & @min & ":" & @sec if not (StringRegExp($s_lastDate, "((\d{4})\/(\d{2})\/(\d{2})\s(\d{2})\:(\d{2})\:(\d{2}))", 0) = 1) then Return SetError(2, 0, 0) local $a_FirstSplitDate = StringSplit(StringRegExpReplace($s_firstDate, "((.*)\s(.*))", "$2"), "/", 2) local $a_FirstSplitTime = StringSplit(StringRegExpReplace($s_firstDate, "((.*)\s(.*))", "$3"), ":", 2) local $a_lastSplitDate = StringSplit(StringRegExpReplace($s_lastDate, "((.*)\s(.*))", "$2"), "/", 2) local $a_LastSplitTime = StringSplit(StringRegExpReplace($s_lastDate, "((.*)\s(.*))", "$3"), ":", 2) local $i_firstDateValue = _DateToDayValue($a_FirstSplitDate[0], $a_FirstSplitDate[1], $a_FirstSplitDate[2]) local $i_LastDateValue = _DateToDayValue($a_LastSplitDate[0], $a_LastSplitDate[1], $a_LastSplitDate[2]) if $i_firstDateValue > $i_LastDateValue then Return SetError(3, 0, 0) local $i_totalDays = $i_LastDateValue-$i_firstDateValue if not ($i_totalDays = 0) then if $a_FirstSplitTime[0] <= $a_lastSplitTime[0] then $i_totalDays += 1 $a_lastSplitTime[0] -= $a_FirstSplitTime[0] elseIf $a_FirstSplitTime[0] > $a_lastSplitTime[0] then if $i_totalDays > 0 then $i_totalDays -= 1 $a_FirstSplitTime[0] -= $a_lastSplitTime[0] endIf endIf endIf local $i_totalYears = 0 if $i_totalDays >= 365 then While $i_totalDays >= 365 $i_totalYears += 1 $i_totalDays -= 365 Wend endIf local $i_TotalMonths = 0 if $i_totalDays >= 30 then While $i_totalDays >= 30 $i_totalMonths += 1 $i_totalDays -= 30 Wend endIf local $i_totalWeeks = 0 if $i_totalDays >= 7 then While $i_totalDays >= 7 $i_totalWeeks += 1 $i_totalDays -= 7 Wend endIf $i_totalSeconds = ((($a_FirstSplitTime[0]*60)*60)+($a_FirstSplitTime[1]*60)+($a_FirstSplitTime[2]))-((($a_lastSplitTime[0]*60)*60)+($a_lastSplitTime[1]*60)+($a_LastSplitTime[2])) local $minus = "" if $i_totalSeconds < 0 then $minus = "-" $i_totalSeconds = StringReplace($i_totalSeconds, "-", "") endIf local $i_totalHours = 0 if $i_totalSeconds >= 3600 then While $i_totalSeconds >= 3600 $i_totalHours += 1 $i_totalSeconds -= 3600 Wend endIf local $i_totalminuts = 0 if $i_totalSeconds >= 60 then While $i_totalSeconds >= 60 $i_totalminuts += 1 $i_totalSeconds -= 60 Wend endIf local $a_arrayReturn[7] $a_arrayReturn[0] = $i_totalYears $a_arrayReturn[1] = $i_totalMonths $a_arrayReturn[2] = $i_totalWeeks $a_arrayReturn[3] = $i_totalDays $a_arrayReturn[4] = $minus & $i_totalHours $a_arrayReturn[5] = $minus & $i_totalminuts $a_arrayReturn[6] = $minus & $i_totalSeconds return $a_arrayReturn endFunc here is an example $a_calc = _dateBetween("2015/02/12 23:00:05", "2030/02/12 23:25:50") msgBox(64, "result", StringFormat("the difference is : %i years and %i months and %i weeks and %i days and %i hours and %i minuts and %i seconds", $a_calc[0], $a_calc[1], $a_calc[2], $a_calc[3], $a_calc[4], $a_calc[5], $a_calc[6])) am waiting for your comments with my greetings
- 4 replies
-
- date
- calculator
-
(and 3 more)
Tagged with: