This function is going to replace a standard FileRun window, that can be found from “Start -> Run...”.
This function have a $hWnd_Parent parameter, that allow to “attach” the window to another parent window (by WinGetHandle())....
The function is allmoust like the original window, but there is just few excludes -
In this example the window is “attached” to currently active window:
#NoTrayIcon #include <FileRun_Incl.au3> ; Global $RunList = "";"<a href='http://www.autoitscript.com/autoit3/|notepad' class='bbc_url' title=''>http://www.autoitscript.com/autoit3/|notepad"</a> ;We read the current FileRun list For $i = 97 To 122 $RegCurrentVal = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU", Chr($i)) If StringRegExp(StringRight($RegCurrentVal, 2), "\\[0-9]") Then $RegCurrentVal = StringTrimRight($RegCurrentVal, 2) $RunList &= $RegCurrentVal & "|" Next If StringRight($RunList, 1) = "|" Then StringTrimRight($RunList, 1) $RegReadRunList = RegRead("HKEY_CURRENT_USER\Software\_FileRunApp", "") If $RegReadRunList <> "" And StringInStr($RegReadRunList, "|") Then $RunList = $RegReadRunList ;Now we show the dialog $Current_hWnd = WinGetHandle(WinGetTitle("")) $RunList = _FileRun_Dialog($RunList, "FileRun program App", -1, $Current_hWnd) If Not @error And $RunList <> $RegReadRunList Then RegWrite("HKEY_CURRENT_USER\Software\_FileRunApp", "", "REG_SZ", $RunList)
; The UDF is rewrited for latest AutoIt version (22.214.171.124)
; Changed example.
; Now there is no need for #include <GuiConstants.au3> and Opt's funcs, all this is local now.
; If as $hWnd param passed a title, then it converted to a Hwnd.
; Changed the font name - now it's Georgia.
; Now more effective the process of executing app/file, if you type only spaces, then button "Run" will be disabled. And any spaces at end/start of typed/inserted filename will be stripped.
; When you Browse to choose file, the initial dir is the last used (opened), not the @SystemDir.
; If you press Cancel button, then @error set to 1, and returned empty string ("").
* The main UDF is now in seperated Include file.
* Help button from the title bar now work as it should .
* If was called a "file selection window" ('Browse' button), now when we close the FileRun Dialog parent window not minimized as before.
* No more hotkeys set, instead of this i used $BS_DEFPUSHBUTTON style.
* Now when execute program, the working dir is set to program's dir.
* Shortcats now executed properly.
* And more fixes.
_FileRun.zip 3.49K 322 downloads - Compatible with 126.96.36.199.
Edited by MrCreatoR, 22 March 2009 - 09:57 PM.