Jump to content

_FileRun UDF


MrCreatoR
 Share

Recommended Posts

Hi!

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 - the help button do nothing (if someone can show me how can i make it do something, it will be great) now it does :), and this is a custom window that can be used with your apps :whistle: .

In this example the window is “attached” to currently active window:

#NoTrayIcon
#include <FileRun_Incl.au3>
;

Global $RunList = "";"http://www.autoitscript.com/autoit3/|notepad"

;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)

EDIT (22.03.2009):

; The UDF is rewrited for latest AutoIt version (3.3.0.0)

EDIT (11.04.2007):

; 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 ("").

EDIT (02.11.2007):

Totaly rewrited;

* The main UDF is now in seperated Include file.

* Help button from the title bar now work as it should :lol:.

* 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.au3 - See the next attached zip file, it include example and the UDF.

_FileRun.zip

_FileRun.zip - Compatible with 3.3.0.0.

Edited by MrCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

  • 1 month later...

Edit the first post, the function is modified "badly" :shocked: - see attached file at the first post to get full function (with example).

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

  • 6 months later...

EDIT (02.11.2007):

Totaly rewrited;

* 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.

See the first post :)

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

  • 1 year later...

Hi, i know it's been like 2 years since you last posted anything on this UDF, but i am having some errors.

So first, the Include GuiCombo.au3, where do I get it?

And second, all the RunErrorsFatal Errors? what are the and why are they?

I assume that the last error (ERROR: _GUICtrlComboAutoComplete(): undefined function) Is because of the missing Include

CODE
C:\Documents and Settings\%username%\Desktop\FileRun_Incl.au3(2,10) : ERROR: can't open include file <GuiCombo.au3>

#include <GuiCombo.au3>

~~~~~~~~~^

C:\Documents and Settings\%username%\Desktop\FileRun_Incl.au3(33,49) : ERROR: Opt() called with illegal argument 1: "RunErrorsFatal"

Local $OldOptErrFatal = Opt("RunErrorsFatal", 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\%username%\Desktop\FileRun_Incl.au3(129,39) : ERROR: Opt() called with illegal argument 1: "RunErrorsFatal"

Opt("RunErrorsFatal", $OldOptErrFatal)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\%username%\Desktop\FileRun_Incl.au3(138,42) : ERROR: Opt() called with illegal argument 1: "RunErrorsFatal"

Local $Old_REF = Opt("RunErrorsFatal", 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\%username%\Desktop\FileRun_Incl.au3(141,32) : ERROR: Opt() called with illegal argument 1: "RunErrorsFatal"

Opt("RunErrorsFatal", $Old_REF)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\%username%\Desktop\FileRun_Incl.au3(125,48) : ERROR: _GUICtrlComboAutoComplete(): undefined function.

_GUICtrlComboAutoComplete($ComboBox, $LastRun)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\%username%\Desktop\_FileRun_Example.au3 - 6 error(s), 0 warning(s)

Thanks in advance!

Edited by colafrysen
[font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size]
Link to comment
Share on other sites

i am having some errors

You can read about the changes between AutoIt versions here, i sure you are using the latest one :D.

P.S

Uploaded a fixed version (check the first post), for AutoIt 3.3.0.0.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Thanks! Awesome UDF, appreciate all your work :D

[font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...