from the DOC....
________________________________________________
What types of programs can be used as connect actions?
A connect action can be:
A dynamic-link library (DLL). Only DLLs run synchronously, meaning that Connection Manager starts the action and then waits for the function to return before continuing. The first argument, specified as the Parameters in the Add/Edit Connect Actions dialog box of the CMAK wizard, is the function name within the DLL to call. The syntax for each of these connect actions is:
HRESULT WINAPI function
[IN] HWND hWndParent
[IN] HINSTANCE hinstDll
[IN] LPCSTR pszCommandLine
[IN] DWORD dwReserved
Supported DLL parameters are: Parameter Result
hWndParent Handle to the Connection Manager logon dialog box or NULL; used as the parent window for any user interface displayed by the connect action.
hinstDll Handle to the instance of this DLL.
pszCommandLine String pointer to the command-line arguments.
dwReserved Reserved for future use.
DLLs often have a comment (entered in the description field of the CMAK wizard) that appears while it is being run. This comment has the form Running Connect Action Description. The Connection Manager window is frozen and does not accept input while this action runs.
The connect action requires a return value. If the return value is less than 0, the DLL call failed (SUCCEEDED macro returns False). In the case of a failure, an error message (including the return value) is displayed in the form "Connect Action Description failed return value." If a pre-connect, pre-tunnel, or post-connect action fails, the connection attempt is ended.
The DLL is unloaded after the function call.
Note
For .dll files that require extended times for the program to run, you should implement WM_PAINT in the .dll to ensure that graphics are not disrupted by user actions.
An executable file such as a .bat, .exe, or .cmd file. This type of connect action is run asynchronously, which means that Connection Manager starts the executable, including any command-line parameters, and continues without waiting for the process to exit. No comment appears in the Connection Manager status pane for one of these programs while it is being run.
A shell-executable file, such as a .txt or .doc file. These actions run asynchronously. These files need an appropriate program with which to open the file.
Note
To cause the connection to end after specified programs have ended, set these programs up as auto-applications, not as connect actions. For example, if you want to automatically run an e-mail program, and then automatically end the connection when the user quits the e-mail program, you must set up e-mail as an auto-application, not as a connect action.