====== RUNWIN Service ====== ==== Description ==== Passes as a command line string to the Windows [[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp|CreateProcess]] function, to run a program. Note: If is a program, the fully qualified path name of the file needs to be passed. Thus, passing WINWORD.EXE to run Microsoft Word will not work. ==== Parameters ==== ^Parameter^Description^ ||(Optional.) An @FM-delimited array:\\ \\ __Value__\\ <1> Mode to be passed to Windows CreateProcess function. If Value<1> is a negative number, then RUNWIN will work as a "modal" call (it will block all OpenInsight forms and will not return control to the caller until the calling application is completed). returnvalue is then an application exit code.\\ See list of valid modes below\\ <2> Name of callback function to be called when an activated now application is terminated.\\ <3> Parameter to be passed to the callback function| Valid mode values include: ^Value^Mode^ |-1|Modal| |0|Hidden| |1|Normal| |2|ShowMinimized| |3|Maximized| |4|Show but do not activate| |5|Show| |6|Minimize| |7|Show minimized but do not activate| |8|Show Not Available| |9|Restore| ==== Returns ==== An @FM-delimited array: ^Value^ |<1> Exit code of the called process (only if called modally)| |<2> Instance handle of the called process| |<3> Thread ID of the called process| |<4> Process ID of the called process| ==== Remarks ==== For more information about RUNWIN, refer to [[exitcode|EXITCODE in Chapter 4: Properties]]. ==== See Also ==== [[beep_service|BEEP]] Service [[destroy_service|DESTROY]] Service [[removedir_service|REMOVEDIR]] Service [[choosecolor_service|CHOOSECOLOR]] Service [[flush_service|FLUSH]] Service [[renamedir_service|RENAMEDIR]] Service [[choosedir_service|CHOOSEDIR]] Service [[get_event_service|GET_EVENT]] Service [[renamefile_service|RENAMEFILE]] Service [[choosefile_service|CHOOSEFILE]] Service [[getlogicaldrives_service|GETLOGICALDRIVES]] Service [[runhelp_service|RUNHELP]] Service [[choosefont_service|CHOOSEFONT]] Service [[makedir_service|MAKEDIR]] Service [[runwin_service|RUNWIN]] Service [[copyfile_service|COPYFILE]] Service [[objectid_service|OBJECTID]] Service [[textrect_service|TEXTRECT]] Service [[create_service|CREATE]] Service [[objectlist_service|OBJECTLIST]] Service [[wincount_service|WINCOUNT]] Service [[cursor_service|CURSOR]] Service [[printsetup_service|PRINTSETUP]] Service [[utility|Utility]] function ==== Example ==== declare function utility program = "C:\Program Files\Microsoft Office\Office10\WINWORD.EXE" mode = 6 ;* minimized rv = Utility("RUNWIN", program, mode)