English
Source / code snippets

Api terminate Fremdprogramm Per started

 

CompileMarkSeparation
Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Fremdprogramm starten und beenden per API
Def @Createprocess(10) !KERNEL32,CreateProcessA
Def @Getexitcodeprocess(2) !KERNEL32,GetExitCodeProcess
Def @Terminateprocess(2) !KERNEL32,TerminateProcess
Declare Command#,Startupinfo#,Processinfo#,Exitcode#

Proc Createprocess

    Parameters Command$
    Declare Handle&
    Dim Command#,Add(Len(Command$),1)
    Dim Startupinfo#,68
    Clear Startupinfo#
    Long Startupinfo#,0=68
    Dim Processinfo#,16
    Clear Processinfo#
    String Command#,0=Command$
    @Createprocess(0,Command#,0,0,0,0,0,0,Startupinfo#,Processinfo#)
    Let Handle&=Long(Processinfo#,0)
    Dispose Command#
    Dispose Startupinfo#
    Dispose Processinfo#
    Return Handle&

Endproc

Proc Killprocess

    Parameters Hprocess&
    Dim Exitcode#,4
    @Getexitcodeprocess(Hprocess&,Exitcode#)
    @Terminateprocess(Hprocess&,@Long(Exitcode#,0))
    Dispose Exitcode#

Endproc

Declare Terminate&,Start&,Programm$
Windowstyle 31
Windowtitle Process starten und killen
Window 0,0-640,440
Let Start&=@Createbutton(%Hwnd,Start,20,300,100,30)
Let Terminate&=@Createbutton(%Hwnd,Terminate,200,300,100,30)
Enablewindow Terminate&,0
Enablewindow Start&,1

While 0=0

    Waitinput

    If @Getfocus(Terminate&)

        Killprocess @&(0)
        Enablewindow Terminate&,0
        Enablewindow Start&,1

    Elseif @Getfocus(Start&)

        Let Programm$=@Loadfile$(Eine Anwendung auswählen:,Programme|*.EXE;*.COM;*.PIF;*.BAT)

        If Programm$<>

            Createprocess Programm$,
            Enablewindow Terminate&,1
            Enablewindow Start&,0

        Endif

    Endif
ass=s4 href='./../../Function-References/XProfan/wend/'>Wend
 
07/15/07  
 



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.960 Views

Untitledvor 0 min.
Thomas Freier01/23/24
AndreasS01/06/19
p.specht01/03/19
Walter Meidl04/25/13

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