English
Regulars table & Café

TerminateProcess.

 


Description:

declared TerminateProcess exits whom angegebenen Process, entlädt however no loaded DLL’s.




Deklaration:

Def @TerminateProcess(2) !KERNEL32,TerminateProcess




Parameter:

1.Parameter: lever the Prozesses
2.Parameter: LongInt Variable with the Exitcode for Process.



Return Value:

0 with failure, otherwise 1.


Examples:

[...] 
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

[keywords:96a8ffacd3]
Process Program task terminate killen
[/keywords:96a8ffacd3]
 
03/05/05  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.410 Views

Untitledvor 0 min.
Andre Rohland06/12/18
Georg Teles05/19/14

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