Sign in to follow this  
Followers 0
wraithdu

ShellExecute() with NULL verb

4 posts in this topic

There doesn't seem to be a way in AutoIt to use ShellExecute() with NULL as the verb. This is useful to execute the default verb for a filetype. Behavior is to execute the default verb, if none specified then it executes 'open', and if 'open' does not exist it executes the first verb in the list in the registry.

Maybe this is already changed in Beta? If not, it should be an option. Currently you have to use DllCall() if you want to do it this way.

Share this post


Link to post
Share on other sites



There doesn't seem to be a way in AutoIt to use ShellExecute() with NULL as the verb. This is useful to execute the default verb for a filetype. Behavior is to execute the default verb, if none specified then it executes 'open', and if 'open' does not exist it executes the first verb in the list in the registry.

Maybe this is already changed in Beta? If not, it should be an option. Currently you have to use DllCall() if you want to do it this way.

Can you give an example of where you find you need to use a dllCall() because you can't use ShellExecute?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I've written an app (in AutoIt of course) that allows a user to create portable file associations. It does so by using relative paths and the HKCU\Software\Classes... filetype registry keys. It creates its own associations based on the user's configuration and uses its own naming scheme to create the shell\command etc. keys. This basically overrides the default filetype associations. Since the app uses its own naming scheme to keep track of everything, the default verbs are missing. So any app that calls a default verb such as 'open' or 'edit' will fail. I realize that for the most part this is just something a user will have to live with, since most apps will specify 'open' or 'edit' for the verb.

But if apps/scripts are coded using NULL as the verb, then the filetype will open as long as some association exists in the registry. I just figured since NULL is a valid parameter according to MSDN, that it should be an option in AutoIt.

My app is here if you want to look at it - http://portableapps.com/node/13145

BTW, a little tangent here, what is the most correct way to pass a NULL parameter to DllCall()? So far I've successfully used

"int", ""

and

"<anything>", Chr(0)

I've also seen

"int", 0

but I don't like that since 0 is a valid int in some functions.

Edited by wraithdu

Share this post


Link to post
Share on other sites

I would use a null pointer: "ptr",""


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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  
Followers 0