This App is No Longer Maintained. Visit the Replacement at

StrokesPlus Forum
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 Action Scripts Using Alien
 Calling Run dialog box through alien (user32.dll)?
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  


20 Posts

Posted - 04/13/2019 :  23:10:21  Show Profile  Reply with Quote
I was wondering if it's possible to use alien to display custom "Run" dialog box through user32.dll.

This is what I found on the web:

[DllImport("shell32.dll", EntryPoint = "#61", CharSet = CharSet.Unicode)]
public static extern int RunFileDlg(
    [In] IntPtr hWnd,
    [In] IntPtr icon,
    [In] string path,
    [In] string title,
    [In] string prompt,
    [In] uint flags);

private static void Main(string[] args)
    // You might also want to add title, window handle...etc.
    RunFileDlg(IntPtr.Zero, IntPtr.Zero, null, null, null, 0);


2606 Posts

Posted - 04/14/2019 :  07:15:29  Show Profile  Visit Rob's Homepage  Reply with Quote
I tried to see if I could get this to work, but it seems alien doesn't like entry points that start with a # (shell32.#61) or number (shell32.61). Below is the code which theoretically would work if it would try to resolve the entry point. Granted, I really don't know a lot about alien, so there may be another way of referencing an entry point. This code in the Global Lua tab, then you'd call aRunFileDlg from an action.
shell32 = aliencore.load("shell32.dll")

gRunDialog = shell32.#61 //shell32.61 gives an error as well
gRunDialog:types{ ret = 'int', abi = 'stdcall', 'long', 'long', 'string', 'string', 'string', 'uint' }
function aRunFileDlg(hWnd, icon, path, title, prompt, flags)
	return gRunFileDlg(hWnd, icon, path, title, prompt, flags)
Go to Top of Page


20 Posts

Posted - 04/14/2019 :  09:30:56  Show Profile  Reply with Quote
I tried to modify with the following

shell32 = alien.core.load("shell32.dll")
gRunDialog = shell32['#61']

and got the error specified procedure is not found.

Anyway, thanks, if this were to work I have to re-write my other code, so thanks for saving me the trouble. :p
Go to Top of Page
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000