Jump to content

Recommended Posts

Posted (edited)

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

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

  • 1 month later...
Posted

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

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

  • 6 months later...
Posted

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

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

  • 1 year later...
Posted (edited)

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]
Posted

  Quote

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.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

And just to think, I get paranoid over bumping a thread that's over a couple months old... :D

Sorry, had to mention that... lol

Anyway, I can actually use this... I hadn't seen it around before, so I appreciate the bump! :o

SIGNATURE_0X800007D NOT FOUND

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
  • Recently Browsing   0 members

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