Jump to content
Sign in to follow this  

Programatically show Run dialog

Recommended Posts

ok, theres this windows api function SHRunDialog in Shell32.dll, and for those that kno VB, here is how the function is declared:

Declare Function SHRunDialog Lib "shell32" Alias "#61" (ByVal hOwner As IntPtr, ByVal Unknown1 As Long, ByVal Unknown2 As Long, ByVal szTitle As String, ByVal szPrompt As String, ByVal uFlags As Long) As Long

and how it is used:

SHRunDialog(handle, 0, 0, Nothing, Nothing, 0)

note that "handle" is any hwnd value, as the box is placed near whatever corresponds to the hwnd, the first "Nothing" shows the default title ("Run") and the second "Nothing" shows the default prompt. So,

SHRunDialog(handle, 0, 0, "Cheese", "Enter ur text", 0)
would produce a run dialog with the title as Cheese and the prompt as Enter ur text.

My problem is doing this in AutoIt. Here is my code:

Opt ("WinTitleMatchMode", 4)
Opt ("WinTextMatchMode", 2)
$MyHwnd = ControlGetHandle("classname=Shell_TrayWnd", "", "Button1")
DllCall("shell32.dll", "long", "SHRunDialog", "hwnd", $MyHwnd, "long", 0, "long", 0, "str", "", "str", "", "long", 0)

Why wont this work? Thanx!


PS wow that was long lol

i own this sig... php rulezlinks:My PSP Web Portal

Share this post

Link to post
Share on other sites

I don't understand why you are taking this route vs. the AutoIt command Run() and RunWait().

I'd be extremely careful with this API call. It is not well documented.

Secondly, I think we should delete this topic.

Share this post

Link to post
Share on other sites

Using a latest BETA /w COM. Try this.

$objShell = ObjCreate("Shell.Application")


Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...