Jump to content

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!

~naku

PS wow that was long lol

i own this sig... php rulezlinks:My PSP Web Portal
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...