Leaderboard
Popular Content
Showing content with the highest reputation on 05/03/2025 in all areas
-
Yeah I think so, I'm getting E_FAIL at the moment trying to create the control though. I think I'll need to look closer at these WinUI 2 libraries.. The other thing is- I'm not sure how it handles its User Data Folder for Xaml islands. In a UWP app this would apparently be squirreled away in the "ApplicationData\LocalFolder subfolder in the package's folder" - so not sure how this will translate! The code would look like something like this to create the control... #include "Include\Classes\Windows.UI.Xaml.Controls.Webview.au3" #include "Include\Classes\Windows.Foundation.Uri.au3" ...... Local $pCtrl_Fact = _WinRT_GetActivationFactory("Windows.UI.Xaml.Controls.WebView", $sIID_IWebviewFactory4) _WinRT_DisplayInterfaces($pCtrl_Fact) Local $pControl = IWebViewFactory4_CreateInstanceWithExecutionMode($pCtrl_Fact, $mWebViewExecutionMode["SameThread"]) IDesktopWindowXamlSource_SetContent($pDesktopWinXamlSrc, $pControl) Local $pSrcFact = _WinRT_GetActivationFactory("Windows.Foundation.Uri", $sIID_IUriRuntimeClassFactory) Local $pSrc = IUriRuntimeClassFactory_CreateUri($pSrcFact, "https://www.autoitscript.com/forum") IWebView_Navigate($pControl, $pSrc)2 points
-
WebDriver UDF - React-select dropdown list
mLipok reacted to SOLVE-SMART for a topic
Here is the announced video, a little how-to one: 💡 Maybe I create few more videos like this for XPath usage and determination. I guess also for more JavaScript debugging (in the browser) etc. Time will show. Best regards Sven 👉 Btw: Forgive me, my spoken english is a bit rusty (as non native speaker). But for one take 🎬 only, it's not too bad (I hope so).1 point -
Hi all, I'll try to keep this succinct... Since windows 10 1903 it has been possible to embed UWP controls (i.e. XAML controls) in win32 apps. The container that holds a XAML control is a XAML Island. For non-legacy media playback, Microsoft tells us to use the WinRT MediaPlayer object with the MediaPlayerElement control. MediaPlayerElement is the UI & video rendering component of the player (the XAML control). The other MediaPlayer object is the bones of the player which you attach to the control. To get this working you annoyingly need to add the maxversiontested element to the application manifest. There's script in the zip which will copy AutoIt.exe (or AutoIt_x64.exe if you're using it) and update its manifest. If you replace the original file with the modified one, you should be able to successfully run the example with the F5 key. Or here's a screenshot if you just want to see the result! PS. As an aside, Another way of approaching modern playback is via MediaEngine which we've recently attempted to get going. This approach doesn't play well with autoit though, and you need to do ungodly things to prevent callbacks from crashing your script! MediaPlayer.zip1 point
-
MediaPlayerElement - WinRT Xaml Island
MattyD reacted to argumentum for a topic
even awesome-er would be to just declare the exe to use: #AutoIt3Wrapper_AutoIt3=D:\Utilities\AutoIt3\autoit3_x64-Mod.exe ; replace with your path and that is something that didn't come to mind at the time so, I'll remove the patch as is obviously not needed.1 point -
thanks When the router does not have access to the Internet but the internal network is established on the router, the script almost locks up for a long time. Infinite loop with this While 1 ; ... $i_NTP_Server_IDX += 1 If $i_NTP_Server_IDX = $i_NTP_Server_Count Then $i_NTP_Server_IDX = 0 ; <== Infinite Loop if Internet not accesible in Router WEnd1 point
-
MediaPlayerElement - WinRT Xaml Island
argumentum reacted to MattyD for a topic
Awesome @argumentum!1 point -
MediaPlayerElement - WinRT Xaml Island
MattyD reacted to argumentum for a topic
...a bunch of nonsense but kept for hysterical historical purposes ... so, yes. Use the solution below1 point -
Well said! I agree with you... ColorPicker works well (manifest patch needed) and callback function works great! P.S. peeking at ClassExplorer I see that there is a "Windows.UI.Xaml.Controls.IWebView2" what is this for? can you embed a browser with this?!?1 point
-
Hi everyone, On the back of this recent post around xaml islands, I've started to make some progress on those event handlers we were talking about earlier in this thread. So below Is my first attempt at a colour picker with notifications. (if you don't see the control, you'll likely need to swap out the application manifest, as detailed in the other thread!) If we can get things working nicely, I'd probably incorporate something into the WinRT library which would handle the cumbersome part of building the objects. I think people should only need worry about writing handlers and "registering" them! ColorPicker.zip1 point
-
win32-appcontainer-tools
Parsix reacted to WildByDesign for a topic
win32-appcontainer-tools (https://github.com/WildByDesign/win32-appcontainer-tools) You will notice that a lot of the apps that I create and share here are very niche security tools that are really only used by a small subset of computer security professionals. However, the reason why I want to share my apps here is because I always want to give back and help in any way possible. Even though my apps wont be used by many people here in the AutoIt community, there were hundreds of roadblocks that I ran into and came up with working solutions for. It is those unique solutions that might benefit some users. For example, win32-darkmode is great. But Microsoft never completely finished it and only did what they needed out of it. Examples: Checkboxes Previously needed to remove theming from checkbox which used old style The text of the checkbox could not be colored without using old style checkbox I use a label, lined up with the checkbox, and make that label function (clickable) along with the checkbox This ensures still being able to use modern looking checkbox Input/Edit Boxes Using dark mode, those input/edit boxes get a terribly thick border by default with awful contrast I used no border with my input/edit boxes and custom color/label to look nicer Combo boxes Combo boxes normally could not be colored for dark mode The GUIComboBoxColor UDF helped here Menu bar, status bar, etc. Custom ownerdrawn menu bar and status bar Features: starting normal win32 apps within an AppContainer sandbox listview of AppContainer capabilities to select set ACL permissions on files, folders and registry keys for AppContainers ETW (event tracing for Windows) tracing for blocked AppContainer objects built on GitHub Actions Includes: DarkMode UDF originally by @NoNameCode, updated by @argumentum ExtMsgBox by @Melba23 GUIListViewEx by @Melba23 Ownerdrawn status bar by @pixelsearch , including @Kafu, @Andreik, @argumentum GUIComboBoxColor by @SmOke_N _GUICtrlListView_SaveCSV by @guinness ModernMenuRaw by Holger Kotsch, @ProgAndy, @LarsJ Screenshots:1 point -
I have a function that gets the time from the internet, i.e. it uses NTP servers. Sometimes, however, this function can be called several thousand times in a single data processing process that takes, say, an hour. I wonder if it will be enough if I get the time using NTP, and then for the next specified time interval I will use TimerDiff () and then again after this interval, I will repeat the query of the NTP server. And now I wondering about TimerDiff() usage because of: https://www.autoitscript.com/autoit3/docs/functions/TimerDiff.htm Do these processor imperfections matter if I am going to refresh my time every 5 minutes by downloading it from the NTP server? Here is my modified _NTP_GetTime_PLServers() function: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _NTP_GetTime_PLServers ; Description ...: Function for pickup PL current time, alternately from different servers ; Syntax ........: _NTP_GetTime_PLServers() ; Parameters ....: none ; Return values .: NTP Time ; Author ........: mLipok ; Modified ......: ; Remarks .......: https://pl.wikipedia.org/wiki/Serwer_czasu ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/topic/169356-how-to-get-the-current-date-from-the-internet/?page=2 ; Example .......: No ; =============================================================================================================================== Func _NTP_GetTime_PLServers() Local Const $aNTP_Servers = _ [ _ 'time.windows.com', _ ; standardowy serwer czasu WINDOWS 'ntp1.tp.pl', _ ; (źródÅ‚o: atomowy zegar cezowy 5071A TP S.A.) 'ntp2.tp.pl', _ ; (źródÅ‚o: atomowy zegar cezowy 5071A TP S.A.) 'ntp.icm.edu.pl', _ ; http://icm.edu.pl/web/guest 'ntp.certum.pl', _ ; certum.pl 'pool.ntp.org', _ 'time.coi.pw.edu.pl', _ ; https://pl.wikipedia.org/wiki/Serwer_czasu 'ntp.nask.pl', _ ; https://pl.wikipedia.org/wiki/Serwer_czasu 'ntp.task.gda.pl', _ ; https://pl.wikipedia.org/wiki/Serwer_czasu 'news-archive.icm.edu.pl', _ ; https://pl.wikipedia.org/wiki/Serwer_czasu '0.pl.pool.ntp.org', _ ; http://www.pool.ntp.org/zone/pl '1.pl.pool.ntp.org', _ ; http://www.pool.ntp.org/zone/pl '2.pl.pool.ntp.org', _ ; http://www.pool.ntp.org/zone/pl '3.pl.pool.ntp.org', _ ; http://www.pool.ntp.org/zone/pl 'ntp.media-com.com.pl', _ ; BieruÅ„ > W.T. 'tempus1.gum.gov.pl', _ ; https://www.gum.gov.pl/pl/zegar/ 'tempus2.gum.gov.pl' _ ; https://www.gum.gov.pl/pl/zegar/ ] Local Static $sNTP_Time_Static #Region - _NTP_GetTime_PLServers() - checking interval Local Const $iTIMER_INTERVAL_SECONDS = 30 ; Local Static $hTimer = TimerInit() Local $iSecondsPastAway = Round(TimerDiff($hTimer) / 1000) If Not @Compiled Then ConsoleWrite("+ " & @ScriptLineNumber & ' :: ' & $iSecondsPastAway & ' / ' & $iTIMER_INTERVAL_SECONDS & ' >>> ' & _DateAdd('s', $iSecondsPastAway, $sNTP_Time_Static) & @CRLF) If $sNTP_Time_Static And $iSecondsPastAway <= $iTIMER_INTERVAL_SECONDS Then Return _DateAdd('s', $iSecondsPastAway, $sNTP_Time_Static) EndIf #EndRegion - _NTP_GetTime_PLServers() - checking interval #Region - _NTP_GetTime_PLServers() - checking internet time Local Const $i_NTP_Server_Count = UBound($aNTP_Servers) Local Static $i_NTP_Server_IDX = 0 If $i_NTP_Server_IDX = $i_NTP_Server_Count Then $i_NTP_Server_IDX = 0 While 1 $sNTP_Time_Static = _NTP_GetTime_PL($aNTP_Servers[$i_NTP_Server_IDX]) If Not @error Then ExitLoop $i_NTP_Server_IDX += 1 If $i_NTP_Server_IDX = $i_NTP_Server_Count Then $i_NTP_Server_IDX = 0 WEnd #EndRegion - _NTP_GetTime_PLServers() - checking internet time $hTimer = TimerInit() Return $sNTP_Time_Static EndFunc ;==>_NTP_GetTime_PLServers1 point
-
#Include <StructureConstants.au3> #Include <Date.au3> Func _NTP_FT($sServer, $fLocal = True) ;~ http://book.itep.ru/4/44/sntp4416.htm Local $tNTP = DllStructCreate('byte Header[4];byte RootDelay[4];byte RootDispersion[4];byte ReferenceIdentifier[4];byte ReferenceTimestamp[8];byte OriginateTimestamp[8];byte ReceiveTimestamp[8];byte TransmitTimestamp[8];byte KeyIdentifier[4];byte MessageDigest[16]') Local $tPacket = DllStructCreate('byte Packet[68]', DllStructGetPtr($tNTP)) Local $bPacket = 0, $tFT, $tQW, $aSocket, $aResult ;~ 0x1B000000 = 00011011 00000000 00000000 00000000b (LI = 00b VN = 011b Mode = 011b Stratum = 00000000b Poll = 00000000b Precision = 00000000b) $tNTP.Header = Binary('0x1B000000') UDPStartup() If @Error Then Return SetError(1, 0, 0) EndIf $aSocket = UDPOpen(TCPNameToIP($sServer), 123) If @Error Then ; Nothing Else UDPSend($aSocket, $tPacket.Packet) If @Error Then ; Nothing Else While 1 $bPacket = UDPRecv($aSocket, 68, 1) If (@Error) Or ($bPacket) Then ExitLoop EndIf Sleep(100) WEnd EndIf EndIf UDPCloseSocket($aSocket) UDPShutdown() If Not $bPacket Then Return SetError(2, 0, 0) EndIf $tFT = DllStructCreate($tagFILETIME) If $fLocal Then $tQW = DllStructCreate('uint64 Timestamp') Else $tQW = DllStructCreate('uint64 Timestamp', DllStructGetPtr($tFT)) EndIf $tPacket.Packet = $bPacket ConsoleWrite($bPacket & @CRLF) $tQW.Timestamp = Dec(StringMid(DllStructGetData($tNTP, 'TransmitTimestamp'), 3, 8), 2) * 10000000 + 94354848000000000 ConsoleWrite(Dec(StringMid(DllStructGetData($tNTP, 'TransmitTimestamp'), 3, 8), 2) & @CRLF) If $fLocal Then $aResult = DllCall('kernel32.dll', 'bool', 'FileTimeToLocalFileTime', 'struct*', $tQW, "struct*", $tFT) If (@Error) Or (Not $aResult[0]) Then Return SetError(3, 0, 0) EndIf EndIf Return $tFT EndFunc ;==>_NTP_FT $tFT = _NTP_FT('pool.ntp.org') ConsoleWrite(_Date_Time_FileTimeToStr($tFT) & @CRLF) 0x1C0100ED000000000000001450505300D8C63C4D731DB4060000000000000000D8C63C52CDD5AE56D8C63C52CDD827A800000000 3636870226 04/01/2015 12:43:461 point