Leaderboard
Popular Content
Showing content with the highest reputation on 04/12/2020 in all areas
-
WHAT : is .NET Common Language Runtime (CLR) Framework The Common Language Runtime (CLR) is a an Execution Environment . Common Language Runtime (CLR)'s main tasks are to convert the .NET Managed Code to native code, manage running code like a Virtual Machine, and also controls the interaction with the Operating System. As part of Microsoft's .NET Framework, the Common Language Runtime (CLR) is managing the execution of programs written in any of several supported languages. Allowing them to share common object-oriented classes written in any of the languages. HOW : To access the CLR environment you need to create an Appdomain Object - _CLR_GetDefaultDomain() An AppDomain provides an isolated region in which code runs inside of an existing process. Application domains provide an isolation boundary for security, reliability, and versioning, and for unloading assemblies. Application domains are typically created by runtime hosts, which are responsible for bootstrapping the common language runtime before an application is run. WHEN : Would you use CLR Runtime Hosts 1. To access .NET Class Libraries : System System.Collections System.Data System.Drawing System.IO System.Text System.Threading System.Timers System.Web System.Web.Services System.Windows.Forms System.Xml 2. Accessing custom build .Net Assemblies : Some Examples (but there are a ton out there) AutoItX3 - The .NET Assembly for using AutoItX JSonToXML libr. XMLRPC Libr. .NETPDF libr. .NETOCR Libr WInSCP Libr. ... 3. To Compile .Net Code into an Assembly 4. To Run C# or VB.net Code 5. To Mix AU3 and .Net functionality in your Application WHERE : To find documentation about CLR First of all you can find a lot on MSDN and here : Post 4 & Post 6 EXAMPLES : Multiple examples included in Zip !! Example : “System.Text.UTF8Encoding” Example : “System.IO.FileInfo” Example : “System.Windows.Forms” Example : AutoItX3 Custom .NET Assembly AutoItX Example : Compile Code C# and Code VB Example : Compile Code C# at Runtime WHO : Created the CLR.au3 UDF All credits go to : Danyfirex / Larsj / Trancexx / Junkew TO DO : The library is still Work in Process … (Some of the GUI Controls are not yet working as expected...) Anyone is free to participate in contributing to get the bugs resolved and to expand the CLR.au3 functionality ... Enjoy !! DOWNLOADS : (Last updated) - added CLR Constants.au3 - Danyfirex - Global Constants added (Magic numbers) - added .NET CLR CreateObject vs ObjCreate Example.au3 - Junkew • 2 approaches give the same result (only valid for COM Visible Assembly) • Includes a function that shows you which Assembly Classes are COM Visible - added .Net Conventional COM Objects Examples - ptrex - added .NET CLR CreateComInstanceFrom Example - Danyfirex - You can use it for Regfree COM Assembly Access - System.Activator has 4 methods : • CreateComInstanceFrom : Used to create instances of COM objects. • CreateInstanceFrom : Used to create a reference to an object from a particular assembly and type name. • GetObject : Used when marshaling objects. • CreateInstance : Used to create local or remote instances of an object. - added .NET Access SafeArrays Using AccVarsUtilities Example - LarsJ - added SafeArray Utilities functions in Includes - LarsJ - added .NET Access Native MSCorLib Classes - System - ptrex Multiple System Class Examples : • System.Random • System.DateTime • System.Diagnostics.PerformanceCounter • System.IO.FileInfo • System.Int32 • System.Double • System.Speech • System.Web - added Third Party Assembly Access - ptrex • WinSCP : https://winscp.net/eng/download.php • IonicZip : http://dotnetzip.codeplex.com/ - added more Examples using PowerShell GUI Assembly Access - ptrex • GUI Ribbon .NET Assembly using CLR Library • GUI Report Designer .NET Assembly using CLR Library • GUI SSRS Reporting .NET Assembly using CLR Library CLRv3a.zip .NET CLR Framework for AutoIT.pdf1 point
-
SetMicForPlayback
Zmy reacted to argumentum for a file
Version 0.2024.1.6
5,082 downloads
The reason for this you can read at https://www.autoitscript.com/forum/topic/196727-set-microphone-for-playback-device/ Runs on it's own without user interaction needed. When you "Select a playback device", it will select the corresponding microphone, or leave it as is, if one is not matched. It was coded on my PC ( a Windows 10 ), I have no more PCs to test if it will work on other configurations but by right-click the tray icon, a context menu will give you the option to see the list array of devices found and that may serve to aid in case this program need to be tweaked to better fit other setups. It did not run on a VM of WinXP, so if your OS is old, it may very well not have support for the COM calls this program uses to operate. I should also advise to run and/or compile with v3.3.14.5. "OnEvent" is too slow in newer versions for this code.1 point -
It was just for fun Deye, because of the other thread. But alright, I'll go away. Sorry for that...1 point
-
Or if someone prefers using WMI #AutoIt3Wrapper_UseX64=y #include <Constants.au3> #include <Array.au3> Opt("MustDeclareVars", 1) Local $aClass = ["Win32_OperatingSystem", "Win32_PhysicalMemory", "Win32_Processor", "Win32_OperatingSystem", "Win32_Process", "Win32_SystemUsers"] Local $aWMI For $sClass In $aClass $aWMI = _FillArray($sClass) _ArrayDisplay($aWMI) Next Func _FillArray($Class) Local $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") Local $colItems = $objWMIService.ExecQuery('SELECT * FROM ' & $Class) If Not IsObj($colItems) Then Return SetError (1) ; "Not an object" If Not $colItems.count Then Return SetError (2) ; "Not found" Local $aWMI[$colItems.count + 1][$colItems.ItemIndex(0).Properties_.count], $iCount = 0, $nCount = 1 For $oProperty In $colItems.ItemIndex(0).Properties_ $aWMI[0][$iCount] = $oProperty.name $iCount += 1 Next For $oItem In $colItems $iCount = 0 For $oProperty In $oItem.Properties_ $aWMI[$nCount][$iCount] = $oProperty.Value $iCount += 1 Next $nCount += 1 Next Return $aWMI EndFunc ;==>_FillArray1 point
-
Using @Chimp suggestion, you can combine both solutions into a single approach : #include <Constants.au3> #include <GUIConstants.au3> #include <FontConstants.au3> #include <WinAPI.au3> HotKeySet("{ESC}", "Terminate") Local $hGUI = GUICreate("MyGUI", 250, 50, -1, -1, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_LAYERED) GUISetBkColor(0x000000) _WinAPI_SetLayeredWindowAttributes($hGUI, 0x000000) Local $idLabel = GUICtrlCreateLabel ("", 0, 0,250, 50, $SS_CENTER+$SS_CENTERIMAGE, $GUI_WS_EX_PARENTDRAG) GUICtrlSetColor (-1,0x101010) GUICtrlSetFont (-1, 17, $FW_SEMIBOLD) GUISetState(@SW_SHOW, $hGUI) Local $iPing, $iPrev While Sleep(100) $iPing = Ping("www.google.ca") If $iPing <> $iPrev Then GUICtrlSetData ($idLabel, $iPing & " ms.") $iPrev = $iPing EndIf WEnd Func Terminate() Exit EndFunc ;==>Terminate1 point
-
WebDriver UDF (W3C compliant version) - 2024/09/21
rocije9440 reacted to Danp2 for a topic
@rocije9440 You have to retrieve the associated URL using _WD_ElementAction -- $sArLinks = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '//a[@class="entryLink"]', "", "True") For $sLink IN $sArLinks $sHref = _WD_ElementAction($sSession, $sLink, "attribute", "href") ; Do something here with retrieved value Next1 point -
nice script @Danyfirex P.S. by adding this line just below the GuiCreate, will also allows you to drag that around on the screen... GUICtrlCreateLabel('', 0, 0, 250, 50, -1, $GUI_WS_EX_PARENTDRAG)1 point
-
WebDriver UDF (W3C compliant version) - 2024/09/21
rocije9440 reacted to Danp2 for a topic
@rocije9440 "clubtone.net/music" is from the URL, not the link's text. Therefore, you can't use $_WD_LOCATOR_ByPartialLinkText. Try it with an xpath of '//a[@class="entryLink"]'1 point -
Yes it is possible, you just need to create an empty disable label all over that the GUI. @Aelc already provide you the basic solution1 point
-
Hello Hemrry(I speak Spanish ☺️) Nice to see Spanish user. Here an example to play with. (Aqui te dejo un ejemplo con el que puedes jugar/modificar) #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <WinAPI.au3> HotKeySet("{ESC}", "Terminate") Global $hGUI = 0, $hGraphics = 0, $hBrush = 0, $hFormat = 0, $hFamily = 0, $hFont = 0, $tLayout = 0 $hGUI = GUICreate("MyGUI", 250, 50, -1, -1, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED)) GUISetBkColor(0x000000) _WinAPI_SetLayeredWindowAttributes($hGUI, 0x000000) GUISetState(@SW_SHOW, $hGUI) _GDIPlus_Startup() $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hBrush = _GDIPlus_BrushCreateSolid(0xFF00FF00) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hFont = _GDIPlus_FontCreate($hFamily, 17, 1) $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0) While Sleep(100) Local $iPing = Ping("www.google.es") If $iPing Then _GDIPlus_GraphicsClear($hGraphics) _GDIPlus_GraphicsDrawStringEx($hGraphics, $iPing & " ms.", $hFont, $tLayout, $hFormat, $hBrush) EndIf WEnd Func Terminate() _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete($hGUI) Exit 0 EndFunc ;==>Terminate Saludos1 point
-
Danyfirex, Try this version and see what you think: M231 point
-
Danyfirex, I like that idea - although i would probably use the hidden AutoIt GUI as parent rather then create another one. Let me play around with it for a bit - I have 30 mins before I start cooking Easter lunch. M231 point
-
Thanks. To make a partition bootable (NB: only one (1) partition can be bootable per physical drive, so you always need to edit two flags, not one), look for, and edit boolean IsPrimary (any non-zero value = True; usually 0x01 or 0x80); it's the first byte of each partition table entry in the MBR. In the UDF, see var $partition_active in Func _ReadPartitionEntry for more info. WARNING: any changes you make to these low-level descriptors is entirely your own responsibility. Please ensure you back up your entire physical drive (not just the files on it), before you start tampering with it. In this particular case, editing a single byte can result in your system no longer booting at all, and no easy way of fixing it. Only proceed if that scenario does not concern you at all.1 point
-
Hey i didn't find something about to notify a dragged file .. so i tried to get the cursor. not that clean because MouseGetCursor() actually return -1 which is unknown. someone has a better solution? #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <misc.au3> #include <windowsConstants.au3> ;~ $GUI = GUICreate("GUI Drag", 300, 200, -1, -1, $WS_POPUP, $WS_EX_ACCEPTFILES) $GUI = GUICreate("GUI Drag", 300, 200, -1, -1, -1, $WS_EX_ACCEPTFILES) $label_empty = GUICtrlCreateLabel("", 0, 0, 300, 200) $label = GUICtrlCreateLabel("drop files here", 100, 75, 100, 50, BitOR($SS_CENTER, $SS_CENTERIMAGE, $SS_SUNKEN)) GUICtrlSetState($label, $GUI_DROPACCEPTED) $switch = False GUISetState() While GUIGetMsg() <> -3 If _GUIWaitDrag($GUI, $label) = True Then If $switch <> True Then GUISetBkColor(0xFF8200, $GUI) $switch = True Else If $switch <> False Then GUISetBkColor(0xFFFFFF, $GUI) $switch = False EndIf Sleep(10) WEnd Func _GUIWaitDrag($GUI, $CTRL) Local $L, $T, $mouse_pos, $ctrl_pos, $gui_pos, $gui_client If MouseGetCursor() = -1 Then $mouse_pos = MouseGetPos() $ctrl_pos = ControlGetPos($GUI, "", $CTRL) $gui_pos = WinGetPos($GUI, "") $gui_client = WinGetClientSize($GUI, "") $L = $ctrl_pos[0] + $gui_pos[0] $T = $ctrl_pos[1] + $gui_pos[1] + ($gui_pos[3] - $gui_client[1]) If $mouse_pos[0] >= $L And $mouse_pos[0] <= $L + $ctrl_pos[2] And $mouse_pos[1] >= $T And $mouse_pos[1] <= $T + $ctrl_pos[3] Then Return True Else Return False EndIf EndFunc ;==>_GUIWaitDrag1 point