home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / CENVIW9.ZIP / WINEXEC.LIB < prev    next >
Text File  |  1994-03-08  |  2KB  |  34 lines

  1. // WinExec.lib - Cmm code wrapper for the WinExec function.  This library
  2. // ver.1         can be included in your source file to provide access to
  3. //               to Windows' WinExec() function.
  4. //
  5. // FUNCTION: WinExec()
  6. // SYNTAX: WinExec(CommandLine[,WindowState])
  7. //   CommandLine: String for the command line, wich is the program name to execute
  8. //                followed possibly by optional paramters.
  9. //   WindowState: How to display window (if non-Windows the PIF determines
  10. //                show state).  If not supplied then defaults to SW_SHOWNORMAL.
  11. //                Must be one of the following:
  12.       #define SW_HIDE             0 // Hides the window
  13.       #define SW_SHOWNORMAL       1 // Activate and display at original size and position
  14.       #define SW_SHOWMINIMIZED    2 // Activate and display as an icon
  15.       #define SW_SHOWMAXIMIZED    3 // Activate and display maximized
  16.       #define SW_SHOWNOACTIVATE   4 // Display normal size, but do not make active
  17.       #define SW_SHOW             5 // Activate in current size and position
  18.       #define SW_MINIMIZE         6 // minimize, then active top-window in task list
  19.       #define SW_SHOWMINNOACTIVE  7 // show iconic, do not activate
  20.       #define SW_SHOWNA           8 // show, current active window remains active
  21.       #define SW_RESTORE          9 // same as SW_SHOWNORMAL
  22. // RETURN:   Returns a value less than 32 if error, else returns a value
  23. //           greater than 32 to indicate success.
  24.  
  25.  
  26. WinExec(CommandLine,WindowState)
  27. {
  28.    // WindowState is optional, so use default if it wasn't supplied
  29.    _WindowState = ( va_arg() < 2 ) ? SW_SHOWNORMAL : WindowState ;
  30.    // use DynamicLink to call the WinExec() routine.
  31.    return( DynamicLink("KERNEL","WINEXEC",SWORD16,PASCAL,CommandLine,_WindowState) );
  32. }
  33.  
  34.