StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 Lua Scripts
 Action Scripts Using Alien
 Calling Run dialog box through alien (user32.dll)?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
nober Posted - 04/13/2019 : 23:10:21
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);
}
2   L A T E S T    R E P L I E S    (Newest First)
nober Posted - 04/14/2019 : 09:30:56
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
Rob Posted - 04/14/2019 : 07:15:29
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)
end

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000