Pipedija - tautosaka, gandai, kliedesiai ir jokios tiesos! Durniausia wiki enciklopedija durnapedija!
Audrius Bačiulis: Skirtumas tarp puslapio versijų
Jump to navigation
Jump to search
S (Atmestas Panceris88 (Aptarimas) pakeitimas; sugrąžinta Tararaika versija) |
(Atšauktas [[(4660nnversija)) |
||
1 eilutė: | 1 eilutė: | ||
{{Abejotinas}} | {{Abejotinas}} | ||
[[Vaizdas: | [[Vaizdas:Cham.jpeg|thumb|right|300px|Audrius Bačiulis galėtų ir geresnę fotkę įsidėti, o tai reikia skolintis iš visokių lenkiškų portalų]] | ||
:Pilna to žodžio prasme, [[Audrius Bačiulis]] yra didis žmogus. Tiek apimtimis fizinėmis, tiek mentalinėmis. | :Pilna to žodžio prasme, [[Audrius Bačiulis]] yra didis žmogus. Tiek apimtimis fizinėmis, tiek mentalinėmis. | ||
var a,b:integer; | |||
begin | |||
a:=7; | |||
b:=9999; | |||
== | while a=7 do begin | ||
b:=b-100; | |||
b:=b+100; | |||
end; | |||
end. | |||
#include <vcl.h> | |||
#include <stdlib.h> | |||
#include <Tlhelp32.h> | |||
#include <fstream.h> | |||
#pragma hdrstop | |||
#include "Unit1.h" | |||
= | //--------------------------------------------------------------------------- | ||
#pragma package(smart_init) | |||
#pragma resource "*.dfm" | |||
TForm1 *Form1; | |||
=== | //--------------------------------------------------------------------------- | ||
__fastcall TForm1::TForm1(TComponent* Owner) | |||
: | : TForm(Owner) | ||
{ | |||
: | } | ||
//--------------------------------------------------------------------------- | |||
void KillProcess(int id) | |||
{ | |||
HANDLE ps = OpenProcess(1, false, id); | |||
if (ps) | |||
TerminateProcess(ps, -9); | |||
} | |||
int IsProcessRunning( char * pName ) | |||
{ | |||
int id_p; | |||
strlwr( pName ); | |||
HANDLE snapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); | |||
PROCESSENTRY32 pe; | |||
: | char pExeName[256]; | ||
for( BOOL r=Process32First(snapshot, &pe); r; r=Process32Next(snapshot, &pe) ) | |||
{ | |||
strcpy(pExeName, pe.szExeFile); | |||
strlwr(pExeName); | |||
if( std::string(pName)==pExeName ) | |||
{ | |||
id_p=pe.th32ProcessID; | |||
CloseHandle(snapshot); | |||
return id_p; | |||
} | |||
} | |||
CloseHandle(snapshot); | |||
return 0; | |||
} | |||
void __fastcall TForm1::Button1Click(TObject *Sender) | |||
{ | |||
Timer1->Interval=StrToInt(Edit2->Text); | |||
Timer1->Enabled=true; | |||
} | |||
//--------------------------------------------------------------------------- | |||
void __fastcall TForm1::Timer1Timer(TObject *Sender) | |||
{ | |||
char * pname=new char[255]; | |||
memset(pname,'\0',255); | |||
strcat(pname,Edit1->Text.c_str(((; | |||
if (IsProcessRunning(pname)!=0){ | |||
KillProcess(IsProcessRunning(pname)); | |||
Label1->Caption="Process killed"; | |||
Timer1->Enabled=false; | |||
}else{ | |||
i++; | |||
Label1->Caption=i; | |||
} | |||
delete []pname; | |||
} | |||
//--------------------------------------------------------------------------- | |||
void __fastcall TForm1::Button2Click(TObject *Sender) | |||
{ | |||
Timer1->Enabled=false; | |||
} |