Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/15/2017 in all areas

  1. Hi All, Added a Quick Reference eBook .NET CLR Framework for AutoIT.pdf to post 1. Which is a summary of all technical articles headlines we posted before, In order to give everyone interested in .NET CLR a good starting point to get going. Please let me know if this is helpfull...
    3 points
  2. Hi Guys! Again, it´s update time! ISN AutoIt Studio verson 1.06 is finaly out! And since this update is quite extensive, I cut down the whole stuff on a few highlights: Completely reworked (and cleanly documented in English) plugin system! The system now no longer uses the Maillot UDF, but native WM_COPYDATA. Important: Old plugins must be equipped with the new isnautoitstudio_plugin.au3 file to work again. (More in the help) Printing is now also possible in color! The ISN AutoIt Studio has now several threads. (Autoit_Studio_Helper.exe) These threads will be used in the future to expose complex or ISN blocking functions. For the beginning, it only affects the testing a script / project and the search or installation of ISN AutoIt Studio Updates. In the "Data" folder of the ISN AutoIt Studio is now a new .exe with the name "ISN_cmd.exe". This allows the ISN Autit Studio to be controlled via command line switches. (See help) Plugins can now be packed into package files (* .icp file). This is also the new default format for plugins from my homepage. Furthermore, the standard directory for user-installed plugins has changed from the ISN AutoIt Studio folder to the folder % myisndatadir% \ Data \ Plugins. I would like to thank Dave Thijse for the numerous tests and bugreports of this update! So there is a lot of work in this update. Of course I would appreciate your feedback! Have fun with it! And here is the complete changelog (translated by google): -> ISN AutoIt Studio: <- ----------------------------------- [Fixes] - Various bug fixes - Bug fixed in the parameter editor. (Empty parameters between completed parameters are now automatically filled in with "-1") - When creating a new task in the ToDo list, the wrong date was used. This is now fixed. - Sometimes the Autocomplete did not work properly. (No suggestions were displayed when writing) This should now be fixed. - Changes in the script by various actions were often not recognized as changes in the ISN. This is now fixed. - The window of a plug-in was placed over the windows of the ISN AutoIt Studio. This is now fixed. [Improvements] - After the compilation, open au3 files are only read-in again into the editor when changes are made to the file. (Eg increase of the version by the AutoIt3Wrapper) - The ISN AutoIt Studio now contains version 17.224.935.0 of the "AutoIt3Wrappers" - Some GUIs have an icon next to the title - The ISN AutoIt Studio now starts a bit faster. - Due to persistent problems with the ISN hotkeys (especially with multiple instances), the ISN AutoIt Studio now uses Yashied's HotKey UDF. These problems should now be fixed. - The testing of a script or project now blocks the ISN no longer! (Testscript is now put into a separate thread) - Mini Debug GUI Graphically revised - The "last used files" are now also saved with path variables. - The last selected element in the script tree is now selected again after updating the script tree - If the CTRL key is released after CTRL + CTRL, you can quickly switch to the previous tab - Help file of ISN AutoIt Studios updated (German and English) [New features] - Printing is now also possible in color! Furthermore, the entry "Print" has been added in the context menu of the script editor. If text is selected in the script editor, only this is printed. If not, the whole file is printed (currently limited to 50,000 characters for performance reasons!). - Intermediate markers (CTRL + F2) can now also be jumped back and forth. (F2 / SHIFT + F2) - Attention: The AutoIt tools "Tidy" or "Au3Stripper" are now NOT included in the ISN AutoIt Studio package. The paths to the tools must therefore be specified in the program settings. However, you can download and install these tools from the autitscript.com website at any time. (Tidy and Au3Stripper are included eg in the AutoIt complete package (SciTE4AutoIt3.exe)) If you are able to manage the settings of the Tidy.ini via the ISN AutoIt Studio, the path to the tidy.ini must also be specified here! - Hotkeys can now also use the following keys: Windows Logo Key, Delete, Insert, End, Print, Home - Added new hotkeys: Print, Clear all parameters (Parameter Editor), Clear current parameters (Parameter editor) - In the Mini Debug GUI (When testing a script), there is now a new button (Details) showing additional information about the running script. (Eg a graph of CPU or RAM utilization) - The default directory for user-installed plugins has been changed from the ISN AutoIt Studio folder to the folder %myisndatadir%\Data\ Plugins. Standard plugins, such as. The Form Studio 2, but still remain in the ISN AutoIt Studio folder. - Whether a plugin is active or inactive, is now no longer saved in the plugin itself (plugin.ini) in the config.ini of the ISN AutoIt Studios. By default, the active plugins are set to the ISN FormStudio 2 and the Fileviewer plug-in. If further plugins are installed, they must be activated again if necessary. - Plugins can now be packed into a separate package (*.icp file). In this format, Now also the plugins offered by my homepage. A simple opening of this file is sufficient and the plugin is installed. (Manual installation is also possible in the program settings -> plugins) The plugin does not have to be copied into the Plugins folder "by hand" anymore. - The ISN AutoIt Studio includes a new plugin by default. The plugin named "ISN Plugin SDK Tools" provides some useful tools for developing ISN plugins. So plugins eg. With this tool into compressed * .icp files. Or even when translating * .lng files, the plugin can be helpful. (BETA! The tool is extended!) Furthermore, you will always find the latest "isnautoitstudio_plugin.au3" file for your plugins. The plugin is disabled by default. - New function in the script tree settings: Select the last modified function in the script tree. The last modified function is always selected in the script tree. (But is not active by default and has to be activated in the program settings under "Script editor -> Script tree"!) - The ISN AutoIt Studio now has several threads. (Autoit_Studio_Helper.exe) These threads will be used in the future to expose server-intensive or ISN blocking functions. For the beginning, it only affects the testing of a Script / project and the search or installation of ISN AutoIt Studio Updates. - Elements in the script tree can now be dragged and dropped into the script. - new translation: Portugues-Brasil (thx to Odaylton) - In the "Data" folder of the ISN AutoIt Studio is now a new .exe with the name "ISN_cmd.exe". This allows the ISN Autit Studio to be controlled via command line switches. The whole is however only in the initial stage! So be further developed! You can find current commands with ISN_cmd.exe /? - The plugin system now no longer uses the MailSlot UDF to communicate with the plugins. The whole thing now runs over WM_COPYDATA. (For further information, see below in Plugin SDK) -> ISN Form Studio 2: <- ----------------------------------- [Fixes] - Various bug fixes - No white background color (0xFFFFFF) could be defined for InputControls. This is now fixed. [Improvements] - Adaptations to the new plug-in system (WM_COPYDATA) - Inconsistent specification of the $ character in handles fixed. Handles should now be given (as actually standard) with the $ character. If not, the FormStudio does not correct this independently. -> Simple File Viewer: <- ----------------------------------- [Fixes] - Various bug fixes [Improvements] - Adaptations to the new plug-in system (WM_COPYDATA) -> Plugin SDK: <- ----------------------------------- - The plugin UDF (isnautoitstudio_plugin.au3) was completely re-created and cleanly documented in English. Furthermore, the UDF has been expanded by numerous new functions. - The plugin SDK now no longer uses the MailSlot UDF! Data is now exchanged via WM_COPYDATA. If you have created plugins yourself. These must only be easily adapted so that they can function again! You only have to replace the new "isnautoitstudio_plugin.au3" file in your own plugins (from the PLUGIN SDK FOLDER) and recompile the plugin. If you have used the function "_Mailslot_abhore" for ISN events from the demo plugin, this must be easily updated. (Check out the new demo plugins on my homepage) Old plugins communicating via the MailSlot UDF are no longer supported! - All plugins offered on my homepage have been upgraded to the new plugin system (WM_COPYDATA). - Many known functions now offer more possibilities than before. For example, the command "_ISNPlugin_Call_Function_in_ISN_AutoIt_Studio" (old UDF: _ISNPlugin_Starte_Funktion_im_ISN) now returns the result of the call. The same is true for "_ISNPlugin_Execute_in_ISN_AutoIt_Studio". - With "_ISNPlugin_Get_Variable_from_ISN_AutoIt_Studio" you can now also transfer arrays from the ISN AutoIt Studio into the plugin. - There are no plugin types anymore! (So far, there were Type 1, 2 and 3, with different possibilities in each case) From now on: Plugin is Plugin! The desired options can be controlled as before via the plugin.ini. However, from now on, the plug-in type is no longer required. You can find information about the plugin.ini in the help file of the ISN AutoIt Studio. - Events from the ISN AutoIt Studio (eg save) can now be easily registered with the function "_ISNPlugin_Register_ISN_Event". Thus no separate "monitoring" function is necessary. (Such as in the Demoplugin with _Mailslot_abhoeren was the case) - Many many new features with which the ISN Studio can be controlled. (Or can retrieve data from the ISN)
    2 points
  3. Bam Bitches! #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = 'cmd /c FOR /F "usebackq skip=2 tokens=1-3" %A IN (`REG QUERY ' & $sKeyname & ' /v ' & $sValuename & ' 2^>nul`) Do @echo %C' Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF)
    2 points
  4. Features: Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 3 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left. Windows 10 style right click menu Credits: @UEZ, for the function to create buttons with text using GDIPlus. @binhnx for his SSCtrlHover UDF Changelog: Download UDF with example:
    1 point
  5. Jon

    AutoIt Script-o-matic

    26,019 downloads

    This is the AutoIt's version of Microsoft Scriptomatic tool by SvenP. If you don't know what Scriptomatic is, see: http://www.microsoft.com/technet/scriptcen...s/scripto2.mspx This version is written in AutoIt script AND it produces an AutoIt script ! Requirements: - AutoIt version 3.1.1.8 (or higher) - Some knowledge about WMI Have fun!
    1 point
  6. water

    ExcelChart

    Version 0.4.0.1

    1,465 downloads

    Extensive library to control and manipulate Microsoft Excel charts. Written by GreenCan and water. Theads: General Help & Support - Example Scripts BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2017-07-21) None. The COM error handling related bugs have been fixed.
    1 point
  7. evilertoaster

    Bitmap Library

    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.zip
    1 point
  8. I think this should work to write the value into all cells in column AB of the used range (untested): Global $oRange = $oWorkbook.ActiveSheet.Range("AB:AB").SpecialCells($xlCellTypeLastCell) ; Returns the last cell in column AB _Excel_RangeWrite($oWorkbook, $oWorkBook.ActiveSheet, "ciao", "AB3:AB" & $oRange.Row)
    1 point
  9. Hmm it seems that the issue comes from _FileWriteFromArray (returns @error=5 if the array is empty) Let's try another way - I changed the paths for the test #Include <Array.au3> #include <File.au3> $sFile = @ScriptDir & '\ForProcessFiles.log' $aFiles = FileReadToArray($sFile) $content = FileRead($sFile) For $i = 0 to UBound($aFiles)-1 If FileExists(@ScriptDir & "\" & $aFiles[$i]) Then FileMove(@ScriptDir & "\" & $aFiles[$i], @ScriptDir & "\out\" & $aFiles[$i]) $content = StringRegExpReplace($content, $aFiles[$i] & '\R?', "") EndIf Next $hFile = FileOpen($sFile, 2) FileWrite($hFile, $content) FileClose($hFile)
    1 point
  10. For the fun ... VIP do you like it ? #Include <Array.au3> $txt = FileRead(@ScriptDir & "\New Text Document (2).txt") $res = StringRegExp($txt, '(?m)^<?(\d+)>?\d?\h+(\S+)\h+(\d+)\h*$', 3) Local $n = UBound($res), $k = 3, $res2D[Ceiling($n/$k)][$k] For $i = 0 To $n - 1 $res2D[Int($i / $k)][Mod($i, $k)] = $res[$i] Next _ArrayDisplay($res2D)
    1 point
  11. mmm ... I see that Koda also has an option to set it manually to AutoIt3.exe when you want ..... so you didn't browse all options and tried them? That actually works pretty well and took a whole 5 minutes to figure out. Jos
    1 point
  12. Something like this: While 1 $body = _IEBodyReadText($oIE) If StringInStr($body, "Get verification code from your Authentication app.") Then Run( $Winauth,"") ExitLoop EndIf Sleep(500) ; wait half a second WEnd
    1 point
  13. Example using WMI. Global Const $HKLM = 0x80000002 Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Local $strComputer = @ComputerName Local $objCtx = ObjCreate("WbemScripting.SWbemNamedValueSet") $objCtx.Add("__ProviderArchitecture", 64) Local $objLocator = ObjCreate("Wbemscripting.SWbemLocator") Local $objServices = $objLocator.ConnectServer($strComputer, "root\default", "", "", Null, Null, Null, $objCtx) Local $objStdRegProv = $objServices.Get("StdRegProv") Local $Inparams = $objStdRegProv.Methods_("GetStringValue").Inparameters $Inparams.Hdefkey = $HKLM $Inparams.Ssubkeyname = "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" $Inparams.Svaluename = "LastLoggedOnUser" Local $Outparams = $objStdRegProv.ExecMethod_("GetStringValue", $Inparams, Null, $objCtx) ConsoleWrite($Outparams.SValue & @CRLF) ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc Saludos
    1 point
  14. Here is the version using regexp #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = 'powershell $test = (reg query ' & $sKeyname & ' /v ' & $sValuename & '); ([regex]::Match($test,''\.\\.+$'')).Groups[0].Value' Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF) Saludos
    1 point
  15. once substring does its magic you can split on whatever you want: $matches is the magical return of -match that houses the data (-match just returns a boolean to the console) #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = "powershell $test = reg query " & $sKeyname & ' /v ' & $sValuename & " ; $test[2].substring(0) -match '\w+\\\w+$' ; $matches" Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF) another example of how to use matches (dumps the boolean to null and retrieves only the domain\user in the stdout): #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = "powershell $test = reg query " & $sKeyname & ' /v ' & $sValuename & " ; $test[2].substring(0) -match '\w+\\\w+$' | out-null ; echo $matches[0]" Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF) This one showing how to use .split to just get the username from the second line #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = "powershell $test = reg query " & $sKeyname & ' /v ' & $sValuename & " ; $test[2].substring(0).split('\')[-1]" Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF)
    1 point
  16. Due yo you are using powershell you probably could do something like this instead using reg query. #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sCmd = "powershell (Get-WmiObject -Class win32_computersystem -ComputerName '" & $sComputer & "').UserName -replace '" & $sComputer & "\\'" Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut) I'll check above question later. Saludos
    1 point
  17. You're welcome. Glad there are people out there finding this capability as useful as I have over the years. It has really helped me when API's are not available and pages need breaking down, as well as API's where JSON information needs breaking down so I can get a particular parameter's data from it. I've used it for getting bitcoin exchange rates, finding new products on websites, seeing a new entry in a top40 charts, seeing when show notes for a new podcast are added to a site, see when the price of a product online goes down and alert me about the lower price, alert me to new threads in a "need help" section of my phone carrier's website. Just endless use I have gotten out of my original Chunk. This new ChunkV2 is so much nicer. If the site gets updated and your chunk zones no longer work, all you need to do is just make new chunk zones that will re-acquire the chunks you need and the rest of your code should be fine still.
    1 point
  18. Hi, You may want to try this too... #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <Array.au3> Opt('MustDeclareVars', 1) $Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work Global $hCombo, $Search , $dbase, $word, $msg ; suggestions database $dbase = "AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying ""runtimes"" required!" _Main() Func _Main() ; Create GUI GUICreate("ComboBox Auto Complete", 400, 296) $hCombo = GUICtrlCreateCombo("", 2, 2, 270, 200) $Search = GUICtrlCreateButton ( " Search ", 275, 2) GUISetState() ; Add files _GUICtrlComboBox_BeginUpdate($hCombo) _GUICtrlComboBox_InsertString($hCombo, "Initial text", 0) _GUICtrlComboBox_EndUpdate($hCombo) _GUICtrlComboBox_ShowDropDown($hCombo, False) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ; Loop until user exits Do $msg = GUIGetMsg() If $msg = $Search Then MsgBox(0,"","Dummy search...") Until $msg = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func _Edit_Changed() $word = _GUICtrlComboBox_GetEditText($hCombo) _GUICtrlComboBox_ResetContent($hCombo) If $word <> "" Then _GUICtrlComboBox_ShowDropDown($hCombo, True) Local $array = StringRegExp($dbase, "(?i)\b"&$word&"\S*", 3) For $i = 0 To UBound($array)-1 _GUICtrlComboBox_InsertString($hCombo, $array[$i], 0) Next Else _GUICtrlComboBox_ShowDropDown($hCombo, False) EndIf _GUICtrlComboBox_SetEditText($hCombo,$word) _GUICtrlComboBox_AutoComplete($hCombo) EndFunc ;==>_Edit_Changed Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo If Not IsHWnd($hCombo) Then $hWndCombo = GUICtrlGetHandle($hCombo) $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case $hCombo, $hWndCombo Switch $iCode Case $CBN_CLOSEUP ; Sent when the list box of a combo box has been closed ; no return value Case $CBN_DBLCLK ; Sent when the user double-clicks a string in the list box of a combo box ; no return value Case $CBN_DROPDOWN ; Sent when the list box of a combo box is about to be made visible ; no return value Case $CBN_EDITCHANGE ; Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box _Edit_Changed() ; no return value Case $CBN_EDITUPDATE ; Sent when the edit control portion of a combo box is about to display altered text ; no return value Case $CBN_ERRSPACE ; Sent when a combo box cannot allocate enough memory to meet a specific request ; no return value Case $CBN_KILLFOCUS ; Sent when a combo box loses the keyboard focus ; no return value Case $CBN_SELCHANGE ; Sent when the user changes the current selection in the list box of a combo box ; no return value Case $CBN_SELENDCANCEL ; Sent when the user selects an item, but then selects another control or closes the dialog box ; no return value Case $CBN_SELENDOK ; Sent when the user selects a list item, or selects an item and then closes the list ; no return value Case $CBN_SETFOCUS ; Sent when a combo box receives the keyboard focus ; no return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND I wrote this script based on _GUICtrlComboBox_AutoComplete sample.
    1 point
×
×
  • Create New...