//'*********************************************************************** //' DISPLAYED WITH PERMISSION OF ROY SCOTT ENTERPRISES //' AND THE AUTHOR AS AN ARCHIVING FUNCTION //' http://www.scottserver.net/forum/index.php //' ALL RIGHTS RESERVED //'************************************************************************ //' MINOR EDITING PERFORMED BY UPLA STAFF //'************************************************************************ //MichaelW //ShellExecute //Code: // // This is a quick investigation of ShellExecute. // // These constants are from Win32API.txt. // // ERROR_FILE_NOT_FOUND = 2 // ERROR_PATH_NOT_FOUND = 3 // ERROR_BAD_FORMAT = 11 // // Regular WinExec() codes // // SE_ERR_FNF = 2 (File not found) // SE_ERR_PNF = 3 (Path not found) // SE_ERR_ACCESSDENIED = 5 // SE_ERR_OOM = 8 (Out of memory) // SE_ERR_DLLNOTFOUND = 32 // // ShellExecute() codes // // SE_ERR_SHARE = 26 // SE_ERR_ASSOCINCOMPLETE = 27 // SE_ERR_DDETIMEOUT = 28 // SE_ERR_DDEFAIL = 29 // SE_ERR_DDEBUSY = 30 // SE_ERR_NOASSOC = 31 // // ShowWindow() commands // // An application should specify SW_SHOWDEFAULT when // displaying the window for the first time. // // The actions of SW_SHOWMINIMIZED and SW_SHOWMAXIMIZED // appear to be reversed ?? // // SW_HIDE = 0 // SW_SHOWNORMAL = 1 // SW_NORMAL = 1 // SW_SHOWMINIMIZED = 2 // SW_SHOWMAXIMIZED = 3 // SW_MAXIMIZE = 3 // SW_SHOWNOACTIVATE = 4 // SW_SHOW = 5 // SW_MINIMIZE = 6 // SW_SHOWMINNOACTIVE = 7 // SW_SHOWNA = 8 // SW_RESTORE = 9 // SW_SHOWDEFAULT = 10 // SW_MAX = 10 Declare %res%,$content$,$var$. // Valid operations are "open", "print", and "explore". // // The return value will be > 32 if successful, or an // error value that is <= 32 otherwise. // (%ShellExecute %res%=$operation$,$prog$,$file$,$wdir$,%mode%) %ShellExecute %res% = "open", "notepad.exe", "c:\\autoexec.bat", "", '10'. // %ShellExecute %res% = "print", "c:\\autoexec.bat", "", "", '10'. %ShellExecute %res% = "explore", "c:\\", "", "", '10'. $Str $var$ = %res%. %MBox %res% = $var$, "Return value", '0'. End.