Leaderboard
Popular Content
Showing content with the highest reputation on 07/21/2014 in all areas
-
very very noob guy here (:
232showtime and one other reacted to Melba23 for a topic
yakovha, Welcome to the AutoIt forums. Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at this excellent tutorial - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. Have fun! M232 points -
AudioBox - simple BASS.dll music player
UEZ and one other reacted to scintilla4evr for a topic
Hello, I've just uploaded version 2.1 of AudioBox. Changes: added gesture tip for hiding playlist 2 new backgrounds new graphic effects Download2 points -
In the last versions of Windows, it has been difficult to automate Windows Explorer. But there are many examples of code like this to extract the selected items: ; Windows Explorer on XP, Vista, 7, 8 $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then Exit ; Shell object $oShell = ObjCreate( "Shell.Application" ) ; Find window For $oWindow In $oShell.Windows() If $oWindow.HWND() = $hExplorer Then ExitLoop Next ; Selected items For $oItem In $oWindow.Document.SelectedItems() ConsoleWrite( $oItem.Path() & @CRLF ) Next It's possible to create these objects with ObjCreateInterface. More precisely, create an IShellBrowser interface for the top level browser of an open Windows Explorer. Plan and code This is the plan: Create an IShellWindows interface to get a list of shell windows Get an IWebBrowserApp object for each window. This is done in two steps: Get an IDispatch object for the window Get the IWebBrowserApp interface Identify the proper shell window with get_HWND of IWebBrowserApp Get an IServiceProvider interface with QueryInterface of IWebBrowserApp Get the IShellBrowser interface with QueryService of IServiceProvider This is the code: Func GetIShellBrowser( $hExplorer ) ; IShellWindows interface Local $pIShellWindows, $oIShellWindows CoCreateInstance( $tCLSID_ShellWindows, $NULL, $CLSCTX_ALL, $tRIID_IShellWindows, $pIShellWindows ) $oIShellWindows = ObjCreateInterface( $pIShellWindows, $sIID_IShellWindows, $dtag_IShellWindows ) ; Number of shell windows Local $iWindows $oIShellWindows.get_Count( $iWindows ) ; Get an IWebBrowserApp object for each window ; This is done in two steps: ; 1. Get an IDispatch object for the window ; 2. Get the IWebBrowserApp interface ; Check if it's the right window Local $pIDispatch, $oIDispatch Local $pIWebBrowserApp, $oIWebBrowserApp, $hWnd For $i = 0 To $iWindows - 1 $oIShellWindows.Item( $i, $pIDispatch ) If $pIDispatch Then $oIDispatch = ObjCreateInterface( $pIDispatch, $sIID_IDispatch, $dtag_IDispatch ) $oIDispatch.QueryInterface( $tRIID_IWebBrowserApp, $pIWebBrowserApp ) If $pIWebBrowserApp Then $oIWebBrowserApp = ObjCreateInterface( $pIWebBrowserApp, $sIID_IWebBrowserApp, $dtag_IWebBrowserApp ) $oIWebBrowserApp.get_HWND( $hWnd ) If $hWnd = $hExplorer Then ExitLoop EndIf EndIf Next ; IServiceProvider interface Local $pIServiceProvider, $oIServiceProvider $oIWebBrowserApp.QueryInterface( $tRIID_IServiceProvider, $pIServiceProvider ) $oIServiceProvider = ObjCreateInterface( $pIServiceProvider, $sIID_IServiceProvider, $dtag_IServiceProvider ) ; IShellBrowser interface Local $pIShellBrowser $oIServiceProvider.QueryService( $tRIID_STopLevelBrowser, $tRIID_IShellBrowser, $pIShellBrowser ) $oIShellBrowser = ObjCreateInterface( $pIShellBrowser, $sIID_IShellBrowser, $dtag_IShellBrowser ) EndFunc Now it's easy to create the shell interfaces. The main interfaces are: Func GetShellInterfaces() Local $pIFolderView, $pIFolderView2, $pIPersistFolder2, $pIShellFolder, $pPidlFolder, $pPidlRel, $i = 0 ; IShellView interface $oIShellBrowser.QueryActiveShellView( $pIShellView ) $oIShellView = ObjCreateInterface( $pIShellView, $sIID_IShellView, $dtag_IShellView ) ; IFolderView interface $oIShellView.QueryInterface( $tRIID_IFolderView, $pIFolderView ) $oIFolderView = ObjCreateInterface( $pIFolderView, $sIID_IFolderView, $dtag_IFolderView ) If @OSVersion <> "WIN_XP" Then ; IFolderView2 interface (Vista and later) $oIShellView.QueryInterface( $tRIID_IFolderView2, $pIFolderView2 ) $oIFolderView2 = ObjCreateInterface( $pIFolderView2, $sIID_IFolderView2, $dtag_IFolderView2 ) EndIf ; IPersistFolder2 interface $oIFolderView.GetFolder( $tRIID_IPersistFolder2, $pIPersistFolder2 ) $oIPersistFolder2 = ObjCreateInterface( $pIPersistFolder2, $sIID_IPersistFolder2, $dtag_IPersistFolder2 ) $oIPersistFolder2.GetCurFolder( $pPidlFolder ) ; IShellFolder interface If ILIsEqual( $pPidlFolder, $pPidlAbsDesktop ) Then SHGetDesktopFolder( $pIShellFolder ) Else Local $pIParentFolder, $oIParentFolder, $pPidlRel SHBindToParent( $pPidlFolder, DllStructGetPtr( $tRIID_IShellFolder ), $pIParentFolder, $pPidlRel ) $oIParentFolder = ObjCreateInterface( $pIParentFolder, $sIID_IShellFolder, $dtag_IShellFolder ) $oIParentFolder.BindToObject( $pPidlRel, $NULL, $tRIID_IShellFolder, $pIShellFolder ) EndIf $oIShellFolder = ObjCreateInterface( $pIShellFolder, $sIID_IShellFolder, $dtag_IShellFolder ) ; Free memory used by $pPidlFolder _WinAPI_CoTaskMemFree( $pPidlFolder ) ; Wait for Explorer to refresh $pPidlRel = GetFocusedItem() While Not $pPidlRel And $i < 10 Sleep( 25 ) $pPidlRel = GetFocusedItem() $i += 1 WEnd ; Free memory used by $pPidlRel If $pPidlRel Then _ _WinAPI_CoTaskMemFree( $pPidlRel ) EndFunc Features The methods of the interfaces supports the following features: You can handle items in Windows Explorer: Get current folder, get all items, get/set selected items and get/set focused item. A selected file is opened by executing the InvokeCommand for the default item in the context menu. You can browse to a specific folder or a parent/child folder. You can set icon view mode. Functions AutomatingWindowsExplorer.au3 contains the two functions above. And it contains a number of functions to implement the features: GetCurrentFolder SetCurrentFolder CountItems GetItems GetFiles GetFolders GetPidls GetFocusedItem SetFocusedItem SetSelectedItem GetIconView SetIconView When the interfaces are created, the functions can be implemented with a few lines of code. This is the code for GetCurrentFolder and SetCurrentFolder: Func GetCurrentFolder() Local $pPidlAbs $oIPersistFolder2.GetCurFolder( $pPidlAbs ) Return $pPidlAbs EndFunc ; After this command $oIShellBrowser is the only valid interface object. To ; be able to use the other interfaces you must execute GetShellInterfaces(). Func SetCurrentFolder( $pPidl, $fFlag ) $oIShellBrowser.BrowseObject( $pPidl, BitOR( $SBSP_DEFBROWSER, $fFlag ) ) EndFunc For examples search the functions in Example.au3 and Example*.au3. Depending on parameters most functions can return PIDLs. Some functions return only PIDLs. In these cases you must free memory (_WinAPI_CoTaskMemFree) used by the PIDLs, when you have finished using the PIDLs. There are many more methods that are not implemented in these functions, and there are available interfaces that have not been created. Example Example.au3 demonstrates the features. Example folder contains scripts with functions used in the example. It's important that there is consistency between the interfaces, and the current folder in Windows Explorer. If the GUI loses and gets focus, it's checked if the current folder is changed. In that case the interfaces are updated to match the new folder. This is a picture of the GUI: Items and selected items are shown with _ArrayDisplay. The number of rows in the listview to the right is limited to 100. The listview can only be used for the buttons in the lower right group. The buttons in the lower left group are disabled, if there are more than 100 items in the folder. There is also a listview on the second tab item. It's limited to 100 rows, and can only be used for the Child folder button. You can also double click a child folder in the listview, to browse to this folder. Control Panel The example does not work for the Control Panel. The reason is that the child windows which are created for the Control Panel, are different from the child windows which are created for other folders. You can verify that with the UI Automation framework. Zipfile Example - include files used in example Includes - include files used for Automating Windows Explorer Example.au3 - Example For AutoIt 3.3.10 and later. Testet on Windows XP 32 bit and Windows 7 32/64 bit. Automating Windows Explorer.7z Examples in posts below Post 7 is a collection of small examples. Post 15 shows how to automate a search with UI Automation code. Post 31 shows how to execute a function on a double-click in empty space of the right pane window (the listview). The code contains UI Automation code. Post 38 is UI Automation code to make a selected item visible by scrolling the listview up or down.1 point
-
Bitmap Library
genius257 reacted to evilertoaster for a topic
Hi all, here's a bitmap library with some simple bitmap picture functions. Cheers! (Documentation/example in zip archive also) Updated 6/21/06-v1.2 Added PixelRead and OpenBMP functions Updated 6/22/06-v1.3 Added to Help File. Fixed a bug with _OpenBMP(). Added progress bar option as well Updated 6/23/06-v1.4 Added to Help File. Fixed another bug with _OpenBMP(). Added _LineWrite() Updated 6/26/06-v1.5 Added to Help File. Rewrote _LineWrite() Function. Color mode now determined by the AutoIt option "ColorMode". Added _CircleWrite() function. Updated 6/30/06-v1.6 Added to Help File. Rewrote _CircleWrite function, now called _EillipseWrite (for a circle have the height and width be the same). Fixed bug in _BMPWrite. Some functions were renamed (this may break any existing code) they are now a more standard format (_ThingAction). Added _RectangleWrite function. Updated 6/30/06(agian)-v1.7 Fixed Bug with BMPOpen. Will no longer try and add-on to already existing files during BMPwrite. Updated 8/14/06-v1.8 Added some fuctions and fixed some bugs. See help file for more info. Updated 2/26/08-v1.9 Updated _BMPWrite to work on the latest version of autoit (I Hope ) Updated 3/04/08-v2.0 Significant rewrite of _BMPOpen(),_BMPWrite(),_PixelWrite(),and _PixelRead(). They now work with the native binary variant and binary file I/O. The speed for _BMPOpen() and _BMPCreate() should be significantly faster. _PixelRead() will mostly be unaffected. _PixelWrite() will probably be SLOWER in most cases. I'll leave version 1.9 up in case this becomes an issue for anyone. Updated 5/14/08-v2.1 Fixed a bug when using _BMPOpen() on files with a length or width larger than 255 and added check for BMP size when opening. Removed the check for Opt("ColorMode") as it will be removed from AutoIt soon. Removed some useless code/Slight performence tweaks. Fixed the example file to work 'as is'. Updated 11/01/09-v2.2 Fixed a significant bug with _PixelRead() (Don't know how that slipped by for so long). Updated 11/08/09-v3.0 Significant rewrite of the libraries core functions. Now using DLLStruct functions for pixel reading and writing. A performance gain in almost all cases except for very very small BMPs (<10x10) at which point the speed is almost non-factor. Larger bitmaps like a 1024x768 have performance gains in the order of several magnitudes for pixel writing. There are SCRIPT BREAKING changes to the library. Almost all of the geometric draw functions have been removed (Line write,ellipse write, ect). It was taking the library to a more graphics-driven setting, when it's only intent was to allow pixel I/O. In most cases, you can create design-specific algorithms for drawing functions that were better then the general case ones in the library. Updated 4/14/10-v3.1 Fixed a bug with BMPOpen (Thanks pbsds). Removed the .txt help file, the functions are now documented in the source file with a more standard convention. BMPWrite no longer has the optional 'ProgressBar' parameter. Updated 7/27/10-v3.2 Functions in the library did not have a '_' prefixed to them, now they do...sorry for the flip flop (Thanks loukaniko). Updated 5/01/11-v3.3 Fixed file handle leak in _BMPOpen (Thanks windwind12). Speed improvement (about 25% faster) to _PixelWrite and _PixelRead. BMP_Library1.9.zip BMP_Libary2.2.zip BMP3.3.zip1 point -
This is not supported by Jos (who is the author of AutoIt3Wrapper) so please keep both his thread and my thread on topic. Thanks. This script will convert AutoIt3Wrapper directives into valid pragma directives. There is also an option to overwrite the script with the new directives so you don't have to. What could be easier! If you need more help on how to use, then please don't hesitate to ask. AutoIt3WrapperToPragma.zip Note: This doesn't replace all directives. AutoIt3Wrapper is still a valuable tool and offers additional directives that pragma doesn't support at present. This is the old version. I have left it here so you can do a source code comparison of how much of the code I actually changed. [OLD STYLE] AutoIt3WrapperToPragma.zip1 point
-
The image type must be in BMP format, further you need to read the image in binary format and finally trim left the binary string by 30. Something like this here: $binImage = StringTrimLeft(Binary(FileRead("YourImage.bmp")), 30) $binRtf = "{\rtf1{\pict\dibitmap\picw6218\pich3149\picwgoal3525\pichgoal1785 " & $binImage & "}}" Br, UEZ1 point
-
Need to keep program running
232showtime reacted to Melba23 for a topic
Trax, if the machines are networked then I believe you should be able to limit activities by setting permissions - I will ask someone who know more about networks to look in. Shane0000 & 232showtime, Which bit of: did you not understand? As it happens, you both suggested the same thing as myself, which is the only reason I am taking no further action. But think yourselves extremely lucky. M231 point -
dilipped, The example you are referring to (post 78, example 15 in the list in first post), does not handle virtual items in Windows Explorer listview. To handle virtual items see post 94, example 18 in the list in first post. I have updated the code. This example also prints the items in Windows Explorer listview and the selected state. You should take a look at this example: Automating Windows Explorer.1 point
-
I *think* you are trying to do something like this.. $oLink = _IEGetObjById($oIE, "cwos") if $oLink.innertext > 0 then MsgBox(16,"Error","Subtotal is not $0.00, halting!") ;o) Cor1 point
-
Thanks, Yes, I used the installer and followed the process as to the online instructions (sequence). Also tried to reinstall AutoIt and then SciTE again. I also noticed that when runing SciTE config then change the colour settings and press Save+Apply it provides the feedback that it did apply the changes. On exit it askes again to save the changes - whithout any additional changes applied. I temporarily reverted back to SciTE Version 3.3.7 - which worked. However I just installed it again and here the top section of the install.log out of the SciTE dir after the installation of 3.4.1. I can sent you the entire log if of any use. Retrieve current content of SCITE_USERHOME HKCU: Target was appended to SCITE_USERHOME Target was found and removed from SCITE_USERHOME ==> current content of SCITE_USERHOME: C:\Users\stein\AppData\Local\AutoIt v3\SciTE Target was found and removed from SCITE_USERHOME SCITE_USERHOME is now empty ==> current content of SCITE_USERHOME: Retrieve current content of SCITE_USERHOME HKLM SCITE_USERHOME was empty and has been updated with the target Target was found and removed from SCITE_USERHOME SCITE_USERHOME is now empty ==> current content of SCITE_USERHOME: SCITE_USERHOME was empty and has been updated with the target Output folder: C:\Users\stein\AppData\Local\AutoIt v3\SciTE Copy to C:\Users\stein\AppData\Local\AutoIt v3\SciTE\abbrev.save.properties Delete file: C:\Users\stein\AppData\Local\AutoIt v3\SciTE\abbrev.properties Extract: C:\Users\stein\AppData\Local\AutoIt v3\SciTE\abbrev.properties Skipped: C:\Users\stein\AppData\Local\AutoIt v3\SciTE\au3abbrev.properties Skipped: C:\Users\stein\AppData\Local\AutoIt v3\SciTE\au3.keywords.user.abbreviations.properties Skipped: C:\Users\stein\AppData\Local\AutoIt v3\SciTE\au3UserAbbrev.properties Output folder: C:\Program Files (x86)\AutoIt3\SciTE Sorry this late adjustment ... Just drove around the block and, while thinking about the log code posted, realised that the installation of SciTE of course runs with admin privileges (in this case user "stein" in that log) but I of course normally work with an account with standard privileges. SciTE installation apparently copied and created all necessary files for the admin user only under C:UserssteinAppDataLocalAutoIt v3SciTE So nothing is being copied or created for the current non admin user when startng to use SciTE .1 point
-
Somewhere along the way, a backslash has been accidentally removed from the ff.au3 code. To solve the issue, change this line: Local $sFFExe = RegRead($sHKLM & "" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe") to: Local $sFFExe = RegRead($sHKLM & "\" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe")1 point