subroutine sub_Process(prog, cmdline)
use DFMT
use dflib
use dfwin, only : messagebox, NULL, GetWindowsDirectory, GetCurrentDirectory,lstrlen

use proc

integer, parameter :: SW_SHOWDEFAULT        = 10

character(max_path) Buf
logical retlog
type(StartupInfo) SI
type(Process_Information) PI		!; common/Proc_Inf/PI
character (max_path) lpAppName, lpCmdLine

character(max_path) prog, cmdline


!SI%cb =800
SI%cb =sizeof(SI)

!
write(10,*) SI%cb
!

SI%wShowWindow =sw_showdefault

!
!iwin = GetWindowsDirectory(WinBuf, max_path)
!prog = WinBuf(:iwin)//'\Notepad.exe'

!icur =GetCurrentDirectory(max_path, Buf)


lpAppName =trim(prog)//''C		!'Notepad.exe'//''C

lpCmdLine =trim(cmdline)//''C

retlog = CreateProcess(loc(lpAppName), loc(lpCmdLine), 0, 0, .false., &
0, 0, 0, loc(SI), loc(PI))


if(.not. retlog) then
Buf =trim(prog)//": Failed run!"C
i = MessageBox (NULL, Trim(buf), "NELSAS: Process Message"C, MB$ICONINFORMATION)

else
npr =npr+1
pr(npr)%handle =PI%hProcess
pr(npr)%PID =PI%dwProcessId
endif

END subroutine sub_Process

