3 posts in this topic
Wanted to create an AutoComplete function like "Start » Run" functionality for both Urls and Files using SHAutoComplete function, Unfortunately my knowledge is quite limited and so put the following together based on existing functions and snippets online. While everything works fine, I'm not sure if I've written the function correctly and was hoping someone with more experience with WinAPI could look it over and let me know if I've missed anything.
Thanks in advance.
#include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> Global Const $SHACF_AUTOAPPEND_FORCE_OFF = 0x80000000 Global Const $SHACF_AUTOAPPEND_FORCE_ON = 0x40000000 Global Const $SHACF_AUTOSUGGEST_FORCE_OFF = 0x20000000 Global Const $SHACF_AUTOSUGGEST_FORCE_ON = 0x10000000 Global Const $SHACF_DEFAULT = 0x00000000 Global Const $SHACF_FILESYS_ONLY = 0x00000010 Global Const $SHACF_FILESYS_DIRS = 0x00000020 Global Const $SHACF_FILESYSTEM = 0x00000001 Global Const $SHACF_URLHISTORY = 0x00000002 Global Const $SHACF_URLMRU = 0x00000004 Global Const $SHACF_USETAB = 0x00000008 Global Const $SHACF_URLALL = BitOR($SHACF_URLHISTORY, $SHACF_URLMRU) Global Const $SHACF_VIRTUAL_NAMESPACE = 0x00000040 ; #FUNCTION# =========================================================================================================== ; Name...........: __WinAPI_SHAutoComplete ; Description ...: Instructs system edit controls to use AutoComplete to help complete URLs or file system paths in a ; Input or ComboBoxEx control. ; Syntax.........: __WinAPI_SHAutoComplete ( $hWnd [, $dwFlag = $SHACF_DEFAULT] ) ; Parameters ....: $hWnd - Handle of parent window ; $dwFlags - The flags to control the operation of SHAutoComplete: ; | $SHACF_AUTOAPPEND_FORCE_OFF - Ignore the registry default and force the AutoAppend feature off. ; This flag must be used in combination with one or more of the ; SHACF_FILESYS* or SHACF_URL* flags. ; | $SHACF_AUTOAPPEND_FORCE_ON - Ignore the registry value and force the AutoAppend feature on. The ; completed string will be displayed in the edit box with the added ; characters highlighted. This flag must be used in combination with ; one or more of the SHACF_FILESYS* or SHACF_URL* flags. ; |$SHACF_AUTOSUGGEST_FORCE_OFF - Ignore the registry default and force the AutoSuggest feature off. ; This flag must be used in combination with one or more of the ; SHACF_FILESYS* or SHACF_URL* flags. ; |$SHACF_AUTOSUGGEST_FORCE_ON - Ignore the registry value and force the AutoSuggest feature on. A ; selection of possible completed strings will be displayed as a ; drop-down list, below the edit box. ; This flag must be used in combination with one or more of the ; SHACF_FILESYS* or SHACF_URL* flags. ; |$SHACF_DEFAULT - The default setting, equivalent to SHACF_FILESYSTEM + SHACF_URLALL. ; SHACF_DEFAULT cannot be combined with any other flags. ; |$SHACF_FILESYS_ONLY - Include the file system only. ; |$SHACF_FILESYS_DIRS - Include the file system and directories, UNC servers, and UNC server ; shares. ; |$SHACF_FILESYSTEM - Include the file system and the rest of the Shell (Desktop, Computer, ; and Control Panel, for example). ; |$SHACF_URLHISTORY - Include the URLs in the user's History list. ; |$SHACF_URLMRU - Include the URLs in the user's Recently Used list. ; |$SHACF_USETAB - Allow the user to select from the autosuggest list by pressing the ; TAB key. If this flag is not set, pressing the TAB key will shift ; focus to the next control and close the autosuggest list. If ; SHACF_USETAB is set, pressing the TAB key will select the first item ; in the list. Pressing TAB again will select the next item in the list, ; and so on. When the user reaches the end of the list, the next TAB key ; press will cycle the focus back to the edit control. This flag must be ; used in combination with one or more of the SHACF_FILESYS* or ; SHACF_URL* flags listed on this page. ; |$SHACF_URLALL - Include the URLs in the users History and Recently Used lists. ; Equivalent to SHACF_URLHISTORY + SHACF_URLMRU. ; |$SHACF_VIRTUAL_NAMESPACE ; Author ........: Subz ; Remarks .......: The first four flags are used to override the Internet Explorer registry settings. The user can change these ; settings manually by launching the Internet Options property sheet from the Tools menu and clicking the ; Advanced tab. ; https://msdn.microsoft.com/en-us/library/windows/desktop/bb759862(v=vs.85).aspx ; =============================================================================================================================== Func __WinAPI_SHAutoComplete($hWnd, $dwFlags = $SHACF_DEFAULT) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $hWndEdit, $aResult Switch _WinAPI_GetClassName($hWnd) Case 'ComboBoxEx32' $hWndEdit = _GUICtrlComboBoxEx_GetEditControl($hWnd) Case 'Edit' $hWndEdit = $hWnd Case Else Return EndSwitch $aResult = DllCall('shlwapi.dll', 'long', 'SHAutoComplete', 'hwnd', $hWndEdit, 'int', $dwFlags) If @error Or Not $aResult Then Return SetError(@error, @extended, '') Return SetExtended($aResult, $aResult) EndFunc ;==>__WinAPI_SHAutoComplete Global $hGui_FileSystem Global $hGui_WebHistory Example() Func Example() ; Create GUI $hGui = GUICreate('Example', 600, 100) GUICtrlCreateLabel('Website History:', 5, 5, 150, 21) $hGui_WebHistory = GUICtrlCreateInput('http://', 2, 2, 380, 21) __WinAPI_SHAutoComplete($hGui_WebHistory, BitOR($SHACF_AUTOAPPEND_FORCE_ON, $SHACF_URLHISTORY, $SHACF_USETAB)) $hGui_FileSystem = _GUICtrlComboBoxEx_Create($hGui, "", 2, 42, 396, 120) GUISetState(@SW_SHOW) _GUICtrlComboBoxEx_BeginUpdate($hGui_FileSystem) _GUICtrlComboBoxEx_AddDir($hGui_FileSystem, @WindowsDir & "\*.exe") _GUICtrlComboBoxEx_EndUpdate($hGui_FileSystem) __WinAPI_SHAutoComplete($hGui_FileSystem, BitOR($SHACF_AUTOAPPEND_FORCE_ON, $SHACF_FILESYSTEM, $SHACF_USETAB)) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example
Hello, I just noticed something strange... all of the "Tools" in SciTE's tools menu have disappeared!
I am sure that I saw them yesterday... don't know what happened today ! I am using SciTE v3.6.6 which I believe is the latest version... Thanks in Advance!
I'm having some problems with SciTe, when I copy and paste, select text, or etc., there's sometimes text blinking(not the cursor, but the whole text!), or black lines, they blink(like cursor do).
When I reinstalled AutoIt all SciTe settings were left, and when I open up scite editor, I had same problem. (Btw., I use theme)
How to fully uninstall AutoIT and SciTE, and install it again without leaving any settings or etc.?
Solved: System restore helped me...
Long story short: I am updating a program I created many years ago for our Help Desk. I haven't used AutoIt in a while so I downloaded it again. Of course there were several script breaking changes so I opted to download an older version of AutoIt (184.108.40.206) which worked. However when downloading the full Scite it produces the attached error when trying to compile my script. I need the full version of Scite to compile with options. Is it possible to download older versions of Scite or is there an easy fix for this issue? I have attempted reinstalling, uninstalling/rebooting/reinstalling to no avail.
Weird story. Been using Autoit for more than a year now. But recently moved to a new machine, so did a fresh install, and suddenly I saw menus I never saw before in the editor.
For example, I Always used to have: Tools>Compile and then it would compile my au3 code. Now, the tools menu has a lot of options but after pressing Compile it goes to a whole new screen specifically for au3 code to select more options, also it debugs my code, which prevents compiling if badly coded.
Of course this is fine, but I would really like to recompile some old crappy code I wrote, regardless of the mistakes that are still in there, also I am really used to the old setup I had,
so kind of not done, but how do i get this 'bad' configuration back? Does it have to do with the au3.properties file? What should I do with it....