English
Source / code snippets

produce Process to supervise

 
small Spielerei to one View source of Ragnar Rehbein:
CompileMarkSeparation
DEF CreateProcessA(10)    ! "Kernel32","CreateProcessA"
DEF GetExitCodeProcess(2) ! "Kernel32","GetExitCodeProcess"
DEF TerminateProcess(2)   ! "Kernel32","TerminateProcess"
DEF ZeroMemory(2)         ! "Kernel32","RtlZeroMemory"
Declare lpCommandLine#
Declare lpStartupInfo#
Declare lpProcessInformation#
Declare ExitCode#
Declare Prozess$

Proc CreateProcess

    Parameters CommandLine$,Showparameter$,XPOS$,YPOS$,XSIZE$,YSIZE$
    Declare hProcess&,Flags&
    Dim lpCommandLine#,Len(CommandLine$)+1
    Dim lpStartupInfo#,68
    ZeroMemory(lpStartupinfo#,68)
    Long lpStartupInfo#,0=68
    Case Showparameter$<>"" : LET FLAGS&=FLAGS&+1
    CASE @OR(XPOS$<>"",YPOS$<>"") : LET FLAGS&=FLAGS&+4
    CASE @OR(XSIZE$<>"",YSIZE$<>"") : LET FLAGS&=FLAGS&+2
    Long lpStartupInfo#,44=Flags& Flag, welche Anteile von Startupinfo berücksichtigt werden sollen
    Word lpStartupInfo#,48=@VAL(Showparameter$) SHOWParameter von WinExec
    Long lpStartupInfo#,16=@VAL(XPOS$) Einleuchtend - oder?
    Long lpStartupInfo#,20=@VAL(YPOS$) Einleuchtend - oder?
    Long lpStartupInfo#,24=@VAL(XSIZE$) Einleuchtend - oder?
    Long lpStartupInfo#,28=@VAL(YSIZE$) Einleuchtend - oder?
    Dim lpProcessInformation#,16
    ZeroMemory(lpProcessInformation#,16)
    String lpCommandLine#,0=CommandLine$
    CreateProcessA(0,lpCommandLine#,0,0,0,0,0,0,lpStartupInfo#,lpProcessInformation# )
    hProcess&=Long(lpProcessInformation#,0)
    Dispose lpCommandLine#
    Dispose lpStartupInfo#
    Dispose lpProcessInformation#
    Return hProcess&

EndProc

Proc KillProcess

    Parameters hProcess&
    GetExitCodeProcess(hProcess&,Exitcode#)
    TerminateProcess(hProcess&,Long(exitcode#,0))
    Dispose Exitcode#

EndProc

Proc ProcessStatus

    parameters prozid&
    declare status&
    GetExitCodeProcess(prozid&,Exitcode#)
    status& = long(Exitcode#,0)
    return status&

endproc

Declare hProcess&
LET PROZESS$=@LOADFILE$("Datei auswählen","*.EXE")
CASE PROZESS$="" : END
Dim exitcode#,4
createprocess PROZESS$,"0","","","","" Prozess versteckt
createprocess PROZESS$,"1","100","30","200","100" Prozess sichtbar
createprocess PROZESS$,"2","10","30","400","400" Prozess minimiert
LET hProcess& = @&(0)
Windowstyle 31+512
WindowTitle "Prozess überwachen"
Window 0,0-640,440
settimer 400

while %MENUITEM<>-2

    waitinput
    ProcessStatus hProcess&
    print @&(0)
    print hex$(long(Exitcode#,0))

endwhile

KillProcess hProcess&
Dispose
xitcode# End
 
03/26/05  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.292 Views

Untitledvor 0 min.
H.Brill05/24/20
AndreasS11/27/18
Tango07/21/17
W.L.07/05/17
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie