Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/19/2020 in all areas

  1. 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.pdf
    1 point
  2. .NET Common Language Runtime (CLR) Framework was published five months ago. CLR.au3 which is the main UDF makes it possible to execute .NET code directly in an AutoIt script. .NET code in this context should be perceived in a very broad sense. As shown in the examples, there are virtually no limits to the possibilities that the UDF opens up for. .NET Common Language Runtime (CLR) Framework is the result of the work in Using .NET libary with AutoIt, possible? CLR.au3 is implemented in this thread. Most of the code in CLR.au3 is a translation of CLR.ahk from .NET Framework Interop (CLR, C#, VB) in the AutoHotkey forum. DotNet.au3 is a complete translation of CLR.ahk. This example is about DotNet.au3. It contains information about the functions in the UDF. Usage of the functions is demonstrated through small examples. And there is a description of a few .NET Framework concepts. The AutoHotkey project The AutoHotkey project started in .NET Framework Interop in autumn 2009. The latest update of CLR.ahk in .NET Framework Interop (CLR, C#, VB) was november 2011. The whole project seems to have been developed over this 3-year period. The project was developed by Lexikos in the AutoHotkey forum. He certainly looks very knowledgeable about the code in the .Net Framework and he has done a great job in implementing the AutoHotkey code in CLR.ahk. Lots of credit to Lexikos. If you want to test the AutoHotkey code, you can find a recipe here. DotNet.au3 Because a lot of COM support is included internally in AutoHotkey and especially because AutoHotkey natively supports safearrays, the code in CLR.ahk is short and compact. 150 code lines. In the zip-file below AutoIt safearray support is implemented in two separate UDFs: SafeArray.au3 and AccVarsUtilities.au3. Both of these UDFs were started in Accessing AutoIt Variables. That way, it has also been possible to keep the code in DotNet.au3 short and compact. 190 code lines. You should take a look at DotNet.au3. It's nice and easily readable code (maybe not so easy to understand, but easy to read). 7 functions DotNet.au3 contains 7 functions and 2 internal functions. The first 3 functions DotNet_Start(), DotNet_StartDomain() and DotNet_StopDomain() are only used to optimize the .NET Framework host (more about .NET concepts below). If you are satisfied with the default .NET Framework host, you can completely skip these functions. The next 3 functions DotNet_LoadAssembly(), DotNet_LoadCScode() and DotNet_LoadVBcode() are used to load .NET code into a domain. Before it's possible to execute .NET code it must be loaded into a domain. If DotNet_Start() and DotNet_StartDomain() have not been called, DotNet_Start() is called automatically by the 3 functions and the default domain is used to execute .NET code. DotNet_LoadAssembly() loads .NET code in a .NET assembly DLL-file into a domain. The other functions compiles C# and VB source code on the fly, creates a .NET assembly DLL-file in memory and loads the assembly file into a domain. All 3 functions returns a .NET code object which is a reference to the .NET code. The last function DotNet_CreateObject() takes a .NET code object and a class name as input parameters and creates an object as an instance of the class. The class must be defined in the .NET code. Because .NET code is object-oriented code, everything is performed through objects. Now the methods of the object can be called and this executes the functions in the .NET code. Below is a brief description of the 7 functions. $oRuntimeHost = DotNet_Start( $sVersion = "" ) DotNet_Start() Loads the .NET Framework code-execution environment known as the CLR into the AutoIt process and returns a .NET runtime host (a .NET Framework host). Default is to use the latest version of .NET Framework installed on the PC. Specify $sVersion eg. "v2.0.50727" to use an older version of .NET Framework. DotNet_Start() is automatically called by the other functions in DotNet.au3. You only need to call DotNet_Start() if you want to use an older version of .NET Framework. @error = 1 indicates that DotNet_Start() has failed. DotNet_StartDomain( ByRef $oAppDomain, $sFriendlyName = "", $sBaseDirectory = "" ) Creates and starts a user domain to run .NET code. Several user domains can be created and started at the same time. $oAppDomain is the returned domain object. $sFriendlyName is a name to identify the domain. $sBaseDirectory is the base directory where from .NET assemblies are loaded into the domain. The only purpose of $sFriendlyName is to be able to recognize the domain when the domains are listed with DotNet_ListDomains(). DotNet_ListDomains() is a utility function implemented in DotNetUtils.au3. The purpose of $sBaseDirectory is to be able to specify the directory where .NET assemblies are stored. The usage of $sBaseDirectory is demonstrated in examples. A default domain is automatically created by the other functions in DotNet.au3. You only need to call DotNet_StartDomain() if you want to specify a base directory for the domain. DotNet_StopDomain( ByRef $oAppDomain ) Unloads .NET assemblies loaded into the user domain and stops the domain. $oAppDomain is the domain object. The default domain cannot be stopped. $oNetCode = DotNet_LoadAssembly( $sAssemblyName, $oAppDomain = 0 ) DotNet_LoadAssembly() loads .NET code in a .NET assembly DLL-file into a domain and returns a .NET code object (a reference to the .NET code). $sAssemblyName is the name of the assembly DLL-file. $oAppDomain is the user domain. If no user domain is specified the assembly is loaded into the default domain. @error = 2 indicates that DotNet_LoadAssembly() has failed. $oNetCode = DotNet_LoadCScode( $sCode, $sReferences = "", $oAppDomain = 0, $sFileName = "", $sCompilerOptions = "" ) $oNetCode = DotNet_LoadVBcode( $sCode, $sReferences = "", $oAppDomain = 0, $sFileName = "", $sCompilerOptions = "" ) DotNet_LoadCScode() and DotNet_LoadVBcode() compiles C# and VB source code on the fly, creates a .NET assembly DLL-file in memory, loads the assembly file into a domain and returns a .NET code object. $sCode is the C# or VB source code. $sReferences is a pipe (|) delimited list of .NET DLL assemblies that the C#/VB code requires. Eg. "System.dll" or "System.Windows.Forms.dll". $oAppDomain is the user domain. If no user domain is specified the code is loaded into the default domain. The other parameters are related to the compilation process. If $sFileName is the name of a DLL-file the code is compiled into a .NET assembly DLL-file. Else the code is compiled in memory. $sCompilerOptions is rarely used. See Microsoft documentation for details. @error = 3/4 indicates that DotNet_LoadCScode() or DotNet_LoadVBcode() has failed. @error = 5 indicates a syntax error in the C# or VB source code. Such an error can be corrected by correcting the error in the source code. $oObject = DotNet_CreateObject( ByRef $oNetCode, $sClassName, $v3 = Default, ..., $v9 = Default ) DotNet_CreateObject() creates an object as an instance of a class. $oNetCode is a .NET code object as returned by one of the functions DotNet_LoadAssembly(), DotNet_LoadCScode() or DotNet_LoadVBcode(). $sClassName is the name of a class defined in the .NET code. The other parameters depends on the specific class. Summary Two functions must be called to execute .NET code directly in an AutoIt script. One of the functions DotNet_LoadAssembly(), DotNet_LoadCScode() or DotNet_LoadVBcode() to load the .NET code into a domain. And DotNet_CreateObject() to create an object from a class defined in the .NET code. Now the functions in the .NET code can be executed by calling the methods of the object. .NET concepts The .NET CLR In more or less the same way as AutoIt3.exe or AutoIt3_x64.exe is needed to run AutoIt code, the .NET CLR (Common Language Runtime) or the .NET Framework code-execution environment is needed to run .NET code. To be able to run .NET code inside an AutoIt script, the CLR or the .NET Framework code-execution environment must be loaded into the AutoIt process. This is the purpose of DotNet_Start(). The CLR can be loaded into a process through several of the functions in MSCorEE.dll. CorBindToRuntimeEx is one of these functions. DotNet_Start() executes CorBindToRuntimeEx in MSCorEE.dll and loads the CLR into the AutoIt process. A program or a part of a program which is able to start the CLR and execute .NET code is referred to as a .NET runtime host, a CLR host or simply a .NET Framework host. The code in DotNet.au3 implements an AutoIt .NET Framework host. Managed/unmanaged code .NET code which is executed (or managed) through the functions in the CLR is referred to as managed code. C# and VB code is managed code. Code which is not executed through the functions in the CLR is referred to as unmanaged code. AutoIt code is unmanaged code. You usually only distinguish between managed/unmanaged code in relation to .NET code and the .NET Framework. When you are executing .NET code there is often a part of both unmanaged and managed code involved. If you are executing .NET code through AutoIt, the AutoIt code is the unmanaged code and the .NET code is the managed code. The functions in MSCorEE.dll are some of the functions which belongs to the .NET Framework that can be executed from unmanaged code eg. AutoIt code. That's the reason why these functions are used to start the .NET Framework. The COM interfaces _AppDomain, _Assembly and _Type in Interfaces.au3 are some of the interfaces which belongs to the .NET Framework that can be used in unmanaged code. That's the reason why these interfaces are used to implement the functions in DotNet.au3. Managed code like C# cannot be translated into unmanaged code like AutoIt. There is no way to translate a command like "using System;" from C# to AutoIt. In many situations you can implement the same code in AutoIt as you can in C#. But that's generally not a simple translation of the C# code. It's a new implementation of the code. .NET domains With the functions in DotNet.au3 you can create an AutoIt .NET Framework host as shown in this picture: The blue box illustrates the unmanaged AutoIt code which is used to start the .NET Framework and load the CLR into the AutoIt process. The red box illustrates the default domain and several user domains where the managed .NET code is executed. Managed .NET code is always executed within a domain. The purpose of DotNet_StartDomain() and DotNet_StopDomain() is to create, start and stop user domains. If DotNet_StartDomain() isn't called the default domain is used. A domain in managed code is equivalent to a process in unmanaged code. The purpose of domains is to prevent that a crash in one part of the .NET code should lead to a crash in all of the .NET code. A crash of the code in a domain makes the domain inapplicable and a new domain must be created with DotNet_StartDomain(). This is very similar to the way that code is executed in separate processes in the operating system. The purpose of executing code in separate processes is (among other things) to prevent that a crash of the code in one process should lead to a crash of the code in several processes and finally to a crash of the entire operating system. A crash of the code in the default domain makes the entire CLR, that's loaded into the AutoIt process inapplicable. Because it's only possible to load the CLR into the same process once, the only way to reload the CLR is to restart the entire AutoIt process. That is to stop and start the AutoIt script. Usually it does not matter if the default domain or a user domain is used to execute .NET code. It's only strictly necessary to create a user domain if there is a need to specify a base directory for .NET assemblies. The only way to specify a base directory is through DotNet_StartDomain(). .NET assemblies Before it's possible to execute .NET code in a domain, the code must be loaded into the domain. Code is always loaded into a domain through a .NET assembly. This is also the case when .NET code is created on the fly by compiling C# or VB code in memory. Then the .NET code is stored in a .NET assembly which is created in memory and therefrom loaded into the domain. The purpose of DotNet_LoadAssembly() is to load .NET code in a .NET assembly DLL-file into a domain. Either the default domain or a user domain. The purpose of DotNet_LoadCScode() and DotNet_LoadVBcode() is to compile C# and VB code on the fly, create a .NET assembly in memory and load the .NET code into a domain. All 3 functions returns a .NET code object which can be used in DotNet_CreateObject() to create .NET objects. When a .NET assembly is stored as a file on disk it's usually stored with a DLL- or an EXE-extension. It contains information about classes, objects, methods, properties, events, datatypes etc. concerning the resources in the assembly. It's a binary file. A .NET assembly DLL-file should not be confused with a standard DLL-file eg. a DLL-file that belongs to the Windows operating system. A .NET assembly DLL-file contains managed code. A standard DLL-file contains unmanaged code. In the same way as there are tools to extract information about the code in a standard DLL-file, there are also tools to extract information about the code in a .NET assembly DLL-file. One of these tools is ILSpy. More about ILSpy in examples section below. .NET objects Because .NET code is object-oriented code, everything is performed through objects, properties and methods. When functions are executed in .NET code, they are executed as object methods. DotNet_CreateObject() takes a .NET code object as returned by DotNet_LoadAssembly(), DotNet_LoadCScode() or DotNet_LoadVBcode() and a class name as input parameters and creates a .NET object as an instance of the class. The class must be defined in the .NET code. Now the methods of the object can be called and this executes the functions in the .NET code. Examples The Examples folder contains scripts to demonstrate the usage of the functions in DotNet.au3. In scripts where .NET code is needed for the demonstration, the code is copied from original AutoHotkey examples: An example with a XPTable.dll .NET assembly (implemented in AutoIt in this post) and two simple C# and VB code examples. I don't want to review all examples. The examples are small examples like this: #include "..\..\Includes\DotNet.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Start the latest version of .NET Framework ; DotNet_Start() is automatically called by the other functions in DotNet.au3 ; You only have to call DotNet_Start() if you need an older version of .NET Framework DotNet_Start() If @error Then Return ConsoleWrite( "DotNet_Start ERR" & @CRLF ) ConsoleWrite( "DotNet_Start OK" & @CRLF ) EndFunc The example simply starts the .NET Framework from an AutoIt script. Run the examples in SciTE by pressing F5 on the keyboard. A few examples with "(compile me)" in the file name must be compiled. Run these examples by double-clicking the exe-file. ILSpy .NET assembly browser ILSpy is an open-source .NET assembly browser. Download ILSpy_Master_2.4.0.1963_Binaries.zip, unzip it and run ILSpy.exe. There is no installer. If you open \Examples\4) DotNet_LoadAssembly\XPTable.dll through the File | Open... menu you'll see this information in the right pane window: // ...\Examples\4) DotNet_LoadAssembly\XPTable.dll // XPTable, Version=1.1.0.27823, Culture=neutral, PublicKeyToken=24950705800d2198 // Global type: <Module> // Architecture: AnyCPU (64-bit preferred) // Runtime: .NET 1.1 using System; using System.Reflection; [assembly: AssemblyVersion("1.1.0.27823")] [assembly: CLSCompliant(true)] [assembly: AssemblyCompany("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCopyright("Copyright © 2005, Mathew Hall. All rights reserved.")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyDescription("A fully customisable ListView style control based on Java's JTable")] [assembly: AssemblyKeyFile("..\\..\\XPTable.snk")] [assembly: AssemblyKeyName("")] [assembly: AssemblyProduct("XPTable")] [assembly: AssemblyTitle("XPTable")] [assembly: AssemblyTrademark("")] Note the comments in the top. This line: // Architecture: AnyCPU (64-bit preferred) means that the DLL-file can be used as both a 32 and a 64 bit .NET assembly DLL-file. Using C# and VB Code in AutoIt Using C# and VB Code in AutoIt through .NET Framework is an example that uses DotNet.au3 UDF in order to be able to execute compiled C# and VB code in AutoIt scripts. Zip-file The zip-file contains two folders: Examples\ and Includes\. The project depends on eight include files of which DotNet.au3 is the actual UDF. To make it easier to use the UDF, all include files are collected in one large file: DotNetAll.au3. To use DotNet.au3 UDF in your own project just include DotNetAll.au3. You need AutoIt 3.3.10 or later. Tested on Windows 10, Windows 7 and Windows XP. Comments are welcome. Let me know if there are any issues. DotNet.7z
    1 point
  3. This example is about using Microsoft UI Automation APIs in AutoIt. Ie. it's about using interfaces, objects, methods, properties and constants as they are defined directly by Microsoft. In AutoIt, the definitions are contained in CUIAutomation2.au3 by junkew. The definitions are copied from corresponding C/C++ header files and customized the AutoIt language. This example is not about the functions in UIAWrappers.au3 by junkew. The purpose of the example is to show how to use Microsoft UI Automation APIs directly without any intermediate AutoIt functions. A major advantage of this approach is that the Microsoft documentation directly can be used as AutoIt documentation. Other major advantages are that there is no need for documenting and maintaining a set of intermediate AutoIt functions. Without intermediate AutoIt functions the code will be very fast. All Microsoft functions can be used this way eg. functions for event handling. New interfaces, objects, methods, properties and constants can easily be added simply by adding the definitions to CUIAutomation2.au3. Is this approach difficult? Not at all as the examples will show. The example is inspired by this comment of mLipok. Including documentation and pictures, even a simple Notepad automation can be somewhat comprehensive. Therefore a new example. First post will be a list of examples. The examples themselves are reviewed in the following posts. In all examples UIASpy is used to get element information. Topics Using UIASpy UIASpy thread Automating Notepad. Very detailed example. Automating Notepad with Sample code - step by step Automating Notepad with Sample code - all at once Automating Notepad - Windows XP Automating Notepad - Classic Click Save As... issue Automating Notepad context menu. Event handler example. Chrome - Clicking an extension. Compact summary example. Other spy tools Using Microsoft Inspect.exe simplespy.au3 by junkew How to topics If UI Automation or the UIASpy tool is new to you, then you should start reading the How to topics Various topics Console and terminal windows Console application (3 posts) Terminal program (several posts) Examples Patterns (actions) Code snippets Real examples UIA updates UIA events Threads UI Automation UDFs contains all include files. UIASpy - UI Automation Spy Tool is a GUI tool that provides information about windows and controls and their interconnection and provides functionality to generate sample code. UIASpy is essential for creating UI Automation code. UI Automation Events is about implementing event handlers and includes GUIs to detect events. IUIAutomation MS framework automate chrome, FF, IE, .... created by junkew August 2013 is the first AutoIt thread on UIA code. Zip-file The zip contains source files for all examples. Note that UI Automation UDFs must be installed in the Includes folder. You need AutoIt 3.3.12 or later. Tested on Windows XP, Windows 7 and Windows 10. Comments and questions about using UIA code are welcome. Let me know if there are any issues. Questions about the functions in UIAWrappers.au3 should be asked in junkew's thread. UIAExamples.7z
    1 point
  4. LarsJ

    UI Automation Events

    UI Automation Events In standard Windows GUI code, you can respond to Windows messages by registering and implementing a message handler function. A WM_NOTIFY message handler is registered and implemented in this way: ; Registration GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY" ) ; Implementation Func WM_NOTIFY( $hWnd, $iMsg, $wParam, $lParam ) ; Code EndFunc The WM_NOTIFY function is a callback function. In UI Automation code, you can respond to UI Automation events by registering and implementing an event handler object. A FocusChangedEventHandler object is registered and implemented in this way: ; Registration UIAEH_FocusChangedEventHandlerCreate() $oUIAutomation.AddFocusChangedEventHandler( 0, $oUIAEH_FocusChangedEventHandler ) ; Implementation ; This is the function that receives events Func UIAEH_FocusChangedEventHandler_HandleFocusChangedEvent( $pSelf, $pSender ) ; Code EndFunc $oUIAEH_FocusChangedEventHandler is the event handler object. It's a callback object. This thread is about how to respond to UI Automation events by registering, implementing and using event handler objects. User Defined Functions Registering and implementing the event handler object in the code above is very simple. To make it that simple, it's necessary to include a few functions in a UDF. The zip-file at bottom of post contains a UIAEH_FocusChangedEventHandler.au3 UDF that allows the registration and implementation of the event handler object as simple as shown above. UIAEH_FocusChangedEventHandlerCreate() is a function in this UDF. The function creates the $oUIAEH_FocusChangedEventHandler object. Because this is a callback object it must be implemented through ObjectFromTag() (coded in ObjectFromTag.au3 in zip-file) function by trancexx and not through the usual ObjCreateInterface() which is used to create other UI Automation objects. (The warning at top of the help text is much more an error in the help text than an error in the function. Thousands of examples show that ObjCreateInterface() works flawlessly.) You don't need to use ObjectFromTag() in your own code. This function is completely handled in the UDFs. UIAEH_FocusChangedEventHandler_HandleFocusChangedEvent() is the function that receives events. This function is coded but commented out in UIAEH_FocusChangedEventHandler.au3. Copy this function to your own code. See FocusChangedEventHandler example below. UIA Event Handlers The first version of Microsoft's UI Automation code (the Windows 7 version that works on Windows XP, Windows Vista, Windows 7 and all later versions) implements four different event handler objects. In addition to the FocusChangedEventHandler object, it's the AutomationEventHandler, PropertyChangedEventHandler and StructureChangedEventHandler objects. The zip-file at the bottom contains the corresponding three event handler UDFs. By the way, these four event handlers are implemented in AutoIt several years ago in this and the following posts. FocusChangedEventHandler exposes a method to handle events that are raised when the keyboard focus moves to another UI Automation element. AutomationEventHandler exposes a method to handle Microsoft UI Automation events. These events include MenuOpened ($UIA_MenuOpenedEventId) and Window_WindowOpened ($UIA_Window_WindowOpenedEventId) events. See module UIA_EventIds in UIA_Constants.au3 for a complete list. Note that EventIds that belong to Windows 8 or later cannot be used in this version of the event handler. But they can be used after code updates over the coming weeks. 2019-12-15 If you select Desktop, AutomationEvent and all Events (Event Ids) in UI Automation Event Monitor below and click Start, you'll see the following output in SciTE console: $oUIAEH_AutomationEventHandler OK Desktop: AddAutomationEventHandler() = AsyncContentLoaded OK Desktop: AddAutomationEventHandler() = AutomationFocusChanged ERR Desktop: AddAutomationEventHandler() = AutomationPropertyChanged OK Desktop: AddAutomationEventHandler() = InputDiscarded OK Desktop: AddAutomationEventHandler() = InputReachedOtherElement OK Desktop: AddAutomationEventHandler() = InputReachedTarget OK Desktop: AddAutomationEventHandler() = Invoke_Invoked OK Desktop: AddAutomationEventHandler() = LayoutInvalidated OK Desktop: AddAutomationEventHandler() = MenuClosed OK Desktop: AddAutomationEventHandler() = MenuModeEnd OK Desktop: AddAutomationEventHandler() = MenuModeStart OK Desktop: AddAutomationEventHandler() = MenuOpened OK Desktop: AddAutomationEventHandler() = Selection_Invalidated OK Desktop: AddAutomationEventHandler() = SelectionItem_ElementAddedToSelection OK Desktop: AddAutomationEventHandler() = SelectionItem_ElementRemovedFromSelection OK Desktop: AddAutomationEventHandler() = SelectionItem_ElementSelected OK Desktop: AddAutomationEventHandler() = StructureChanged OK Desktop: AddAutomationEventHandler() = Text_TextChanged OK Desktop: AddAutomationEventHandler() = Text_TextSelectionChanged OK Desktop: AddAutomationEventHandler() = ToolTipClosed OK Desktop: AddAutomationEventHandler() = ToolTipOpened OK Desktop: AddAutomationEventHandler() = Window_WindowClosed OK Desktop: AddAutomationEventHandler() = Window_WindowOpened OK Note the error for the AutomationFocusChanged event handler (at the top of the list). I've found that there is an error, but so far have no explanation for it. PropertyChangedEventHandler exposes a method to handle Microsoft UI Automation events that occur when a property is changed. These events include Name ($UIA_NamePropertyId) and ValueValue ($UIA_ValueValuePropertyId) changes. See module UIA_PropertyIds in UIA_Constants.au3 for a complete list. Note that PropertyIds that belong to Windows 8 or later cannot be used in this version of the event handler. But they can be used after code updates over the coming weeks. StructureChangedEventHandler exposes a method to handle events that occur when the Microsoft UI Automation tree structure is changed. This event handler seems to be more valuable in eg. screen readers than in usual UI Automation code. NotificationEventHandler exposes a method to handle Microsoft UI Automation notification events. See this post. FocusChangedEventHandler example This is full code in Examples\FocusChangedEventHandlerEx.au3. 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 "..\Includes\UIAEH_FocusChangedEventHandler.au3" Example() Func Example() UIAEH_FocusChangedEventHandlerCreate() If Not IsObj( $oUIAEH_FocusChangedEventHandler ) Then Return ConsoleWrite( "$oUIAEH_FocusChangedEventHandler ERR" & @CRLF ) ConsoleWrite( "$oUIAEH_FocusChangedEventHandler OK" & @CRLF ) Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) Local $iError = $oUIAutomation.AddFocusChangedEventHandler( 0, $oUIAEH_FocusChangedEventHandler ) If $iError Then Return ConsoleWrite( "AddFocusChangedEventHandler() ERR" & @CRLF ) ConsoleWrite( "AddFocusChangedEventHandler() OK" & @CRLF ) HotKeySet( "{ESC}", "Quit" ) While Sleep(10) WEnd EndFunc Func Quit() UIAEH_FocusChangedEventHandlerDelete() Exit EndFunc ; This is the function that receives events Func UIAEH_FocusChangedEventHandler_HandleFocusChangedEvent( $pSelf, $pSender ) ; Ret: long Par: ptr ConsoleWrite( @CRLF & "UIAEH_FocusChangedEventHandler_HandleFocusChangedEvent: " & $pSender & @CRLF ) Local $oSender = ObjCreateInterface( $pSender, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement ) $oSender.AddRef() ConsoleWrite( "Title = " & UIAEH_GetCurrentPropertyValue( $oSender, $UIA_NamePropertyId ) & @CRLF & _ "Class = " & UIAEH_GetCurrentPropertyValue( $oSender, $UIA_ClassNamePropertyId ) & @CRLF & _ "Ctrl type = " & UIAEH_GetCurrentPropertyValue( $oSender, $UIA_ControlTypePropertyId ) & @CRLF & _ "Ctrl name = " & UIAEH_GetCurrentPropertyValue( $oSender, $UIA_LocalizedControlTypePropertyId ) & @CRLF & _ "Handle = " & "0x" & Hex( UIAEH_GetCurrentPropertyValue( $oSender, $UIA_NativeWindowHandlePropertyId ) ) & @CRLF & _ "Value = " & UIAEH_GetCurrentPropertyValue( $oSender, $UIA_ValueValuePropertyId ) & @CRLF ) Return 0x00000000 ; $S_OK #forceref $pSelf EndFunc ; Auxiliary function (for simple properties only) ; There must be only one instance of this function Func UIAEH_GetCurrentPropertyValue( $oSender, $iPropertyId ) Local $vPropertyValue $oSender.GetCurrentPropertyValue( $iPropertyId, $vPropertyValue ) Return $vPropertyValue EndFunc Test the code by opening the Desktop context menu and move the mouse over the menu items. When the mouse hovers over a menu item it gets focus. Exit with Esc. AutomationEventHandlerEx.au3 Test the example by opening some windows, menus and tooltips. PropertyChangedEventHandlerEx.au3 Open Windows Task Manager (Ctrl+Shift+Esc) and you'll get a whole bunch of property changed events. Note that to access Windows Task Manager (and other programs) on Windows 10, use #RequireAdmin in the script and run SciTE as administrator. StructureChangedEventHandlerEx.au3 Clicking on a folder in File/Windows Explorer treeview generates a lot of structure changed events. New examples will be added over the coming weeks. UI Automation Event Monitor UI Automation Event Monitor is a tool to detect UI Automation events. The first group of toolbar buttons is used to set up the UI Automation event handler. The images have a PropertyChangedEventHandler set up to monitor Name ($UIA_NamePropertyId) and ValueValue ($UIA_ValueValuePropertyId) property changes in Windows Task Manager. Note that to access Windows Task Manager (and other programs) on Windows 10, use #RequireAdmin in the script (UIAEHEvents.au3) and run SciTE as administrator. These four toolbar buttons are hot-track enabled with the technique used in this example. The buttons open four listviews to set up the event handler. All listviews have multiple selections enabled. Select multiple items at once and check a single item in/out to check all selected items in/out. Use mouse or Space key to check an item in/out. In the first image, the mouse hovers over the Top Windows button so that it's selected. In the second image, the Top Windows button is clicked so that the listview is opened. Moving the mouse over the next three buttons automatically opens the corresponding listviews due to hot-tracking. Click the toolbar button again to close the listview or move the mouse above the title bar. Windows Task Manager is checked in the Top Windows listview. The Event Handlers listview is enabled when a Top Window is checked. The Event Ids listview is enabled when the AutomationEvent event handler is checked. The Property Ids listview is enabled when the PropertyChanged event handler is checked. In Event Ids and Property Ids listview you can select an item by pressing the first letter on the keyboard. The second group of toolbar buttons is used to Start/Stop the event handler (or multiple event handlers), Pause/Continue updating the Events listview, and Clear the listview. Note that the Pause button only stops updating the listview. Events are still detected and stored in $aEvents array. All new events are added at the bottom of the listview when you click Continue or Stop. The Pause Main Loop button is used to stop the GUI main loop, which significantly increases the performance of the Events listview. When the GUI main loop is paused you can only click the Continue Main Loop button (same button as Pause Main Loop) and you can close the GUI. Events listview The Events listview is a virtual listview because of performance and to make it easy to constantly add new rows to the bottom of the listview. Nevertheless, there can still be performance issues when a lot of events are generated. To remedy these issues, it's possible to stop the GUI main loop with the Pause Main Loop button. This significantly increases the performance of the Events listview. When there are a large number of events (when many new rows are added quickly at the bottom of the listview), this procedure must be followed to stop the event handler (or multiple event handlers): Make sure the GUI main loop isn't paused. Click the Pause button (second toolbar group) to pause Events listview updates. Click the Stop button to stop the event handler. When there are a small number of events you can immediately click the Stop button. To test the UI Automation Event Monitor, try performing the four examples (in Examples\, briefly described above) through the monitor GUI. There'll probably be some GUI updates in the coming weeks. UIA Menu, Tooltip and Window Events Monitor is a simpler version of UI Automation Event Monitor that detects only MenuOpened, ToolTipOpened and Window_WindowOpened events (AutomationEvents). Updates Windows 8, Windows 8.1 and Windows 10 updates Threads UI Automation UDFs contains all include files. UIASpy - UI Automation Spy Tool is a GUI tool that provides information about windows and controls and their interconnection and provides functionality to generate sample code. UIASpy is essential for creating UI Automation code. In Using UI Automation Code in AutoIt you can find and download examples and read information about using UIA code. IUIAutomation MS framework automate chrome, FF, IE, .... created by junkew August 2013 is the first AutoIt thread on UIA code. Zip-file The zip contains source files for GUIs and examples. Note that UI Automation UDFs must be installed in the Includes folder. You need AutoIt 3.3.12 or later. Tested on Windows 7 and Windows 10. Note that under Windows 7 and earlier versions, only the original four event handlers (AutomationEventHandler, FocusChangedEventHandler, PropertyChangedEventHandler, StructureChangedEventHandler) introduced in Windows 7 can be used. Comments are welcome. Let me know if there are any issues. UIAEHEvents.7z
    1 point
  5. Anyhow the script was based on a request from someone in the Help and Support, who was wondering if you can create custom COM objects. And this in order to organize UDF's in a better way, and get the benifit of using METHODS, PROPERTIES and EVENTS. Well actualy there is an ancient technique that supports this. For those who are not familiar with the technique it is called : Windows Script Components More information can be found here : Writing COM Objects with Scripting Languages Windows Script Components: They Get Around OK enough talking : The files *.WSC and *.SCT are VBScript that use XML to create Fully compliant COM objects. (Search on your PC and propably you will find some .WSC files.) RightClick the Files and you can select REGISTER / UNREGISTER and GENERATE TYPE LIB is used for the Windows InTelliSence popups. These Example scripts explain EXPOSING COM Objects TO AU3 : Save this as a file called DEMO.SCT &lt;scriptlet> <Registration Description="DemoScriptlet" ProgID="Demo.Scriptlet" Version="1.00" ClassID="{3ac6e5c0-9f18-11d1-83d1-f49604c10000}" > </Registration> <implements id=Automation type=Automation> <method name=Method1> <PARAMETER name=param1/> </method> <property name="Property1" internalname="mProp1"> </property> </implements> &lt;script language=JScript> var mProp1 = ""; function Method1(param1) { return "Method1(param1)"; } </script> </scriptlet> Right click the Demo.sct file and select REGISTER. If you don't have a context menu to register it. you will need to do it manually, using the REGSVR32 command. ; Initialize COM error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $objWSC = ObjCreate("Demo.Scriptlet") $MethodWSC_0 = $objWSC.Method1 = 0 $MethodWSC_1 = $objWSC.Method1 = 1 Msgbox(0,"Your Own COM object TEST", $MethodWSC_0) Msgbox(0,"Your Own COM object TEST", $MethodWSC_1) Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns EndfuncoÝ÷ Ù8b²+d{¦¦W¡×ºÑÊ&¦ÞÞ¶ëJÞ+-­«b¢zk¢oÝ÷ ٻ릦W¬r¸©¶Ç±¦V¢EÏ9" #9¸ÞrÛ¢Z+ QtÓM,¥©ì·)^oÝ÷ ÚäáDZjjezÈhÂËazÇ+_WjÇ{¦¦W¿¹&¯zØb±ø¥y«*º@St®*mëh«b¢t®÷«ÂÇ*ºZ×hm~àzÛh­è"²×«Ý÷ßz®¢×¥µÊ&¦ÞØ-ÚÞ+-­«b¢zk¢oÝ÷ Ù*"Ýz»hrZ,zØ^r*Üë¬zØb²Ç+m¡Æ¥*.­Ë¬¶8Êç-~º&T®*mI«ÞÖ¬ªê-MºËhæãyËSzËonÊ®¢Ö§v»§×(uåÊ&{8Ô[§rبg¥rãN5)²¡zYCg&u'­¡¸ÖHoÝ÷ Ù:ò¶!jx¶§¶)íz·¬¶éz¸¨u©Ý±ç°«aj^Æ®¶­sc²æFƦR4ôÒW'&÷"æFÆW"¢b33c¶ô×W'&÷"Òö&¤WfVçBgV÷C´WFôBäW'&÷"gV÷C²ÂgV÷C´×W'$gVæ2gV÷C²¢b33c¶ö&¥u42Òö&¤7&VFRgV÷C´S$4ôÕôfææ6Âåu42gV÷C² ¤b4ö&¢b33c¶ö&¥u42FVà¢b33c´ÆöâÒb33c¶ö&¥u42äÆöäÖ÷'F¦FöâÃ2Ã#B²&æ6ÆRÖ÷VçBÂçFW&W7BÂW&ö@ ¤×6t&÷ÂgV÷C´6ÆÆ&6²S$4ôÒgV÷C²ÂgV÷Cµ÷W"Ö÷'F¦FöâW"ÖöçF2¢gV÷C²fײ5"fײb33c¶ö&¥u42äÖ÷'F¦FöâfײgV÷C²b33c²ògV÷C²²&W7VÇB&WGW&æVBg&öÒS$4ôÐ ¤VÇ6R ×6t&÷ÂgV÷C´W'&÷"gV÷C²ÂgV÷C´æòvööBö&¦V7BFV6Æ&VBgV÷C²¤VæD` ¤gVæ2×W'$gVæ2¢b33c´WçVÖ&W#ÖWb33c¶ô×W'&÷"æçVÖ&W"â×6v&÷ÂgV÷C´4ôÒFW7BgV÷C²ÂgV÷CµvRçFW&6WFVB4ôÒW'&÷"b333²gV÷C²fײ5$Äbfײ5$Äbfײð gV÷C¶W'"æFW67&Föâ3¢gV÷C²fײD"fײb33c¶ô×W'&÷"æFW67&Föâfײ5$Äbfײð gV÷C¶W'"çvæFW67&Föã¢gV÷C²fײD"fײb33c¶ô×W'&÷"çvæFW67&Föâfײ5$Äbfײð gV÷C¶W'"æçVÖ&W"3¢gV÷C²fײD"fײb33c´WçVÖ&W"fײ5$Äbfײð gV÷C¶W'"æÆ7FFÆÆW'&÷"3¢gV÷C²fײD"fײb33c¶ô×W'&÷"æÆ7FFÆÆW'&÷"fײ5$Äbfײð gV÷C¶W'"ç67&FÆæR3¢gV÷C²fײD"fײb33c¶ô×W'&÷"ç67&FÆæRfײ5$Äbfײð gV÷C¶W'"ç6÷W&6R3¢gV÷C²fײD"fײb33c¶ô×W'&÷"ç6÷W&6Rfײ5$Äbfײð gV÷C¶W'"æVÇfÆR3¢gV÷C²fײD"fײb33c¶ô×W'&÷"æVÇfÆRfײ5$Äbfײð gV÷C¶W'"æVÇ6öçFWB3¢gV÷C²fײD"fײb33c¶ô×W'&÷"æVÇ6öçFWBð ¢6WDW'&÷"²Fò6V6²f÷"gFW"F2gVæ7Föâ&WGW&ç0¤VæFgVæ These are the "Swiss Army knife" tools which help you get started. Windows Script Component Wizard WSH & WSC Scripts for SciTE Generating a type library for the specified WSC file ' Generating a type library for the specified WSC file. ' The script assumes to be invoked through a context menu ' and to receive the WSC name on the command line. ' --------------------------------------------------------------- ' Get the WSC file name to work with If WScript.Arguments.Count = 0 Then wscFile = InputBox ("Enter the WSC file name:", "WSC") Else wscFile = WScript.Arguments.Item(0) End If if wscFile = "" Then WScript.Quit ' Instantiate the object to create the typelib Set oTL = CreateObject("Scriptlet.TypeLib") ' Set source and target file names oTL.AddURL wscFile tlbFile = Replace(wscFile, ".wsc", ".tlb", 1, -1, 1) oTL.Path = tlbFile ' Set the name to appear in the Object Browser posSlash = InStrRev(wscFile, "\") posDot = InStrRev(wscFile, ".") wscFileOnly = Mid(wscFile, posSlash+1, posDot-posSlash-1) oTL.Name = wscFileOnly & "TLB" ' Get the description defDesc = wscFileOnly & " Type Library" desc = InputBox ("Enter the TypeLib description", "WSC Description", defDesc) If desc <> "" Then oTL.Doc = desc Else oTL.Doc = defDesc End If ' Write the TypeLib oTL.Write oTL.Reset This give everyone a possibility to create there own COM objects and benifit from all these advantages : Enjoy your first custom COM object !! Happy scripting in 2007 ptrex Test_Financial.au3 Test_Excel_Object.au3 Test_SQLite_ColumnCount.au3 Test_GUICtrlCreateListView.au3
    1 point
  6. Hey guys, the code that I've written/borrowed below is mostly an example of using the commUDF listed at the bottom, just applied to an Arduino with accompanying Arduino code. Uses Serial communication to turn on a LED, then reads a response from the arduino and prints it in the console. I hope it helps Autoit Code: #include <CommMG.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $CMPort = 3 Global $CmBoBaud = 9600 Global $sportSetError = '' Global $CmboDataBits = 8 Global $CmBoParity = "none" Global $CmBoStop = 1 Global $setflow = 2 _CommSetPort($CMPort, $sportSetError, $CmBoBaud, $CmboDataBits, $CmBoParity, $CmBoStop, $setflow) If @error Then MsgBox(16, "Error!", "Can't connect to Arduino on port - " & $CMPort) Exit EndIf _CommSetRTS(0) _CommSetDTR(0) While 1 ; Just use to call function, doesn't need to be a loop. LED_ON() Sleep(100) LED_OFF() Sleep(100) WEnd Func LED_ON() _CommSendString("1") ;Sends the Arduino a string of "1" to turn on LED Local $ret = _CommGetLine(@CR, 100, 100) ; Waits for up to 100 for a carriage return response from Arduino. ConsoleWrite($ret & @CRLF) ;Print to Console. EndFunc ;==>LED_ON_OFF Func LED_OFF() _CommSendString("0") ;Sends Arduino string of "0" to turn off the LED Local $ret = _CommGetLine(@CR, 100, 100) ; Waits for up to 100 for a carriage return response from Arduino. ConsoleWrite($ret & @CRLF) ;Print to Console. EndFunc ;==>LED_BLINK_10 Arduino Code: int led = 12; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(led, OUTPUT); } void loop() { // put your main code here, to run repeatedly: if (Serial.available()) { int data = Serial.read(); if (data == '1') //On { digitalWrite(led, HIGH); //writeslow(); Serial.print("The LED is on!"); } if (data == '0') //Off { digitalWrite(led, LOW); Serial.print("The LED is OFF!"); } } } Serial/Com port UDF this is all based on
    1 point
  7. The DB rows in your example look like this: '02 05 06 08 15 20 23 26 28 30 35 36 38 43 45 47 52 54 55 56 66 68 71 74 75 PM-Q1' '02 05 06 08 15 20 23 26 28 30 35 36 38 43 45 47 52 54 55 56 66 68 71 74 75 PM-Q2' '02 05 06 08 15 20 23 26 28 30 35 36 38 43 45 47 52 54 55 56 66 68 71 74 75 PM-Q3' ... '02 05 06 08 15 20 23 26 28 30 35 36 38 43 45 47 52 54 55 56 66 68 71 74 75 PM-Q20' Your SQL update statement is: UPDATE Dados set Numeros= '06 ' where Numeros= '| ' No surprise no row is updated since no row equals '| ' If you want to update rows containing the string '06 ' and replace this part of the string by '| ', then you should do: UPDATE Dados set Numeros= replace(numeros, '06 ', '| ') where Numeros like '%06 %'
    1 point
  8. Come back when you have given up on the crap attitude. Not in the mood for babysitting today.
    1 point
  9. Nine

    GetPixel Background Window

    Could you explain what is it you try to achieve beside the technical issue ? Maybe understanding the end result of your automation would help us to provide a better solution ?
    1 point
  10. I came across this post by accident, and just wanted to add my own quick fix to this problem. Personally I don't want to run the main script instead like OP does. I just want to avoid running it by accident causing tons of error messages in SciTE, and messing up my bookmarks In the main script (important: #include-once is to avoid inadvertently looping): #include-once #include "name_of_the_udf.au3" In every UDF I put these three lines in the top to avoid accidentally executing the UDF (or if I just want to F5 run it in SciTE to check its syntax): #include-once If @ScriptName = "name_of_this_udf.au3" Then Exit SetError(1, ConsoleWriteError("! UDF CANNOT BE RUN !" & @CRLF), -99) #include "name_of_main_script.au3" EDIT: if you have your includes in a subdirectory of your main script dir, you just use relative paths instead. Example: #include-once #include "includes/name_of_the_udf.au3" #include-once If @ScriptName = "name_of_this_udf.au3" Then Exit SetError(1, ConsoleWriteError("! UDF CANNOT BE RUN !" & @CRLF), -99) #include "../name_of_main_script.au3"
    1 point
  11. and the (simple) regex which fits nice... $txt = "text text tex text 123x 2x34 345" & @crlf & _ "text text tex text 123 23x4 3x45" & @crlf & _ "text text tex text 123 2x34 345" $res = StringRegExpReplace($txt, '(?m)^(.*?)\h{2,}.*', "$1") Msgbox(0,"", $res)
    1 point
  12. ptrex

    DotNET Compiler Wrapper

    DotNET Compiler Wrapper If you want to run DotNet code as a script, and don't want to install full stack Visual Studio. You can find the DotNet wrapper for VB.NET. But easily can be modified to run C# etc. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "BinaryImage.au3" #include <Constants.au3> Global Const $Width = 600 Global Const $Height = 400 Global $sPath, $sCheck Global $color1 = 0x0000000 Global $color2 = 0x0005FFF Global $graphics, $backbuffer, $bitmap, $pen, $i Global $hLabel1, $hLabel2, $hLabel3, $hPic1, $hPic2, $hPic3 Global $LOGO1 = _LOGOBin1() Global $LOGO2 = _LOGOBin2() Global $LOGO3 = _LOGOBin3() Dim $hFile Dim $Font = "Arial" ;GUIRegisterMsg(0xF, "MY_PAINT"); Register PAINT-Event GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND"); Register PAINT-Event _GDIPlus_Startup() $hGui = GUICreate("DotNET Scripting", $Width, $Height, -1,-1) ;GUISetState(@SW_LOCK,$hGui) $hLabel1 = GUICtrlCreateLabel("Visual Studio - Light", 10, 20, 450, 20, $SS_NOTIFY) GUICtrlSetFont(-1, 8.5, 650, "", $font) GUICtrlSetBkColor(-1, 0xFFFFFF) $hPic1 = GUICtrlCreatePic("", 30,60,32,32) _SetImageBinaryToCtrl($hPic1,$LOGO1) $hLabel1 = GUICtrlCreateLabel(" Windows Application", 20, 100, 70, 40, $SS_NOTIFY) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetState(-1, $GUI_FOCUS) $hPic2 = GUICtrlCreatePic("", 130,60,32,32) _SetImageBinaryToCtrl($hPic2,$LOGO2) $hLabel2 = GUICtrlCreateLabel("Class Library", 120, 100, 70, 40, $SS_NOTIFY) GUICtrlSetBkColor(-1, 0xFFFFFF) $hPic3 = GUICtrlCreatePic("", 230,60,32,32) _SetImageBinaryToCtrl($hPic3,$LOGO3) $hLabel3 = GUICtrlCreateLabel(" Console Application", 220, 100, 70, 40, $SS_NOTIFY) GUICtrlSetBkColor(-1, 0xFFFFFF) _CreateGradient($hGui) GUISetState(@SW_SHOW) ; Check availability If $sCheck = "" Then $sCheck = CheckDotNetVersion() ConsoleWrite($sCheck & @CRLF) EndIf While 1 Switch GUIGetMsg() Case $hPic1, $hLabel1 $sScript = FileOpenDialog("Open DotNET Script", @ScriptDir & "", "PS Scripts (*.vb)") If @error Then MsgBox(4096,"","No File(s) chosen") Else Read_DotNET_Script($sScript) Execute_Script("Win", $sPath, $sScript) EndIf Case $hPic2, $hLabel2 $sScript = FileOpenDialog("Open DotNET Script", @ScriptDir & "", "PS Scripts (*.vb)") If @error Then MsgBox(4096,"","No File(s) chosen") Else Read_DotNET_Script($sScript) Execute_Script("Lib", $sPath, $sScript) EndIf Case $hPic3, $hLabel3 $sScript = FileOpenDialog("Open DotNET Script", @ScriptDir & "", "PS Scripts (*.vb)") If @error Then MsgBox(4096,"","No File(s) chosen") Else Read_DotNET_Script($sScript) Execute_Script("Cnsl", $sPath, $sScript) EndIf Case $GUI_EVENT_CLOSE Close() Exit EndSwitch WEnd ; Read the Code Script to be executed Func Read_DotNET_Script($hPSFile) $file = FileOpen($hPSFile, 0) ; Open read only If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Return EndIf Local $sCmd While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $sCmd &= $line & @CRLF Wend ConsoleWrite("Line read: " & @CRLF & $sCmd & @CRLF) FileClose($file) EndFunc ;=> Read_DotNET_Script ; Run the Script Func Execute_Script($sType, $sDotNETCmd, $svbScript) Switch $sType #Region Windows Application Case "Win" $hFile = StringMid($svbScript,1, StringLen($svbScript)-2) & "exe" MsgBox(0,"",$hFile) If FileExists($hFile) Then FileDelete($hFile) EndIf $hOut = Run($sDotNETCmd & " /nowarn /nologo /quiet /debug- /t:winexe " & FileGetShortName($svbScript), "", @SW_HIDE, $STDOUT_CHILD) ;#cs While 1 $line = StdoutRead($hOut) If @error = 2 Then ExitLoop If $line <> "" Then MsgBox(16, "Error", $line) EndIf Wend ;#ce Sleep(500) RunWait($hFile, "" , @SW_SHOW) #Region Class Library Case "Lib" $hFile = StringMid($svbScript,1, StringLen($svbScript)-2) & "dll" If FileExists($hFile) Then FileDelete($hFile) EndIf $hOut = Run($sDotNETCmd & " /nowarn /nologo /quiet /debug- /t:library " & FileGetShortName($svbScript), "", @SW_HIDE) Sleep(500) MsgBox(0,"Library .dll Created successfully ! ",$hFile) #Region Console Application Case "Cnsl" $hFile = StringMid($svbScript,1, StringLen($svbScript)-2) & "exe" If FileExists($hFile) Then FileDelete($hFile) EndIf $hOut = Run($sDotNETCmd & " /nowarn /nologo /quiet /debug- /t:exe " & FileGetShortName($svbScript), "", @SW_HIDE, $STDOUT_CHILD) ;#cs While 1 $line = StdoutRead($hOut) If @error = 2 Then ExitLoop If $line <> "" Then MsgBox(16, "Error", $line) EndIf Wend ;#ce Sleep(500) RunWait(@ComSpec & " /K cd " & @ScriptDir & " & " & FileGetShortName($hFile), "", @SW_SHOW) EndSwitch Return $hFile EndFunc ;=> Execute_Script ; Check the DotNET version available Func CheckDotNetVersion() Local $sFramework If @OSArch = "X64" Then $sFramework = "Framework64" Else $sFramework = "Framework" EndIf If FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v3.5vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v3.5vbc.exe" ElseIf FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v3.0vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v3.0vbc.exe" Elseif FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v2.0.50727vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v2.0.50727vbc.exe" Elseif FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v2.0.50727vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v2.0.50727vbc.exe" Elseif FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v1.1.4322vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v1.1.4322vbc.exe" ElseIf FileExists(@WindowsDir & "Microsoft.NET"& $sFramework &"v1.0.3705vbc.exe") Then $sPath = @WindowsDir & "Microsoft.NET"& $sFramework &"v1.0.3705vbc.exe" Else MsgBox(0,"Error", "The DotNet version needed, is not available") Exit EndIf Return $sPath EndFunc ;=> CheckDotNetVersion Func _CreateGradient($hwnd) $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd) $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics) $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) $pen = _GDIPlus_PenCreate(0xFF000000, 1) ;you can move this lines below until Do...Until loop to Do...Until loop and make some realtime effects $r = 0x00 $g = 0x00 $b = 0xFF $c = "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2) $i = 255 / $width _GDIPlus_GraphicsClear($backbuffer) For $x = 0 To $width ;_GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, $width, $pen) ; Full Screen _GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, 40, $pen) _GDIPlus_PenSetColor($pen, 0xFFFFFFFF) ; White Next For $x = 0 To $width ;_GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, $width, $pen) ; Full Screen _GDIPlus_GraphicsDrawLine($backbuffer, $x, 40, $x, 42, $pen) ; Start at 30 ends at 40 _GDIPlus_PenSetColor($pen, $c) ; Gradient Line $r += $i $g += $i $c = "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2) Next For $x = 0 To $width ;_GDIPlus_GraphicsDrawLine($backbuffer, $x, 0, $x, $width, $pen) ; Full Screen _GDIPlus_GraphicsDrawLine($backbuffer, $x, 42, $x, $height, $pen) _GDIPlus_PenSetColor($pen, 0xFFFFFFFF) ; White Next _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height) ; Full Screen EndFunc ;=> _CreateGradient Func Close() _GDIPlus_PenDispose($pen) _GDIPlus_GraphicsDispose($backbuffer) _GDIPlus_BitmapDispose($bitmap) _GDIPlus_GraphicsDispose($graphics) _GDIPlus_Shutdown() EndFunc ;Func to redraw on PAINT MSG - Thanks to UEZ Func MY_PAINT($hWnd, $msg, $wParam, $lParam) ; The sequencial order of these two commands is important. _GDIPlus_GraphicsDrawImage($graphics, $bitmap, 0, 0) _WinAPI_RedrawWindow($hwnd, "", "", BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME, $RDW_ALLCHILDREN)) Return $GUI_RUNDEFMSG EndFunc ;==>MY_PAINT ;Func to redraw on PAINT MSG - Thanks to UEZ Func WM_ERASEBKGND($hWnd, $msg, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($graphics, $bitmap, 0, 0) Return 1 EndFunc ;==>MY_PAINT Func _LOGOBin1() Local $FileName = "0x0000010001002040000001000400E8020000160000002800000020000000400000000100040000000000000000000000000000000000000000000000" $FileName &= "00000000000000000000008000000080800080000000800080008080000080808000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF" $FileName &= "0000FFFFFF0011111111111111111111111111111111111100000000000001111111111111111111788888888888011111111111111111117FFFFFFF" $FileName &= "FFF8011111111111111110007FFFFFFFFFF8011111111111111117FB7FFFFFFFFFF8011111111111111117BF7F44444444F8000000000000001117FB" $FileName &= "7FFFFFFFFFF8088888888888801117BF7F44444444F808F8F8F8F8F8801117FB7FFFFFFFFFF80F8F8F8F8F8F801117BF7F44444444F808F8F8F8F8F8" $FileName &= "801117FB7FFFFFFFFFF80F8F8F8F8F8F801117BF7F44444444F808F8FFFFFFF8801117FB7FFFFFFFFFF80F8FFCCCC8FF801117BF7FFFFFFFFFF808F8" $FileName &= "FCFFFCF8801117FB7777777777770FFFFCFFFCFF801117BFBFBFBFBF78F8FFCFFCCCCFF8801117FBFBFBFBFB7F8FFFCFFCFFFCFF8011177777777777" $FileName &= "78F8FCFCFCFFFCF880111117FFFFFFFFFFFFFCFCFCCCC8FF80111117FFFFFFFFFFFFFCFCFFFFFFF880111117FFFFFFFFFFFFCFFFCF8F8F8F80111117" $FileName &= "FFFFFFFFFFFFCFFFCFF8F8F880111117FFFFFFFFFFFFFFFFFFFF8F8F80111117FFFFFFFFFFFFFFFFF8F8F8F880111117FFFFFFFFFFFFFFFFFFFF8F8F" $FileName &= "80111114444444C4C44C44C4CCC4CCCCC011111444444C444C44C4CCC4CCCCCCC01111144444444C444C4C4CCCCCCCCCC0111114444444C44C44C4C4" $FileName &= "C4C4CCCCC0111111111111111111111111111111111111111111111111111111111111111111FFFFFFFFF0007FFFF0007FFFF0007FFF80007FFF8000" $FileName &= "7FFF80000003800000038000000380000003800000038000000380000003800000038000000380000003800000038000000380000003E0000003E000" $FileName &= "0003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003FFFFFFFFFFFFFFFF" Return $FileName EndFunc Func _LOGOBin2() Local $FileName = "0x0000010001002040000001002000A8100000160000002800000020000000400000000100200000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "00000000000000000000000000000000000000000000CF6B6CFFC96869FFB25B5CFF7F3F3FFF6E92A2FF6A8B9CFF597687FF435869FF283543FF749C" $FileName &= "8AFF709686FF5E8174FF47645BFF2B403BFF000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000CF6B6CFCE88E8FFFE6898AFFB65B5BFF7196A6FF58C5E1FF4DBEDDFF4DBE" $FileName &= "DDFF5BBADBFF779F8DFF68D097FF5ECC91FF5ECC91FF6ACB9BFF3E6C5FFF000000000000000000000000000000000000000000000000000000000000" $FileName &= "0000000000000000000000000000000000000000000000000000000000000000000000000000D27172FFA66C6CFFA06364FF8C4B4BFF749BACFF62A3" $FileName &= "BDFF5798B4FF4D8DABFF4B809CFF7AA592FF6DB292FF62A989FF58A081FF549279FF3BBC7DFF3E6C5FFF000000000000000000000000000000000000" $FileName &= "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D67879FFF6AAABFFF09D9EFFCB68" $FileName &= "68FF77A1B1FF63D3F3FF5CD0F3FF55CDF2FF5BBADBFF7EAA95FF74E2A8FF6EE1A5FF67DFA1FF6ACB9BFF3BBC7DFF3E6C5FFF705642FF6F5440FF6E53" $FileName &= "3FFF6D523DFF6B513DFF6A4F3BFF694E39FF684D38FF674C38FF664B36FF654A35FF644934FF634933FF634833FF0000000000000000DA8283FFC37F" $FileName &= "7FFFBC7475FFA45959FF7CA6B7FF69A6BDFF5F9CB4FF5590ACFF4B809CFF83B09BFF73B394FF69AA8CFF5FA185FF549279FF3BBC7DFF406E61FFC4AD" $FileName &= "A2FFC3ACA0FFC1AA9DFFC0A89CFFBFA699FFBDA497FFBBA295FFB9A193FFB89E90FFB69C8EFFB49B8CFFB2998AFFB19787FF634834FF000000000000" $FileName &= "0000DF8A8BFFFDB9BBFFF9B0B1FFCE6E6DFF7FACBDFF7EDEF5FF78DCF4FF71D9F4FF5BBADBFF86B59FFF8CE7B4FF87E5B0FF80E4AEFF6ACB9BFF3BBC" $FileName &= "7DFF437265FFF6DFD4FFF5DED2FFF5DCD0FFF4DACEFFF4D9CCFFF3D7CAFFF3D5C8FFF2D4C6FFF1D3C4FFF2D1C2FFF1D0C0FFF0CEBEFFB3998BFF6549" $FileName &= "35FF0000000000000000E39394FFFFBDBEFFFDB7B9FFCF7170FF83B2C3FF8BE3F5FF85E1F4FF7EDEF4FF5BBADBFF8ABBA3FF97E8B9FF92E7B6FF8CE6" $FileName &= "B3FF6ACB9BFF3BBC7DFF477668FFF5E0D7FFF6DFD5FFF5DED2FFF4DCD0FFF4DACEFFF3D9CCFFF3D7C9FFF2D5C7FFF2D4C5FFF2D3C3FFF2D1C2FFF1D0" $FileName &= "C0FFB59C8DFF664B36FF0000000000000000E79B9CFFFFBDBEFFFFBDBEFFD17473FF88B7C9FF96E7F6FF91E6F6FF8AE3F5FF5BBADBFF8FC1A9FFA1EA" $FileName &= "BFFF9DEABCFF96E8B8FF6ACB9BFF3BBC7DFF4B7B6BFFF7E2D8FFF6E1D6FFF6DFD4FFF5DED2FFF5DCD0FFF4DACEFFF3D9CBFFF3D6CAFFF2D5C8FFF2D3" $FileName &= "C5FFF2D3C4FFF1D1C2FFB89E90FF674D38FF0000000000000000ECA4A5FFFFBDBEFFFFBDBEFFD27676FF8BBCCEFF9FEBF6FF9BEAF6FF96E7F6FF5BBA" $FileName &= "DBFF93C6ADFFA9EBC2FFA6EBC0FFA1EABFFF6ACB9BFF3BBC7DFF4F8070FFF7E3DAFFF6E2D8FFF6E0D6FFF9E8E1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $FileName &= "FFFFFFFFFFFFFFFFFFFFF7E3DBFFF2D3C4FFBAA193FF684E3AFF0000000000000000F0ACADFFCD8585FFC57A7BFFAC5D5DFF8DC0D2FF78ADBEFF6FA2" $FileName &= "B5FF6697ACFF4B809CFF95CAB0FF80B59AFF77AC93FF6EA38BFF549279FF3BBC7DFF548473FFF7E5DCFFF6E3DAFFF6E2D7FFFFFDFDFFDA925CFFCB66" $FileName &= "00FFCB6600FFCB6600FFCB6600FFDA925CFFFCF6F1FFF5DED3FFBCA497FF6A4F3BFF0000000000000000F4B3B4FFFFBDBEFFFFBDBEFFD37979FF8FC3" $FileName &= "D5FFABF0F7FFABF0F7FFA8EFF7FF5BBADBFF97CCB2FFB4EEC8FFB4EEC8FFB1EDC6FF6ACB9BFF3BBC7DFF598A78FFF8E7DEFFF7E5DCFFF7E3DAFFFFFF" $FileName &= "FFFFDA925CFFCB6600FFE6B692FFE6B692FFD17733FFCB6600FFE9BFA0FFFAEDE7FFBEA79AFF6B523DFF0000000000000000F5B6B7FFF5B6B7FFEDA7" $FileName &= "A9FFCF7171FF8FC3D5FF85B4C7FF7AA4B4FF7095A6FF6A8B9CFF97CCB2FF8DBFA8FF81AD98FF769F8DFF709686FF3BBC7DFF5E907DFFF8E7E0FFF7E6" $FileName &= "DDFFF7E4DBFFFFFFFFFFDA925CFFCB6600FFFFFFFFFFFFFFFFFFE9BFA0FFCB6600FFE9BFA0FFF9EEE8FFC0A99DFF6D543FFF00000000000000000000" $FileName &= "0000D6A29DFF927C6CFFE5E0DCFFCD999EFF91B2B9FF907B6DFFE5E0DCFFFFFFFFFF6A8B9CFF96B4A3FF8B7179FFE4DDDFFFFFFFFFFF709686FF80A8" $FileName &= "98FFFEFAF9FFFFFFFFFFFDFAF8FFFFFFFFFFDA925CFFCB6600FFCB6600FFCB6600FFCB6600FFD7894EFFFCF6F1FFF6E1D7FFC3AB9FFF6F5541FF0000" $FileName &= "0000000000000000000000000000C69992FF957D6EFFF4ECE8FFCB9196FF8CABB3FF86837DFFF4ECE8FFE2F3F5FF6A8B9CFFFBF2EEFF857E7FFFF2E9" $FileName &= "EDFFE5F3EAFFE5ECE9FFE9BFA0FFCB6600FFE9BFA0FFFFFFFFFFDA925CFFCB6600FFE6B692FFE6B692FFD17733FFCB6600FFFFFFFFFFF5DDD2FFC4AE" $FileName &= "A2FF715743FF00000000000000000000000000000000B7A293FFFEFBFAFFFEFBFBFFFDFAF9FFFDF9F7FFFDF9F6FFFCF7F5FFFDF5F3FFFCF5F1FFFBF3" $FileName &= "EFFFFBF2EDFFFBF0EBFFFCF4F1FFF9EDE4FFD7894EFFCB6600FFD7894EFFFFFFFFFFDA925CFFCB6600FFFFFFFFFFFFFFFFFFDD9B69FFCB6600FFF6E4" $FileName &= "D6FFF6E0D6FFC7B1A5FF735945FF00000000000000000000000000000000B7A293FFFEFDFCFFFEFCFBFFFDFCFAFFFDFBF9FFFDF9F8FFFDF9F6FFFDF7" $FileName &= "F4FFFCF6F3FFFCF5F1FFFBF3EFFFFBF2EEFFFEFDFCFFE6B692FFCB6600FFD7894EFFCB6600FFF6E4D6FFDA925CFFCB6600FFCB6600FFCB6600FFCB66" $FileName &= "00FFD7894EFFFFFFFFFFF5DFD4FFC9B3A8FF755B48FF00000000000000000000000000000000B7A293FFFEFEFEFFFEFDFCFFFEFCFBFFFEFBFAFFFEFA" $FileName &= "F9FFFDF9F7FFFDF8F5FFFDF7F4FFFDF5F2FFFBF4F1FFFBF3F0FFFFFFFFFFD48040FFCB6600FFF6E4D6FFCB6600FFD48040FFF6E4D6FFF3DBC9FFF3DB" $FileName &= "C9FFF3DBC9FFF3DBC9FFFFFFFFFFF8EAE3FFF5DED2FFCBB6ACFF775E4AFF00000000000000000000000000000000B7A293FFFFFFFEFFFFFEFDFFFEFD" $FileName &= "FCFFFEFCFCFFFEFBFAFFFDFAF9FFFDF9F7FFFDF8F6FFFDF6F4FFFCF5F2FFFDF8F6FFF6E4D6FFCB6600FFE0A477FFFFFFFFFFE0A477FFCB6600FFF6E4" $FileName &= "D6FFFEFAF9FFFAF1ECFFFAF0EBFFF9ECE6FFF7E5DDFFF6E1D6FFF5DED4FFCDBAAFFF79604DFF00000000000000000000000000000000B7A293FFFFFF" $FileName &= "FFFFFFFFFEFFFEFEFDFFFEFCFCFFFEFCFBFFFEFBF9FFFDFAF8FFFDF9F7FFFDF8F5FFFCF6F4FFFFFFFFFFE3AD84FFCB6600FFF0D2BBFFFFFFFFFFF0D2" $FileName &= "BBFFCB6600FFE3AD84FFFFFEFEFFF8E8E1FFF7E6DEFFF7E5DCFFF7E3DAFFF7E2D8FFF5E0D5FFCFBCB3FF7B624FFF0000000000000000000000000000" $FileName &= "0000B7A293FFFFFFFFFFFFFFFFFFFFFEFEFFFEFDFDFFFEFDFCFFFEFCFBFFFEFAF9FFFDFAF8FFFDF9F7FFFDF7F5FFFFFFFFFFCB6600FFD17733FFFFFF" $FileName &= "FFFFFCF5F1FFFFFFFFFFD17733FFCB6600FFFFFFFFFFF9E9E2FFF8E8E1FFF8E6DEFFF7E5DCFFF6E3D9FFF6E2D8FFD1C0B7FF7E6452FF000000000000" $FileName &= "00000000000000000000B7A293FFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFFFFFDFDFFFEFCFCFFFEFCFAFFFDFBFAFFFDF9F8FFFDF9F6FFFEFCFBFFF3DB" $FileName &= "C9FFF6E4D6FFFDFAF8FFFBF3EEFFFEFAF8FFF3DBC9FFF6E4D6FFFDF7F4FFF9EBE4FFF9E9E2FFF8E8E0FFF7E6DEFFF7E5DBFFF6E2DAFFD4C3BAFF8067" $FileName &= "54FF00000000000000000000000000000000B7A293FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFEFDFDFFFEFCFCFFFEFBFBFFFDFBFAFFFEFA" $FileName &= "F8FFFDF9F7FFFEF9F8FFFDF9F6FFFCF6F2FFFCF3EFFFFBF3F0FFFCF4F1FFFBF3F0FFFAEFEAFFF9ECE6FFF9EBE4FFF9E9E2FFF8E7E0FFF8E6DEFFF7E4" $FileName &= "DCFFD7C7BEFF826957FF00000000000000000000000000000000B7A293FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFEFFFEFDFDFFFEFD" $FileName &= "FCFFFEFBFBFFFEFAF9FFFDF9F8FFFDF9F6FFFDF8F4FFFCF6F3FFFCF5F1FFFCF3EFFFFBF2EDFFFAF0ECFFFAEFEAFFF9EEE8FFF9ECE6FFF9EBE4FFF9E9" $FileName &= "E1FFF8E7DFFFF7E6DDFFF7E4DBFF846C5AFF00000000000000000000000000000000D19172FFD19172FFD19172FFD08C6BFFD08661FFCE7E55FFCD75" $FileName &= "49FFCC6D3DFFCA6431FFCA5D27FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC959" $FileName &= "20FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FF00000000000000000000000000000000D19172FFFEC09FFFFEBE9DFFFDBC9BFFFDBA" $FileName &= "98FFFDB996FFFCB793FFFBB590FFFBB38DFFFBB08AFFFAAE86FFF9AB83FFF8A980FFF8A77DFFF7A47AFFF7A377FFF5A074FFF59E71FFF59C6FFFF49A" $FileName &= "6DFFF4996AFFF49768FFF39666FFF39565FFF39565FFF39565FFF39565FFC95920FF00000000000000000000000000000000D19172FFFEC09FFFFEBE" $FileName &= "9DFFFDBD9BFFFDBB98FFFDB995FFFCB693FFFBB590FFFBB28DFFFBB08AFFF9AE86FFF9AB84FFF8A980FFF8A77EFFF7A57AFFF7A377FFF6A074FFF59E" $FileName &= "71FFF59C6EFFF49A6DFFF4986AFFF49768FFF49666FFF39565FFF39565FFF39565FFF39565FFC95920FF00000000000000000000000000000000D191" $FileName &= "72FFFEC09EFFFEBF9DFFFEBC9AFFFDBB98FFFDB995FFFCB693FFFCB590FFFBB38DFFFAB18AFFF9AE87FFF9AB83FFF9AA81FFF7A77DFFF7A57AFFF6A3" $FileName &= "77FFF6A075FFF69E71FFF59D6FFFF49A6CFFF4986AFFF49768FFF49667FFF39565FFF39565FFF39565FFF39565FFC95920FF00000000000000000000" $FileName &= "000000000000D19172FFD19172FFD19172FFD08C6BFFD08661FFCE7E55FFCD7549FFCC6D3DFFCA6431FFCA5D27FFC95920FFC95920FFC95920FFC959" $FileName &= "20FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FFC95920FF0000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" $FileName &= "000000000000000000000000000000000000FFFFFFFFFFFFFFFF8001FFFF8000FFFF80007FFF80000001800000018000000180000001800000018000" $FileName &= "0001800000018000000180000001C0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E0000001E000" $FileName &= "0001E0000001E0000001E0000001E0000001FFFFFFFFFFFFFFFF" Return $FileName EndFunc Func _LOGOBin3() Local $FileName = "0x0000010001002040000001000800A8080000160000002800000020000000400000000100080000000000000000000000000000000000000000000000" $FileName &= "00000000000000008000008000000080800080000000800080008080000080808000C0DCC000F0CAA600AA3F2A00FF3F2A00005F2A00555F2A00AA5F" $FileName &= "2A00FF5F2A00007F2A00557F2A00AA7F2A00FF7F2A00009F2A00559F2A00AA9F2A00FF9F2A0000BF2A0055BF2A00AABF2A00FFBF2A0000DF2A0055DF" $FileName &= "2A00AADF2A00FFDF2A0000FF2A0055FF2A00AAFF2A00FFFF2A000000550055005500AA005500FF005500001F5500551F5500AA1F5500FF1F5500003F" $FileName &= "5500553F5500AA3F5500FF3F5500005F5500555F5500AA5F5500FF5F5500007F5500557F5500AA7F5500FF7F5500009F5500559F5500AA9F5500FF9F" $FileName &= "550000BF550055BF5500AABF5500FFBF550000DF550055DF5500AADF5500FFDF550000FF550055FF5500AAFF5500FFFF550000007F0055007F00AA00" $FileName &= "7F00FF007F00001F7F00551F7F00AA1F7F00FF1F7F00003F7F00553F7F00AA3F7F00FF3F7F00005F7F00555F7F00AA5F7F00FF5F7F00007F7F00557F" $FileName &= "7F00AA7F7F00FF7F7F00009F7F00559F7F00AA9F7F00FF9F7F0000BF7F0055BF7F00AABF7F00FFBF7F0000DF7F0055DF7F00AADF7F00FFDF7F0000FF" $FileName &= "7F0055FF7F00AAFF7F00FFFF7F000000AA005500AA00AA00AA00FF00AA00001FAA00551FAA00AA1FAA00FF1FAA00003FAA00553FAA00AA3FAA00FF3F" $FileName &= "AA00005FAA00555FAA00AA5FAA00FF5FAA00007FAA00557FAA00AA7FAA00FF7FAA00009FAA00559FAA00AA9FAA00FF9FAA0000BFAA0055BFAA00AABF" $FileName &= "AA00FFBFAA0000DFAA0055DFAA00AADFAA00FFDFAA0000FFAA0055FFAA00AAFFAA00FFFFAA000000D4005500D400AA00D400FF00D400001FD400551F" $FileName &= "D400AA1FD400FF1FD400003FD400553FD400AA3FD400FF3FD400005FD400555FD400AA5FD400FF5FD400007FD400557FD400AA7FD400FF7FD400009F" $FileName &= "D400559FD400AA9FD400FF9FD40000BFD40055BFD400AABFD400FFBFD40000DFD40055DFD400AADFD400FFDFD40000FFD40055FFD400AAFFD400FFFF" $FileName &= "D4005500FF00AA00FF00001FFF00551FFF00AA1FFF00FF1FFF00003FFF00553FFF00AA3FFF00FF3FFF00005FFF00555FFF00AA5FFF00FF5FFF00007F" $FileName &= "FF00557FFF00AA7FFF00FF7FFF00009FFF00559FFF00AA9FFF00FF9FFF0000BFFF0055BFFF00AABFFF00FFBFFF0000DFFF0055DFFF00AADFFF00FFDF" $FileName &= "FF0055FFFF00AAFFFF00FFCCCC00FFCCFF00FFFF3300FFFF6600FFFF9900FFFFCC00007F0000557F0000AA7F0000FF7F0000009F0000559F0000AA9F" $FileName &= "0000FF9F000000BF000055BF0000AABF0000FFBF000000DF000055DF0000AADF0000FFDF000055FF0000AAFF000000002A0055002A00AA002A00FF00" $FileName &= "2A00001F2A00551F2A00AA1F2A00FF1F2A00003F2A00553F2A00F0FBFF00A4A0A000808080000000FF0000FF000000FFFF00FF00000000000000FFFF" $FileName &= "0000FFFFFF00FDFDFD5E5A5E075A0707073207313231FDFDFDF6AFAFAFD4AFAFFDFDFDFDFDFDFDFDFD82F6D4D4D409D4080909090931FDFDFDAF37DC" $FileName &= "0EDCDD36F6FDFDFDFDFDFDFDFD82B3AFF6AFAFAFAFAFAFAF0932FDFDFDAF37DC63090EDDAFFDFDFDFDFD5E5E5A09AFF6AFAFAFAFAFAFAFAF0931FDFD" $FileName &= "FDAF3ADDD1D187DCAFFDFDFDFDFD82D0A986D1AF0F0E0E0E0A0AF5AF0907AFAFAFAF37DCDCDCDC37FFFDFDFDFDFD5ECFD086F6F6F6AFF6AFB3AFAFAF" $FileName &= "D4AF83DC09AF370E63090EDCAFFDFDFDFDFD82D0CF09D1B30F0E0E0A0AF50AAFAFAF36DC37AF3ADDD1FF3BDCAF320DF5FDFD86D0AD09F6FFF6B3D1B3" $FileName &= "F6AFAFF6FF63DC37DCAF37DCDCDCDC37FFF000F5FDFD86D0D008FFF60F0E0E0A0AF50AAFFF33DCAFDC12AFD4D409D4FF3100000DFDFD09CFD009FFF6" $FileName &= "F6FFFFB3FFB3AFF6AFDC5FF65FDCAF08070731F100F000F5FDFD08D0D008FFFF0F0E0E0A0AF50AFF5FDCD4FFD4DD5FF600F00000000000F5FDFD09D0" $FileName &= "D3AFFFFFFFFFFFFFF6B3D1FFDC12FF31FF12DCFFF00000F000000031FDFD08D0D008F6FFFFFFFFFFFFFFFFFFAFAFF7F082AFAFF700F100000000000D" $FileName &= "FDFDD4D3D0AFFFFFFFF6FFFFFFF6D1FFF6F72DF02D3131F5F000F0F100F0002DFDFD08D0D3AFAF0808AFAF08D4D40808095EF1F5F0F5F0F0F1F00000" $FileName &= "F000000EFDFDAFD3D0D3D0D0D3D0ADD0CFAD5AF52C2DF5F4F1F0F0F1F0F0F1F0F000F031FDFDAFD0D3D0D3D0D0D3D0D0D0D05A2DF5F52CF52CF5F5F0" $FileName &= "F1F0F0F100F0000EFDFDAFAFAFAFAFAFD4D4D408AB085E2D2D2DF52DF5F429F5F0F5F0F0F1F0F031FDFDFDFD5E3131313155313131312D31312D31F5" $FileName &= "2CF5F5F4F1F0F1F1F0F0F10DFDFDFDFD8231553131313131313131312D2D2D2DF52DF42DF5F4F5F0F0F1F031FDFDFDFD5E313107FFFF31FF3131FF31" $FileName &= "3131312D31F52DF52CF5F0F5F1F0F032FDFDFDFD823131FF075531553131FF31312D31312D2D31F52DF52DF4F5F5F031FDFDFDFD823131FF31313131" $FileName &= "318282313131312D31312D2D0D2DF42DF5F0F532FDFDFDFD5E3155FF073131FF31FF313131313131312D2D312DF52DF52CF5F431FDFDFDFD82313107" $FileName &= "FFFF313131FF3107313131313131312D2D312DF52D2DF532FDFDFDFD5E31313131310731073131313131313131313131312D312DF52DF531FDFDFDFD" $FileName &= "5B5E5B363636320E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0A0E0E0E0E0FFDFDFDFD5E8763878787636387635F5F5F5F5F5F3B5F5F3B5B3B5F3B3B375F0E" $FileName &= "FDFDFDFD37878787636383635F5F635F635F5F5F5F5F3B5F3B5F3B5B3B5F3B0EFDFDFDFD5E6387098787638763635F5F5F5F5F5F3B5F3B5F3B373B3B" $FileName &= "373B370FFDFDFDFD5E5B5E373637360E0F0E0E0E0E0F0E0E0E0E0F0E0E0E0E0F0E0E0E0EFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD" $FileName &= "FDFDFDFDFDFDFDFDFDFDE000E03FE000E01FE000E01F0000E01F0000001F0000001F0000000300000003000000030000000300000003000000030000" $FileName &= "00030000000300000003000000030000000300000003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C000" $FileName &= "0003C0000003C0000003C0000003FFFFFFFF" Return $FileName EndFunc 1.To create a Windows Application, you can use the fist icon. See the "Hello World.vb" example script. 2.To create a Class Library(dll file), you can use the second icon. Open the "Hello World.vb" Script and it will produce a DotNet.dll. Wich you can reuse in other scripts. 3.To create a console application, you can use the third icon. See the "GetTickCount.vb" example script. _DOTnet Scripting.zip Edit : Changed the script not to delete the compiled exe files. Enjoy ! Rgds ptrex
    1 point
×
×
  • Create New...